Test Failed
Pull Request — master (#239)
by Viruthagiri
14:39
created
tests/test-Test_Dummy_Data.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Indentation   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -1,50 +1,50 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
tests/test-Import_Export.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,19 +1,19 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
geodirectory-functions/user_functions.php 3 patches
Braces   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
                 }
Please login to merge, or discard this patch.
Indentation   +119 added lines, -119 removed lines patch added patch discarded remove patch
@@ -13,28 +13,28 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -11,22 +11,22 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
             }
Please login to merge, or discard this patch.
geodirectory-admin/option-pages/general_settings_array.php 2 patches
Indentation   +259 added lines, -259 removed lines patch added patch discarded remove patch
@@ -16,87 +16,87 @@  discard block
 block discarded – undo
16 16
  */
17 17
 $general_options = apply_filters('geodir_general_options', array(
18 18
 
19
-    array('name' => __('General', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'general_options'),
20
-
21
-    array('name' => __('General Options', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'general_options'),
22
-
23
-    array(
24
-        'name' => __('Sender name', 'geodirectory'),
25
-        'desc' => __('(Name that will be shown as email sender when users receive emails from this site)', 'geodirectory'),
26
-        'id' => 'site_email_name',
27
-        'type' => 'text',
28
-        'css' => 'min-width:300px;',
29
-        'std' => get_bloginfo('name') // Default value for the page title - changed in settings
30
-    ),
31
-
32
-    array(
33
-        'name' => __('Email address', 'geodirectory'),
34
-        'desc' => __('(Emails to users will be sent via this mail ID)', 'geodirectory'),
35
-        'id' => 'site_email',
36
-        'type' => 'text',
37
-        'css' => 'min-width:300px;',
38
-        'std' => get_bloginfo('admin_email') // Default value for the page title - changed in settings
39
-    ),
40
-    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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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',
Please login to merge, or discard this patch.
tests/selenium/base.php 3 patches
Doc Comments   +22 added lines patch added patch discarded remove patch
@@ -10,6 +10,9 @@  discard block
 block discarded – undo
10 10
         $this->setBrowserUrl(self::GDTEST_BASE_URL);
11 11
     }
12 12
 
13
+    /**
14
+     * @param string $search
15
+     */
13 16
     function isTextPresent($search)
14 17
     {
15 18
         $source = $this->source();
@@ -62,6 +65,9 @@  discard block
 block discarded – undo
62 65
         }
63 66
     }
64 67
 
68
+    /**
69
+     * @param string $redirect
70
+     */
65 71
     function maybeUserLogin($redirect, $force=false) {
66 72
         if ($force) {
67 73
             $this->url(self::GDTEST_BASE_URL.'wp-admin/');
@@ -87,6 +93,9 @@  discard block
 block discarded – undo
87 93
         }
88 94
     }
89 95
 
96
+    /**
97
+     * @param string $redirect
98
+     */
90 99
     function maybeAdminLogin($redirect) {
91 100
         $this->url($redirect);
92 101
         $this->waitForPageLoadAndCheckForErrors();
@@ -121,6 +130,9 @@  discard block
 block discarded – undo
121 130
         return $exists;
122 131
     }
123 132
 
133
+    /**
134
+     * @param string $script
135
+     */
124 136
     function ExecuteScript($script, $args=array()) {
125 137
         $this->execute( array(
126 138
             'script' => $script ,
@@ -133,10 +145,16 @@  discard block
 block discarded – undo
133 145
         $this->ExecuteScript('jQuery("#wpadminbar").hide();');
134 146
     }
135 147
 
148
+    /**
149
+     * @param string $string
150
+     */
136 151
     function logInfo($string) {
137 152
         fwrite(STDOUT, "Info: ".$string . PHP_EOL);
138 153
     }
139 154
 
155
+    /**
156
+     * @param string $string
157
+     */
140 158
     function logError($string) {
141 159
         fwrite(STDOUT, "Error: ".$string . PHP_EOL);
142 160
     }
@@ -157,6 +175,10 @@  discard block
 block discarded – undo
157 175
         return (int) $content;
158 176
     }
159 177
 
178
+    /**
179
+     * @param integer $current
180
+     * @param integer $completed
181
+     */
160 182
     function skipTest($current, $completed) {
161 183
         if ($completed == 0 || $completed == 42 || $current == $completed) {
162 184
             return false;
Please login to merge, or discard this patch.
Indentation   +191 added lines, -191 removed lines patch added patch discarded remove patch
@@ -1,199 +1,199 @@
 block discarded – undo
1 1
 <?php
2 2
 class GD_Test extends PHPUnit_Extensions_Selenium2TestCase {
3 3
 
4
-    const GDTEST_BASE_URL = 'http://www.test.ci/selpress/';
5
-
6
-    public function setUp()
7
-    {
8
-        $this->setSeleniumServerRequestsTimeout(300);
9
-        $this->setBrowser('firefox');
10
-        $this->setBrowserUrl(self::GDTEST_BASE_URL);
11
-    }
12
-
13
-    function isTextPresent($search)
14
-    {
15
-        $source = $this->source();
16
-        if ( strpos((string)$source,$search) !== FALSE) {
17
-            return true;
18
-        } else {
19
-            return false;
20
-        }
21
-    }
22
-
23
-    function randomEmailID()
24
-    {
25
-        return md5(uniqid(rand(), true)).'@gmail.com';
26
-    }
27
-
28
-    function waitForPageLoadAndCheckForErrors($timeout=10000)
29
-    {
30
-        // Wait 10 seconds
31
-        $this->timeouts()->implicitWait($timeout);
32
-        $this->checkForErrors();
33
-        $this->checkForJsErrors();
34
-    }
35
-
36
-    function checkForErrors()
37
-    {
38
-        $elements = $this->elements($this->using('css selector')->value('.xdebug-error'));
39
-        if ($elements) {
40
-            $total = count($elements);
41
-            fwrite(STDOUT, $total.' errors found'. PHP_EOL);
42
-            $count = 0;
43
-            foreach ($elements as $i => $element) {
44
-                $count++;
45
-                if ($errors = $element->attribute('innerHTML')) {
46
-                    fwrite(STDOUT, "========================================================================". PHP_EOL);
47
-                    fwrite(STDOUT, strip_tags($errors). PHP_EOL);
48
-                    if ($count == $total) {
49
-                        fwrite(STDOUT, "========================================================================". PHP_EOL);
50
-                    }
51
-                }
52
-            }
53
-        }
54
-    }
55
-
56
-    function checkForJsErrors() {
57
-        if ($this->isElementExists('sel_js_error')) {
58
-            fwrite(STDOUT, 'Javascript errors found'. PHP_EOL);
59
-            fwrite(STDOUT, "========================================================================". PHP_EOL);
60
-            echo $this->byId('sel_js_error')->attribute('innerHTML');
61
-            fwrite(STDOUT, "========================================================================". PHP_EOL);
62
-        }
63
-    }
64
-
65
-    function maybeUserLogin($redirect, $force=false) {
66
-        if ($force) {
67
-            $this->url(self::GDTEST_BASE_URL.'wp-admin/');
68
-            if ($this->isTextPresent("forgetmenot")) {
69
-                $this->byId('user_login')->value('[email protected]');
70
-                $this->byId('user_pass')->value('1');
4
+	const GDTEST_BASE_URL = 'http://www.test.ci/selpress/';
5
+
6
+	public function setUp()
7
+	{
8
+		$this->setSeleniumServerRequestsTimeout(300);
9
+		$this->setBrowser('firefox');
10
+		$this->setBrowserUrl(self::GDTEST_BASE_URL);
11
+	}
12
+
13
+	function isTextPresent($search)
14
+	{
15
+		$source = $this->source();
16
+		if ( strpos((string)$source,$search) !== FALSE) {
17
+			return true;
18
+		} else {
19
+			return false;
20
+		}
21
+	}
22
+
23
+	function randomEmailID()
24
+	{
25
+		return md5(uniqid(rand(), true)).'@gmail.com';
26
+	}
27
+
28
+	function waitForPageLoadAndCheckForErrors($timeout=10000)
29
+	{
30
+		// Wait 10 seconds
31
+		$this->timeouts()->implicitWait($timeout);
32
+		$this->checkForErrors();
33
+		$this->checkForJsErrors();
34
+	}
35
+
36
+	function checkForErrors()
37
+	{
38
+		$elements = $this->elements($this->using('css selector')->value('.xdebug-error'));
39
+		if ($elements) {
40
+			$total = count($elements);
41
+			fwrite(STDOUT, $total.' errors found'. PHP_EOL);
42
+			$count = 0;
43
+			foreach ($elements as $i => $element) {
44
+				$count++;
45
+				if ($errors = $element->attribute('innerHTML')) {
46
+					fwrite(STDOUT, "========================================================================". PHP_EOL);
47
+					fwrite(STDOUT, strip_tags($errors). PHP_EOL);
48
+					if ($count == $total) {
49
+						fwrite(STDOUT, "========================================================================". PHP_EOL);
50
+					}
51
+				}
52
+			}
53
+		}
54
+	}
55
+
56
+	function checkForJsErrors() {
57
+		if ($this->isElementExists('sel_js_error')) {
58
+			fwrite(STDOUT, 'Javascript errors found'. PHP_EOL);
59
+			fwrite(STDOUT, "========================================================================". PHP_EOL);
60
+			echo $this->byId('sel_js_error')->attribute('innerHTML');
61
+			fwrite(STDOUT, "========================================================================". PHP_EOL);
62
+		}
63
+	}
64
+
65
+	function maybeUserLogin($redirect, $force=false) {
66
+		if ($force) {
67
+			$this->url(self::GDTEST_BASE_URL.'wp-admin/');
68
+			if ($this->isTextPresent("forgetmenot")) {
69
+				$this->byId('user_login')->value('[email protected]');
70
+				$this->byId('user_pass')->value('1');
71 71
 //                $this->byId('rememberme')->click();
72
-                // Submit the form
73
-                $this->byId('wp-submit')->submit();
74
-                $this->waitForPageLoadAndCheckForErrors();
75
-            }
76
-        }
77
-        $this->url($redirect);
78
-        $this->waitForPageLoadAndCheckForErrors();
79
-        if ($this->isTextPresent("Sign In")) {
80
-            $this->byId('user_login')->value('[email protected]');
81
-            $this->byId('user_pass')->value('1');
72
+				// Submit the form
73
+				$this->byId('wp-submit')->submit();
74
+				$this->waitForPageLoadAndCheckForErrors();
75
+			}
76
+		}
77
+		$this->url($redirect);
78
+		$this->waitForPageLoadAndCheckForErrors();
79
+		if ($this->isTextPresent("Sign In")) {
80
+			$this->byId('user_login')->value('[email protected]');
81
+			$this->byId('user_pass')->value('1');
82 82
 //            $this->byId('rememberme')->click();
83
-            // Submit the form
84
-            $this->byId('cus_loginform')->submit();
85
-            $this->waitForPageLoadAndCheckForErrors();
86
-            $this->url($redirect);
87
-        }
88
-    }
89
-
90
-    function maybeAdminLogin($redirect) {
91
-        $this->url($redirect);
92
-        $this->waitForPageLoadAndCheckForErrors();
93
-        if ($this->isTextPresent("forgetmenot")) {
94
-            $this->byId('user_login')->value('admin');
95
-            $this->byId('user_pass')->value('admin');
83
+			// Submit the form
84
+			$this->byId('cus_loginform')->submit();
85
+			$this->waitForPageLoadAndCheckForErrors();
86
+			$this->url($redirect);
87
+		}
88
+	}
89
+
90
+	function maybeAdminLogin($redirect) {
91
+		$this->url($redirect);
92
+		$this->waitForPageLoadAndCheckForErrors();
93
+		if ($this->isTextPresent("forgetmenot")) {
94
+			$this->byId('user_login')->value('admin');
95
+			$this->byId('user_pass')->value('admin');
96 96
 //            $this->byId('rememberme')->click();
97
-            // Submit the form
98
-            $this->byId('wp-submit')->submit();
99
-            $this->waitForPageLoadAndCheckForErrors();
100
-            $this->url($redirect);
101
-        }
102
-    }
103
-
104
-    function isElementExists($id = false, $by = 'id') {
105
-        if (!$id) {
106
-            return false;
107
-        }
108
-        $exists = true;
109
-        try {
110
-            if ($by == 'id') {
111
-                $this->byId($id);
112
-            } elseif ($by == 'xpath') {
113
-                $this->byXPath($id);
114
-            }
115
-
116
-        } catch (PHPUnit_Extensions_Selenium2TestCase_WebDriverException $e) {
117
-            if (PHPUnit_Extensions_Selenium2TestCase_WebDriverException::NoSuchElement == $e->getCode()) {
118
-                $exists = false;
119
-            }
120
-        }
121
-        return $exists;
122
-    }
123
-
124
-    function ExecuteScript($script, $args=array()) {
125
-        $this->execute( array(
126
-            'script' => $script ,
127
-            'args'=>$args
128
-        ) );
129
-    }
130
-
131
-    function hideAdminBar() {
132
-        //admin bar causes problem with scroll. So hide admin bar while testing.
133
-        $this->ExecuteScript('jQuery("#wpadminbar").hide();');
134
-    }
135
-
136
-    function logInfo($string) {
137
-        fwrite(STDOUT, "Info: ".$string . PHP_EOL);
138
-    }
139
-
140
-    function logError($string) {
141
-        fwrite(STDOUT, "Error: ".$string . PHP_EOL);
142
-    }
143
-
144
-    function logWarning($string) {
145
-        fwrite(STDOUT, "Warning: ".$string . PHP_EOL);
146
-    }
147
-
148
-    function getCurrentFileNumber($file) {
149
-        preg_match('/test-([0-9]+)_/', $file, $match);
150
-        return (int) $match[1];
151
-    }
152
-
153
-    function getCompletedFileNumber() {
154
-        $completed = fopen("tests/selenium/completed.txt", "r") or die("Unable to open file!");
155
-        $content = fgets($completed);
156
-        fclose($completed);
157
-        return (int) $content;
158
-    }
159
-
160
-    function skipTest($current, $completed) {
161
-        if ($completed == 0 || $completed == 42 || $current == $completed) {
162
-            return false;
163
-        } elseif ($current < $completed) {
164
-            return true;
165
-        } else {
166
-            return false;
167
-        }
168
-    }
169
-
170
-    function maybeLogout() {
171
-        $this->url(self::GDTEST_BASE_URL);
172
-        $this->byXPath("//*[@id='gd-sidebar-wrapper']//ul[@class='geodir-loginbox-list']//a[@class='signin']")->click();
173
-        $this->waitForPageLoadAndCheckForErrors();
174
-    }
175
-
176
-    function maybeAdminLogout() {
177
-        $this->url(self::GDTEST_BASE_URL.'wp-admin/plugins.php');
178
-        $this->ExecuteScript('jQuery("#wp-admin-bar-my-account").addClass("hover");');
179
-        $this->byXPath("//*[@id='wp-admin-bar-logout']//a")->click();
180
-        $this->waitForPageLoadAndCheckForErrors();
181
-    }
182
-
183
-    function maybeActivatePlugin($id=false, $timeout=10000) {
184
-        if (!$id) {
185
-            return;
186
-        }
187
-        $plugin_name = ucwords(str_replace('-', ' ', $id));
188
-        $this->logInfo('Activating '.$plugin_name.' plugin......');
189
-        $this->url(self::GDTEST_BASE_URL.'wp-admin/plugins.php');
190
-        $this->waitForPageLoadAndCheckForErrors();
191
-        $this->hideAdminBar();
192
-        if (is_int(strpos($this->byId($id)->attribute('class'), 'inactive'))) {
193
-            $this->byXPath("//tr[@id='".$id."']//span[@class='activate']/a")->click();
194
-        }
195
-        $this->waitForPageLoadAndCheckForErrors($timeout);
196
-        $this->logInfo($plugin_name.' activated......');
197
-    }
97
+			// Submit the form
98
+			$this->byId('wp-submit')->submit();
99
+			$this->waitForPageLoadAndCheckForErrors();
100
+			$this->url($redirect);
101
+		}
102
+	}
103
+
104
+	function isElementExists($id = false, $by = 'id') {
105
+		if (!$id) {
106
+			return false;
107
+		}
108
+		$exists = true;
109
+		try {
110
+			if ($by == 'id') {
111
+				$this->byId($id);
112
+			} elseif ($by == 'xpath') {
113
+				$this->byXPath($id);
114
+			}
115
+
116
+		} catch (PHPUnit_Extensions_Selenium2TestCase_WebDriverException $e) {
117
+			if (PHPUnit_Extensions_Selenium2TestCase_WebDriverException::NoSuchElement == $e->getCode()) {
118
+				$exists = false;
119
+			}
120
+		}
121
+		return $exists;
122
+	}
123
+
124
+	function ExecuteScript($script, $args=array()) {
125
+		$this->execute( array(
126
+			'script' => $script ,
127
+			'args'=>$args
128
+		) );
129
+	}
130
+
131
+	function hideAdminBar() {
132
+		//admin bar causes problem with scroll. So hide admin bar while testing.
133
+		$this->ExecuteScript('jQuery("#wpadminbar").hide();');
134
+	}
135
+
136
+	function logInfo($string) {
137
+		fwrite(STDOUT, "Info: ".$string . PHP_EOL);
138
+	}
139
+
140
+	function logError($string) {
141
+		fwrite(STDOUT, "Error: ".$string . PHP_EOL);
142
+	}
143
+
144
+	function logWarning($string) {
145
+		fwrite(STDOUT, "Warning: ".$string . PHP_EOL);
146
+	}
147
+
148
+	function getCurrentFileNumber($file) {
149
+		preg_match('/test-([0-9]+)_/', $file, $match);
150
+		return (int) $match[1];
151
+	}
152
+
153
+	function getCompletedFileNumber() {
154
+		$completed = fopen("tests/selenium/completed.txt", "r") or die("Unable to open file!");
155
+		$content = fgets($completed);
156
+		fclose($completed);
157
+		return (int) $content;
158
+	}
159
+
160
+	function skipTest($current, $completed) {
161
+		if ($completed == 0 || $completed == 42 || $current == $completed) {
162
+			return false;
163
+		} elseif ($current < $completed) {
164
+			return true;
165
+		} else {
166
+			return false;
167
+		}
168
+	}
169
+
170
+	function maybeLogout() {
171
+		$this->url(self::GDTEST_BASE_URL);
172
+		$this->byXPath("//*[@id='gd-sidebar-wrapper']//ul[@class='geodir-loginbox-list']//a[@class='signin']")->click();
173
+		$this->waitForPageLoadAndCheckForErrors();
174
+	}
175
+
176
+	function maybeAdminLogout() {
177
+		$this->url(self::GDTEST_BASE_URL.'wp-admin/plugins.php');
178
+		$this->ExecuteScript('jQuery("#wp-admin-bar-my-account").addClass("hover");');
179
+		$this->byXPath("//*[@id='wp-admin-bar-logout']//a")->click();
180
+		$this->waitForPageLoadAndCheckForErrors();
181
+	}
182
+
183
+	function maybeActivatePlugin($id=false, $timeout=10000) {
184
+		if (!$id) {
185
+			return;
186
+		}
187
+		$plugin_name = ucwords(str_replace('-', ' ', $id));
188
+		$this->logInfo('Activating '.$plugin_name.' plugin......');
189
+		$this->url(self::GDTEST_BASE_URL.'wp-admin/plugins.php');
190
+		$this->waitForPageLoadAndCheckForErrors();
191
+		$this->hideAdminBar();
192
+		if (is_int(strpos($this->byId($id)->attribute('class'), 'inactive'))) {
193
+			$this->byXPath("//tr[@id='".$id."']//span[@class='activate']/a")->click();
194
+		}
195
+		$this->waitForPageLoadAndCheckForErrors($timeout);
196
+		$this->logInfo($plugin_name.' activated......');
197
+	}
198 198
 
199 199
 }
200 200
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
     function isTextPresent($search)
14 14
     {
15 15
         $source = $this->source();
16
-        if ( strpos((string)$source,$search) !== FALSE) {
16
+        if (strpos((string) $source, $search) !== FALSE) {
17 17
             return true;
18 18
         } else {
19 19
             return false;
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
         return md5(uniqid(rand(), true)).'@gmail.com';
26 26
     }
27 27
 
28
-    function waitForPageLoadAndCheckForErrors($timeout=10000)
28
+    function waitForPageLoadAndCheckForErrors($timeout = 10000)
29 29
     {
30 30
         // Wait 10 seconds
31 31
         $this->timeouts()->implicitWait($timeout);
@@ -38,15 +38,15 @@  discard block
 block discarded – undo
38 38
         $elements = $this->elements($this->using('css selector')->value('.xdebug-error'));
39 39
         if ($elements) {
40 40
             $total = count($elements);
41
-            fwrite(STDOUT, $total.' errors found'. PHP_EOL);
41
+            fwrite(STDOUT, $total.' errors found'.PHP_EOL);
42 42
             $count = 0;
43 43
             foreach ($elements as $i => $element) {
44 44
                 $count++;
45 45
                 if ($errors = $element->attribute('innerHTML')) {
46
-                    fwrite(STDOUT, "========================================================================". PHP_EOL);
47
-                    fwrite(STDOUT, strip_tags($errors). PHP_EOL);
46
+                    fwrite(STDOUT, "========================================================================".PHP_EOL);
47
+                    fwrite(STDOUT, strip_tags($errors).PHP_EOL);
48 48
                     if ($count == $total) {
49
-                        fwrite(STDOUT, "========================================================================". PHP_EOL);
49
+                        fwrite(STDOUT, "========================================================================".PHP_EOL);
50 50
                     }
51 51
                 }
52 52
             }
@@ -55,14 +55,14 @@  discard block
 block discarded – undo
55 55
 
56 56
     function checkForJsErrors() {
57 57
         if ($this->isElementExists('sel_js_error')) {
58
-            fwrite(STDOUT, 'Javascript errors found'. PHP_EOL);
59
-            fwrite(STDOUT, "========================================================================". PHP_EOL);
58
+            fwrite(STDOUT, 'Javascript errors found'.PHP_EOL);
59
+            fwrite(STDOUT, "========================================================================".PHP_EOL);
60 60
             echo $this->byId('sel_js_error')->attribute('innerHTML');
61
-            fwrite(STDOUT, "========================================================================". PHP_EOL);
61
+            fwrite(STDOUT, "========================================================================".PHP_EOL);
62 62
         }
63 63
     }
64 64
 
65
-    function maybeUserLogin($redirect, $force=false) {
65
+    function maybeUserLogin($redirect, $force = false) {
66 66
         if ($force) {
67 67
             $this->url(self::GDTEST_BASE_URL.'wp-admin/');
68 68
             if ($this->isTextPresent("forgetmenot")) {
@@ -121,11 +121,11 @@  discard block
 block discarded – undo
121 121
         return $exists;
122 122
     }
123 123
 
124
-    function ExecuteScript($script, $args=array()) {
125
-        $this->execute( array(
126
-            'script' => $script ,
124
+    function ExecuteScript($script, $args = array()) {
125
+        $this->execute(array(
126
+            'script' => $script,
127 127
             'args'=>$args
128
-        ) );
128
+        ));
129 129
     }
130 130
 
131 131
     function hideAdminBar() {
@@ -134,15 +134,15 @@  discard block
 block discarded – undo
134 134
     }
135 135
 
136 136
     function logInfo($string) {
137
-        fwrite(STDOUT, "Info: ".$string . PHP_EOL);
137
+        fwrite(STDOUT, "Info: ".$string.PHP_EOL);
138 138
     }
139 139
 
140 140
     function logError($string) {
141
-        fwrite(STDOUT, "Error: ".$string . PHP_EOL);
141
+        fwrite(STDOUT, "Error: ".$string.PHP_EOL);
142 142
     }
143 143
 
144 144
     function logWarning($string) {
145
-        fwrite(STDOUT, "Warning: ".$string . PHP_EOL);
145
+        fwrite(STDOUT, "Warning: ".$string.PHP_EOL);
146 146
     }
147 147
 
148 148
     function getCurrentFileNumber($file) {
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
         $this->waitForPageLoadAndCheckForErrors();
181 181
     }
182 182
 
183
-    function maybeActivatePlugin($id=false, $timeout=10000) {
183
+    function maybeActivatePlugin($id = false, $timeout = 10000) {
184 184
         if (!$id) {
185 185
             return;
186 186
         }
Please login to merge, or discard this patch.
geodirectory_hooks_actions.php 4 patches
Braces   +92 added lines, -74 removed lines patch added patch discarded remove patch
@@ -86,8 +86,9 @@  discard block
 block discarded – undo
86 86
 add_filter('query_vars', 'geodir_add_location_var');
87 87
 add_filter('query_vars', 'geodir_add_geodir_page_var');
88 88
 add_action('wp', 'geodir_add_page_id_in_query_var'); // problem fix in wordpress 3.8
89
-if (get_option('permalink_structure') != '')
90
-    add_filter('parse_request', 'geodir_set_location_var_in_session_in_core');
89
+if (get_option('permalink_structure') != '') {
90
+    add_filter('parse_request', 'geodir_set_location_var_in_session_in_core');
91
+}
91 92
 
92 93
 add_filter('parse_query', 'geodir_modified_query');
93 94
 
@@ -420,8 +421,9 @@  discard block
 block discarded – undo
420 421
      */
421 422
     do_action('geodir_after_social_sharing_buttons');
422 423
     $content_html = ob_get_clean();
423
-    if (trim($content_html) != '')
424
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-social-sharing">' . $content_html . '</div>';
424
+    if (trim($content_html) != '') {
425
+            $content_html = '<div class="geodir-company_info geodir-details-sidebar-social-sharing">' . $content_html . '</div>';
426
+    }
425 427
     if ((int)get_option('geodir_disable_tfg_buttons_section') != 1) {
426 428
         /**
427 429
          * Filter the geodir_social_sharing_buttons() function content.
@@ -467,8 +469,9 @@  discard block
 block discarded – undo
467 469
      */
468 470
     do_action('geodir_after_share_this_button');
469 471
     $content_html = ob_get_clean();
470
-    if (trim($content_html) != '')
471
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-sharethis">' . $content_html . '</div>';
472
+    if (trim($content_html) != '') {
473
+            $content_html = '<div class="geodir-company_info geodir-details-sidebar-sharethis">' . $content_html . '</div>';
474
+    }
472 475
     if ((int)get_option('geodir_disable_sharethis_button_section') != 1) {
473 476
         /**
474 477
          * Filter the geodir_share_this_button() function content.
@@ -523,8 +526,9 @@  discard block
 block discarded – undo
523 526
      */
524 527
     do_action('geodir_after_edit_post_link');
525 528
     $content_html = ob_get_clean();
526
-    if (trim($content_html) != '')
527
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-user-links">' . $content_html . '</div>';
529
+    if (trim($content_html) != '') {
530
+            $content_html = '<div class="geodir-company_info geodir-details-sidebar-user-links">' . $content_html . '</div>';
531
+    }
528 532
     if ((int)get_option('geodir_disable_user_links_section') != 1) {
529 533
         /**
530 534
          * Filter the geodir_edit_post_link() function content.
@@ -1097,8 +1101,9 @@  discard block
 block discarded – undo
1097 1101
      */
1098 1102
     do_action('geodir_after_google_analytics');
1099 1103
     $content_html = ob_get_clean();
1100
-    if (trim($content_html) != '')
1101
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-google-analytics">' . $content_html . '</div>';
1104
+    if (trim($content_html) != '') {
1105
+            $content_html = '<div class="geodir-company_info geodir-details-sidebar-google-analytics">' . $content_html . '</div>';
1106
+    }
1102 1107
     if ((int)get_option('geodir_disable_google_analytics_section') != 1) {
1103 1108
         /**
1104 1109
          * Filter the geodir_edit_post_link() function content.
@@ -1233,8 +1238,9 @@  discard block
 block discarded – undo
1233 1238
     do_action('geodir_after_detail_page_more_info');
1234 1239
 
1235 1240
     $content_html = ob_get_clean();
1236
-    if (trim($content_html) != '')
1237
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-listing-info">' . $content_html . '</div>';
1241
+    if (trim($content_html) != '') {
1242
+            $content_html = '<div class="geodir-company_info geodir-details-sidebar-listing-info">' . $content_html . '</div>';
1243
+    }
1238 1244
     if ((int)get_option('geodir_disable_listing_info_section') != 1) {
1239 1245
         /**
1240 1246
          * Filter the output html for function geodir_detail_page_more_info().
@@ -1341,8 +1347,9 @@  discard block
 block discarded – undo
1341 1347
     $arr_alert_msg = apply_filters('geodir_all_js_msg', $arr_alert_msg);
1342 1348
 
1343 1349
     foreach ($arr_alert_msg as $key => $value) {
1344
-        if (!is_scalar($value))
1345
-            continue;
1350
+        if (!is_scalar($value)) {
1351
+                    continue;
1352
+        }
1346 1353
         $arr_alert_msg[$key] = html_entity_decode((string)$value, ENT_QUOTES, 'UTF-8');
1347 1354
     }
1348 1355
 
@@ -1396,17 +1403,19 @@  discard block
 block discarded – undo
1396 1403
     global $geodir_sidebars;
1397 1404
     global $sidebars_widgets;
1398 1405
 
1399
-    if (!is_array($sidebars_widgets))
1400
-        $sidebars_widgets = wp_get_sidebars_widgets();
1406
+    if (!is_array($sidebars_widgets)) {
1407
+            $sidebars_widgets = wp_get_sidebars_widgets();
1408
+    }
1401 1409
     $geodir_old_sidebars = array();
1402 1410
 
1403 1411
     if (is_array($geodir_sidebars)) {
1404 1412
         foreach ($geodir_sidebars as $val) {
1405 1413
             if (is_array($sidebars_widgets)) {
1406
-                if (array_key_exists($val, $sidebars_widgets))
1407
-                    $geodir_old_sidebars[$val] = $sidebars_widgets[$val];
1408
-                else
1409
-                    $geodir_old_sidebars[$val] = array();
1414
+                if (array_key_exists($val, $sidebars_widgets)) {
1415
+                                    $geodir_old_sidebars[$val] = $sidebars_widgets[$val];
1416
+                } else {
1417
+                                    $geodir_old_sidebars[$val] = array();
1418
+                }
1410 1419
             }
1411 1420
         }
1412 1421
     }
@@ -1427,8 +1436,9 @@  discard block
 block discarded – undo
1427 1436
 {
1428 1437
     global $sidebars_widgets;
1429 1438
 
1430
-    if (!is_array($sidebars_widgets))
1431
-        $sidebars_widgets = wp_get_sidebars_widgets();
1439
+    if (!is_array($sidebars_widgets)) {
1440
+            $sidebars_widgets = wp_get_sidebars_widgets();
1441
+    }
1432 1442
 
1433 1443
     if (is_array($sidebars_widgets)) {
1434 1444
         $geodir_old_sidebars = get_option('geodir_sidebars');
@@ -1578,20 +1588,25 @@  discard block
 block discarded – undo
1578 1588
         }
1579 1589
     }
1580 1590
     
1581
-    if ($tab == 'post_info')
1582
-        $is_display = (!empty($geodir_post_detail_fields)) ? true : false;
1591
+    if ($tab == 'post_info') {
1592
+            $is_display = (!empty($geodir_post_detail_fields)) ? true : false;
1593
+    }
1583 1594
 
1584
-    if ($tab == 'post_images')
1585
-        $is_display = (!empty($post_images)) ? true : false;
1595
+    if ($tab == 'post_images') {
1596
+            $is_display = (!empty($post_images)) ? true : false;
1597
+    }
1586 1598
 
1587
-    if ($tab == 'post_video')
1588
-        $is_display = (!empty($video)) ? true : false;
1599
+    if ($tab == 'post_video') {
1600
+            $is_display = (!empty($video)) ? true : false;
1601
+    }
1589 1602
 
1590
-    if ($tab == 'special_offers')
1591
-        $is_display = (!empty($special_offers)) ? true : false;
1603
+    if ($tab == 'special_offers') {
1604
+            $is_display = (!empty($special_offers)) ? true : false;
1605
+    }
1592 1606
 
1593
-    if ($tab == 'reviews')
1594
-        $is_display = (geodir_is_page('detail')) ? true : false;
1607
+    if ($tab == 'reviews') {
1608
+            $is_display = (geodir_is_page('detail')) ? true : false;
1609
+    }
1595 1610
 
1596 1611
     if ($tab == 'related_listing') {
1597 1612
        $message = __('No listings found which match your selection.', 'geodirectory');
@@ -1825,11 +1840,13 @@  discard block
 block discarded – undo
1825 1840
     $region_slug = $default_location->region_slug;
1826 1841
     $city_slug = $default_location->city_slug;
1827 1842
 
1828
-    if ($country_slug == $slug || $region_slug == $slug || $city_slug == $slug)
1829
-        return $slug_exists = true;
1843
+    if ($country_slug == $slug || $region_slug == $slug || $city_slug == $slug) {
1844
+            return $slug_exists = true;
1845
+    }
1830 1846
 
1831
-    if ($wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s AND term_id != %d", array($slug, $term_id))))
1832
-        return $slug_exists = true;
1847
+    if ($wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s AND term_id != %d", array($slug, $term_id)))) {
1848
+            return $slug_exists = true;
1849
+    }
1833 1850
 
1834 1851
     return $slug_exists;
1835 1852
 }
@@ -1871,40 +1888,31 @@  discard block
 block discarded – undo
1871 1888
     if(geodir_is_page('home')){
1872 1889
         $gd_page = 'home';
1873 1890
         $title = (get_option('geodir_meta_title_homepage')) ? get_option('geodir_meta_title_homepage') : $title;
1874
-    }
1875
-    elseif(geodir_is_page('detail')){
1891
+    } elseif(geodir_is_page('detail')){
1876 1892
         $gd_page = 'detail';
1877 1893
         $title = (get_option('geodir_meta_title_detail')) ? get_option('geodir_meta_title_detail') : $title;
1878
-    }
1879
-    elseif(geodir_is_page('pt')){
1894
+    } elseif(geodir_is_page('pt')){
1880 1895
         $gd_page = 'pt';
1881 1896
         $title = (get_option('geodir_meta_title_pt')) ? get_option('geodir_meta_title_pt') : $title;
1882
-    }
1883
-    elseif(geodir_is_page('listing')){
1897
+    } elseif(geodir_is_page('listing')){
1884 1898
         $gd_page = 'listing';
1885 1899
         $title = (get_option('geodir_meta_title_listing')) ? get_option('geodir_meta_title_listing') : $title;
1886
-    }
1887
-    elseif(geodir_is_page('location')){
1900
+    } elseif(geodir_is_page('location')){
1888 1901
         $gd_page = 'location';
1889 1902
         $title = (get_option('geodir_meta_title_location')) ? get_option('geodir_meta_title_location') : $title;
1890
-    }
1891
-    elseif(geodir_is_page('search')){
1903
+    } elseif(geodir_is_page('search')){
1892 1904
         $gd_page = 'search';
1893 1905
         $title = (get_option('geodir_meta_title_search')) ? get_option('geodir_meta_title_search') : $title;
1894
-    }
1895
-    elseif(geodir_is_page('add-listing')){
1906
+    } elseif(geodir_is_page('add-listing')){
1896 1907
         $gd_page = 'add-listing';
1897 1908
         $title = (get_option('geodir_meta_title_add-listing')) ? get_option('geodir_meta_title_add-listing') : $title;
1898
-    }
1899
-    elseif(geodir_is_page('author')){
1909
+    } elseif(geodir_is_page('author')){
1900 1910
         $gd_page = 'author';
1901 1911
         $title = (get_option('geodir_meta_title_author')) ? get_option('geodir_meta_title_author') : $title;
1902
-    }
1903
-    elseif(geodir_is_page('login')){
1912
+    } elseif(geodir_is_page('login')){
1904 1913
         $gd_page = 'login';
1905 1914
         $title = (get_option('geodir_meta_title_login')) ? get_option('geodir_meta_title_login') : $title;
1906
-    }
1907
-    elseif(geodir_is_page('listing-success')){
1915
+    } elseif(geodir_is_page('listing-success')){
1908 1916
         $gd_page = 'listing-success';
1909 1917
         $title = (get_option('geodir_meta_title_listing-success')) ? get_option('geodir_meta_title_listing-success') : $title;
1910 1918
     }
@@ -1979,11 +1987,13 @@  discard block
 block discarded – undo
1979 1987
 
1980 1988
     if (!get_option('geodir_remove_url_seperator')) {
1981 1989
 
1982
-        if (get_option('geodir_listingurl_separator'))
1983
-            delete_option('geodir_listingurl_separator');
1990
+        if (get_option('geodir_listingurl_separator')) {
1991
+                    delete_option('geodir_listingurl_separator');
1992
+        }
1984 1993
 
1985
-        if (get_option('geodir_detailurl_separator'))
1986
-            delete_option('geodir_detailurl_separator');
1994
+        if (get_option('geodir_detailurl_separator')) {
1995
+                    delete_option('geodir_detailurl_separator');
1996
+        }
1987 1997
 
1988 1998
         flush_rewrite_rules(false);
1989 1999
 
@@ -2007,8 +2017,9 @@  discard block
 block discarded – undo
2007 2017
 {
2008 2018
     foreach ($permalink_arr as $key => $value) {
2009 2019
 
2010
-        if ($value['id'] == 'geodir_listingurl_separator' || $value['id'] == 'geodir_detailurl_separator')
2011
-            unset($permalink_arr[$key]);
2020
+        if ($value['id'] == 'geodir_listingurl_separator' || $value['id'] == 'geodir_detailurl_separator') {
2021
+                    unset($permalink_arr[$key]);
2022
+        }
2012 2023
 
2013 2024
     }
2014 2025
 
@@ -2140,16 +2151,18 @@  discard block
 block discarded – undo
2140 2151
 
2141 2152
             $field_title = $wpdb->get_var($wpdb->prepare("select site_title from " . GEODIR_CUSTOM_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s ", array('geodir_video', $post_type)));
2142 2153
 
2143
-            if (isset($tabs_arr['post_video']['heading_text']) && $field_title != '')
2144
-                $tabs_arr['post_video']['heading_text'] = $field_title;
2154
+            if (isset($tabs_arr['post_video']['heading_text']) && $field_title != '') {
2155
+                            $tabs_arr['post_video']['heading_text'] = $field_title;
2156
+            }
2145 2157
         }
2146 2158
 
2147 2159
         if (array_key_exists('special_offers', $tabs_arr)) {
2148 2160
 
2149 2161
             $field_title = $wpdb->get_var($wpdb->prepare("select site_title from " . GEODIR_CUSTOM_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s ", array('geodir_special_offers', $post_type)));
2150 2162
 
2151
-            if (isset($tabs_arr['special_offers']['heading_text']) && $field_title != '')
2152
-                $tabs_arr['special_offers']['heading_text'] = $field_title;
2163
+            if (isset($tabs_arr['special_offers']['heading_text']) && $field_title != '') {
2164
+                            $tabs_arr['special_offers']['heading_text'] = $field_title;
2165
+            }
2153 2166
         }
2154 2167
 
2155 2168
     }
@@ -2204,8 +2217,9 @@  discard block
 block discarded – undo
2204 2217
 
2205 2218
         $all_postypes = geodir_get_posttypes();
2206 2219
 
2207
-        if (!in_array($post_type, $all_postypes) || !is_admin())
2208
-            return false;
2220
+        if (!in_array($post_type, $all_postypes) || !is_admin()) {
2221
+                    return false;
2222
+        }
2209 2223
 
2210 2224
         $uploads = wp_upload_dir();
2211 2225
 
@@ -2279,8 +2293,9 @@  discard block
 block discarded – undo
2279 2293
                         $file_info = pathinfo($attach->file);
2280 2294
 
2281 2295
                         $sub_dir = '';
2282
-                        if ($file_info['dirname'] != '.' && $file_info['dirname'] != '..')
2283
-                            $sub_dir = stripslashes_deep($file_info['dirname']);
2296
+                        if ($file_info['dirname'] != '.' && $file_info['dirname'] != '..') {
2297
+                                                    $sub_dir = stripslashes_deep($file_info['dirname']);
2298
+                        }
2284 2299
 
2285 2300
                         $uploads = wp_upload_dir(trim($sub_dir, '/')); // Array of key => value pairs
2286 2301
                         $uploads_path = $uploads['basedir'];
@@ -2301,8 +2316,9 @@  discard block
 block discarded – undo
2301 2316
 
2302 2317
                     if (!empty($attachment_data)) {
2303 2318
 
2304
-                        if ($attachment_data->ID)
2305
-                            $wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
2319
+                        if ($attachment_data->ID) {
2320
+                                                    $wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
2321
+                        }
2306 2322
 
2307 2323
                     } else {
2308 2324
 
@@ -2553,8 +2569,9 @@  discard block
 block discarded – undo
2553 2569
                             break;
2554 2570
                         case 'time': {
2555 2571
                             $value = '';
2556
-                            if ($post->{$type['htmlvar_name']} != '')
2557
-                                $value = date_i18n(get_option('time_format'), strtotime($post->{$type['htmlvar_name']}));
2572
+                            if ($post->{$type['htmlvar_name']} != '') {
2573
+                                                            $value = date_i18n(get_option('time_format'), strtotime($post->{$type['htmlvar_name']}));
2574
+                            }
2558 2575
 
2559 2576
                             if (strpos($field_icon, 'http') !== false) {
2560 2577
                                 $field_icon_af = '';
@@ -2589,8 +2606,9 @@  discard block
 block discarded – undo
2589 2606
                             $post_htmlvar_value = $date_format == 'd/m/Y' ? str_replace('/', '-', $post->{$type['htmlvar_name']}) : $post->{$type['htmlvar_name']}; // PHP doesn't work well with dd/mm/yyyy format
2590 2607
 
2591 2608
                             $value = '';
2592
-                            if ($post->{$type['htmlvar_name']} != '')
2593
-                                $value = date($date_format, strtotime($post_htmlvar_value));
2609
+                            if ($post->{$type['htmlvar_name']} != '') {
2610
+                                                            $value = date($date_format, strtotime($post_htmlvar_value));
2611
+                            }
2594 2612
 
2595 2613
                             if (strpos($field_icon, 'http') !== false) {
2596 2614
                                 $field_icon_af = '';
Please login to merge, or discard this patch.
Doc Comments   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2195,7 +2195,7 @@  discard block
 block discarded – undo
2195 2195
  * @global object $wpdb WordPress Database object.
2196 2196
  * @global string $plugin_prefix Geodirectory plugin table prefix.
2197 2197
  * @param int $attachment_id Attachment ID.
2198
- * @return bool|void Returns false on failure.
2198
+ * @return false|null Returns false on failure.
2199 2199
  */
2200 2200
 function geodirectory_before_featured_image_delete($attachment_id)
2201 2201
 {
@@ -2368,6 +2368,7 @@  discard block
 block discarded – undo
2368 2368
  * @global object $wpdb WordPress Database object.
2369 2369
  * @global object $current_user Current user object.
2370 2370
  * @global string $plugin_prefix Geodirectory plugin table prefix.
2371
+ * @param string $user_id
2371 2372
  * @return array User listing count for each post type.
2372 2373
  */
2373 2374
 function geodir_user_post_listing_count($user_id=null)
@@ -3176,7 +3177,7 @@  discard block
 block discarded – undo
3176 3177
  * @since 1.0.0
3177 3178
  * @package GeoDirectory
3178 3179
  * @param array $classes The class array of the HTML element.
3179
- * @return array Modified class array.
3180
+ * @return string[] Modified class array.
3180 3181
  */
3181 3182
 function geodir_body_class_no_rating($classes = array())
3182 3183
 {
Please login to merge, or discard this patch.
Indentation   +1480 added lines, -1480 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
  */
20 20
 function geodir_get_ajax_url()
21 21
 {
22
-    return admin_url('admin-ajax.php?action=geodir_ajax_action');
22
+	return admin_url('admin-ajax.php?action=geodir_ajax_action');
23 23
 }
24 24
 
25 25
 /////////////////////
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 add_filter('query_vars', 'geodir_add_geodir_page_var');
88 88
 add_action('wp', 'geodir_add_page_id_in_query_var'); // problem fix in wordpress 3.8
89 89
 if (get_option('permalink_structure') != '')
90
-    add_filter('parse_request', 'geodir_set_location_var_in_session_in_core');
90
+	add_filter('parse_request', 'geodir_set_location_var_in_session_in_core');
91 91
 
92 92
 add_filter('parse_query', 'geodir_modified_query');
93 93
 
@@ -154,14 +154,14 @@  discard block
 block discarded – undo
154 154
 /* POST AND LOOP ACTIONS */
155 155
 ////////////////////////
156 156
 if (!is_admin()) {
157
-    add_action('pre_get_posts', 'geodir_exclude_page', 100); /// Will help to exclude virtural page from everywhere
158
-    add_filter('wp_list_pages_excludes', 'exclude_from_wp_list_pages', 100);
159
-    /** Exclude Virtual Pages From Pages List **/
160
-    add_action('pre_get_posts', 'set_listing_request', 0);
161
-    add_action('pre_get_posts', 'geodir_listing_loop_filter', 1);
162
-    add_filter('excerpt_more', 'geodir_excerpt_more', 1000);
163
-    add_filter('excerpt_length', 'geodir_excerpt_length', 1000);
164
-    add_action('the_post', 'create_marker_jason_of_posts'); // Add marker in json array, Map related filter
157
+	add_action('pre_get_posts', 'geodir_exclude_page', 100); /// Will help to exclude virtural page from everywhere
158
+	add_filter('wp_list_pages_excludes', 'exclude_from_wp_list_pages', 100);
159
+	/** Exclude Virtual Pages From Pages List **/
160
+	add_action('pre_get_posts', 'set_listing_request', 0);
161
+	add_action('pre_get_posts', 'geodir_listing_loop_filter', 1);
162
+	add_filter('excerpt_more', 'geodir_excerpt_more', 1000);
163
+	add_filter('excerpt_length', 'geodir_excerpt_length', 1000);
164
+	add_action('the_post', 'create_marker_jason_of_posts'); // Add marker in json array, Map related filter
165 165
 }
166 166
 
167 167
 
@@ -221,12 +221,12 @@  discard block
 block discarded – undo
221 221
  */
222 222
 function geodir_unset_prev_theme_nav_location($newname)
223 223
 {
224
-    $geodir_theme_location = get_option('geodir_theme_location_nav_' . $newname);
225
-    if ($geodir_theme_location) {
226
-        update_option('geodir_theme_location_nav', $geodir_theme_location);
227
-    } else {
228
-        update_option('geodir_theme_location_nav', '');
229
-    }
224
+	$geodir_theme_location = get_option('geodir_theme_location_nav_' . $newname);
225
+	if ($geodir_theme_location) {
226
+		update_option('geodir_theme_location_nav', $geodir_theme_location);
227
+	} else {
228
+		update_option('geodir_theme_location_nav', '');
229
+	}
230 230
 }
231 231
 
232 232
 /// add action for theme switch to blank previous theme navigation location setting
@@ -247,32 +247,32 @@  discard block
 block discarded – undo
247 247
  */
248 248
 function geodir_add_post_filters()
249 249
 {
250
-    /**
251
-     * Contains all function for filtering listing.
252
-     *
253
-     * @since 1.0.0
254
-     * @package GeoDirectory
255
-     */
256
-    include_once('geodirectory-functions/listing_filters.php');
250
+	/**
251
+	 * Contains all function for filtering listing.
252
+	 *
253
+	 * @since 1.0.0
254
+	 * @package GeoDirectory
255
+	 */
256
+	include_once('geodirectory-functions/listing_filters.php');
257 257
 }
258 258
 
259 259
 
260 260
 if (!function_exists('geodir_init_defaults')) {
261
-    /**
262
-     * Calls the function to register the GeoDirectory default CPT and taxonomies.
263
-     *
264
-     * @since 1.0.0
265
-     * @package GeoDirectory
266
-     */
267
-    function geodir_init_defaults()
268
-    {
269
-        if (function_exists('geodir_register_defaults')) {
261
+	/**
262
+	 * Calls the function to register the GeoDirectory default CPT and taxonomies.
263
+	 *
264
+	 * @since 1.0.0
265
+	 * @package GeoDirectory
266
+	 */
267
+	function geodir_init_defaults()
268
+	{
269
+		if (function_exists('geodir_register_defaults')) {
270 270
 
271
-            geodir_register_defaults();
271
+			geodir_register_defaults();
272 272
 
273
-        }
273
+		}
274 274
 
275
-    }
275
+	}
276 276
 }
277 277
 
278 278
 
@@ -294,26 +294,26 @@  discard block
 block discarded – undo
294 294
 // CALLED ON 'sidebars_widgets' FILTER
295 295
 
296 296
 if (!function_exists('geodir_restrict_widget')) {
297
-    /**
298
-     * Sets global values to be able to tell if the current page is a GeoDirectory listing page or a GeoDirectory details page.
299
-     *
300
-     * @global bool $is_listing Sets the global value to true if on a GD category page. False if not.
301
-     * @global bool $is_single_place Sets the global value to true if on a GD details (post) page. False if not.
302
-     * @since 1.0.0
303
-     * @package GeoDirectory
304
-     */
305
-    function geodir_restrict_widget()
306
-    {
307
-        global $is_listing, $is_single_place;
297
+	/**
298
+	 * Sets global values to be able to tell if the current page is a GeoDirectory listing page or a GeoDirectory details page.
299
+	 *
300
+	 * @global bool $is_listing Sets the global value to true if on a GD category page. False if not.
301
+	 * @global bool $is_single_place Sets the global value to true if on a GD details (post) page. False if not.
302
+	 * @since 1.0.0
303
+	 * @package GeoDirectory
304
+	 */
305
+	function geodir_restrict_widget()
306
+	{
307
+		global $is_listing, $is_single_place;
308 308
 
309
-        // set is listing	
310
-        (geodir_is_page('listing')) ? $is_listing = true : $is_listing = false;
309
+		// set is listing	
310
+		(geodir_is_page('listing')) ? $is_listing = true : $is_listing = false;
311 311
 
312
-        // set is single place
313
-        (geodir_is_page('place')) ? $is_single_place = true : $is_single_place = false;
312
+		// set is single place
313
+		(geodir_is_page('place')) ? $is_single_place = true : $is_single_place = false;
314 314
 
315 315
 
316
-    }
316
+	}
317 317
 }
318 318
 
319 319
 
@@ -334,32 +334,32 @@  discard block
 block discarded – undo
334 334
  */
335 335
 function geodir_detail_page_sidebar_content_sorting()
336 336
 {
337
-    $arr_detail_page_sidebar_content =
338
-        /**
339
-         * An array of functions to be called to be displayed on the details (post) page sidebar.
340
-         *
341
-         * This filter can be used to remove sections of the details page sidebar,
342
-         * add new sections or rearrange the order of the sections.
343
-         *
344
-         * @param array array('geodir_social_sharing_buttons','geodir_share_this_button','geodir_detail_page_google_analytics','geodir_edit_post_link','geodir_detail_page_review_rating','geodir_detail_page_more_info') The array of functions that will be called.
345
-         * @since 1.0.0
346
-         */
347
-        apply_filters('geodir_detail_page_sidebar_content',
348
-            array('geodir_social_sharing_buttons',
349
-                'geodir_share_this_button',
350
-                'geodir_detail_page_google_analytics',
351
-                'geodir_edit_post_link',
352
-                'geodir_detail_page_review_rating',
353
-                'geodir_detail_page_more_info'
354
-            ) // end of array 
355
-        ); // end of apply filter
356
-    if (!empty($arr_detail_page_sidebar_content)) {
357
-        foreach ($arr_detail_page_sidebar_content as $content_function) {
358
-            if (function_exists($content_function)) {
359
-                add_action('geodir_detail_page_sidebar', $content_function);
360
-            }
361
-        }
362
-    }
337
+	$arr_detail_page_sidebar_content =
338
+		/**
339
+		 * An array of functions to be called to be displayed on the details (post) page sidebar.
340
+		 *
341
+		 * This filter can be used to remove sections of the details page sidebar,
342
+		 * add new sections or rearrange the order of the sections.
343
+		 *
344
+		 * @param array array('geodir_social_sharing_buttons','geodir_share_this_button','geodir_detail_page_google_analytics','geodir_edit_post_link','geodir_detail_page_review_rating','geodir_detail_page_more_info') The array of functions that will be called.
345
+		 * @since 1.0.0
346
+		 */
347
+		apply_filters('geodir_detail_page_sidebar_content',
348
+			array('geodir_social_sharing_buttons',
349
+				'geodir_share_this_button',
350
+				'geodir_detail_page_google_analytics',
351
+				'geodir_edit_post_link',
352
+				'geodir_detail_page_review_rating',
353
+				'geodir_detail_page_more_info'
354
+			) // end of array 
355
+		); // end of apply filter
356
+	if (!empty($arr_detail_page_sidebar_content)) {
357
+		foreach ($arr_detail_page_sidebar_content as $content_function) {
358
+			if (function_exists($content_function)) {
359
+				add_action('geodir_detail_page_sidebar', $content_function);
360
+			}
361
+		}
362
+	}
363 363
 }
364 364
 
365 365
 add_action('geodir_after_edit_post_link', 'geodir_add_to_favourite_link', 1);
@@ -374,14 +374,14 @@  discard block
 block discarded – undo
374 374
  */
375 375
 function geodir_add_to_favourite_link()
376 376
 {
377
-    global $post, $preview;
378
-    if (!$preview && geodir_is_page('detail')) {
379
-        ?>
377
+	global $post, $preview;
378
+	if (!$preview && geodir_is_page('detail')) {
379
+		?>
380 380
         <p class="edit_link">
381 381
             <?php geodir_favourite_html($post->post_author, $post->ID); ?>
382 382
         </p>
383 383
     <?php
384
-    }
384
+	}
385 385
 }
386 386
 
387 387
 /**
@@ -395,41 +395,41 @@  discard block
 block discarded – undo
395 395
  */
396 396
 function geodir_social_sharing_buttons()
397 397
 {
398
-    global $preview;
399
-    ob_start(); // Start  buffering;
400
-    /**
401
-     * This action is called before the social buttons twitter,facebook and google plus are output in a containing div.
402
-     *
403
-     * @since 1.0.0
404
-     */
405
-    do_action('geodir_before_social_sharing_buttons');
406
-    if (!$preview) {
407
-        ?>
398
+	global $preview;
399
+	ob_start(); // Start  buffering;
400
+	/**
401
+	 * This action is called before the social buttons twitter,facebook and google plus are output in a containing div.
402
+	 *
403
+	 * @since 1.0.0
404
+	 */
405
+	do_action('geodir_before_social_sharing_buttons');
406
+	if (!$preview) {
407
+		?>
408 408
         <div class="likethis">
409 409
             <?php geodir_twitter_tweet_button(); ?>
410 410
             <?php geodir_fb_like_button(); ?>
411 411
             <?php geodir_google_plus_button(); ?>
412 412
         </div>
413 413
     <?php
414
-    }// end of if, if its a preview or not
415
-
416
-    /**
417
-     * This action is called after the social buttons twitter,facebook and google plus are output in a containing div.
418
-     *
419
-     * @since 1.0.0
420
-     */
421
-    do_action('geodir_after_social_sharing_buttons');
422
-    $content_html = ob_get_clean();
423
-    if (trim($content_html) != '')
424
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-social-sharing">' . $content_html . '</div>';
425
-    if ((int)get_option('geodir_disable_tfg_buttons_section') != 1) {
426
-        /**
427
-         * Filter the geodir_social_sharing_buttons() function content.
428
-         *
429
-         * @param string $content_html The output html of the geodir_social_sharing_buttons() function.
430
-         */
431
-        echo $content_html = apply_filters('geodir_social_sharing_buttons_html', $content_html);
432
-    }
414
+	}// end of if, if its a preview or not
415
+
416
+	/**
417
+	 * This action is called after the social buttons twitter,facebook and google plus are output in a containing div.
418
+	 *
419
+	 * @since 1.0.0
420
+	 */
421
+	do_action('geodir_after_social_sharing_buttons');
422
+	$content_html = ob_get_clean();
423
+	if (trim($content_html) != '')
424
+		$content_html = '<div class="geodir-company_info geodir-details-sidebar-social-sharing">' . $content_html . '</div>';
425
+	if ((int)get_option('geodir_disable_tfg_buttons_section') != 1) {
426
+		/**
427
+		 * Filter the geodir_social_sharing_buttons() function content.
428
+		 *
429
+		 * @param string $content_html The output html of the geodir_social_sharing_buttons() function.
430
+		 */
431
+		echo $content_html = apply_filters('geodir_social_sharing_buttons_html', $content_html);
432
+	}
433 433
 
434 434
 
435 435
 }
@@ -445,39 +445,39 @@  discard block
 block discarded – undo
445 445
  */
446 446
 function geodir_share_this_button()
447 447
 {
448
-    global $preview;
449
-    ob_start(); // Start buffering;
450
-    /**
451
-     * This is called before the share this html in the function geodir_share_this_button()
452
-     *
453
-     * @since 1.0.0
454
-     */
455
-    do_action('geodir_before_share_this_button');
456
-    if (!$preview) {
457
-        ?>
448
+	global $preview;
449
+	ob_start(); // Start buffering;
450
+	/**
451
+	 * This is called before the share this html in the function geodir_share_this_button()
452
+	 *
453
+	 * @since 1.0.0
454
+	 */
455
+	do_action('geodir_before_share_this_button');
456
+	if (!$preview) {
457
+		?>
458 458
         <div class="share clearfix">
459 459
             <?php geodir_share_this_button_code(); ?>
460 460
         </div>
461 461
     <?php
462
-    }// end of if, if its a preview or not
463
-    /**
464
-     * This is called after the share this html in the function geodir_share_this_button()
465
-     *
466
-     * @since 1.0.0
467
-     */
468
-    do_action('geodir_after_share_this_button');
469
-    $content_html = ob_get_clean();
470
-    if (trim($content_html) != '')
471
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-sharethis">' . $content_html . '</div>';
472
-    if ((int)get_option('geodir_disable_sharethis_button_section') != 1) {
473
-        /**
474
-         * Filter the geodir_share_this_button() function content.
475
-         *
476
-         * @param string $content_html The output html of the geodir_share_this_button() function.
477
-         * @since 1.0.0
478
-         */
479
-        echo $content_html = apply_filters('geodir_share_this_button_html', $content_html);
480
-    }
462
+	}// end of if, if its a preview or not
463
+	/**
464
+	 * This is called after the share this html in the function geodir_share_this_button()
465
+	 *
466
+	 * @since 1.0.0
467
+	 */
468
+	do_action('geodir_after_share_this_button');
469
+	$content_html = ob_get_clean();
470
+	if (trim($content_html) != '')
471
+		$content_html = '<div class="geodir-company_info geodir-details-sidebar-sharethis">' . $content_html . '</div>';
472
+	if ((int)get_option('geodir_disable_sharethis_button_section') != 1) {
473
+		/**
474
+		 * Filter the geodir_share_this_button() function content.
475
+		 *
476
+		 * @param string $content_html The output html of the geodir_share_this_button() function.
477
+		 * @since 1.0.0
478
+		 */
479
+		echo $content_html = apply_filters('geodir_share_this_button_html', $content_html);
480
+	}
481 481
 
482 482
 }
483 483
 
@@ -493,46 +493,46 @@  discard block
 block discarded – undo
493 493
  */
494 494
 function geodir_edit_post_link()
495 495
 {
496
-    global $post, $preview;
497
-    ob_start(); // Start buffering;
498
-    /**
499
-     * This is called before the edit post link html in the function geodir_edit_post_link()
500
-     *
501
-     * @since 1.0.0
502
-     */
503
-    do_action('geodir_before_edit_post_link');
504
-    if (!$preview) {
505
-        $is_current_user_owner = geodir_listing_belong_to_current_user();
496
+	global $post, $preview;
497
+	ob_start(); // Start buffering;
498
+	/**
499
+	 * This is called before the edit post link html in the function geodir_edit_post_link()
500
+	 *
501
+	 * @since 1.0.0
502
+	 */
503
+	do_action('geodir_before_edit_post_link');
504
+	if (!$preview) {
505
+		$is_current_user_owner = geodir_listing_belong_to_current_user();
506 506
         
507
-        if ($is_current_user_owner) {
508
-            $post_id = $post->ID;
507
+		if ($is_current_user_owner) {
508
+			$post_id = $post->ID;
509 509
             
510
-            if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
511
-                $post_id = (int)$_REQUEST['pid'];
512
-            }
510
+			if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
511
+				$post_id = (int)$_REQUEST['pid'];
512
+			}
513 513
 
514
-            $postlink = get_permalink(geodir_add_listing_page_id());
515
-            $editlink = geodir_getlink($postlink, array('pid' => $post_id), false);
516
-            echo ' <p class="edit_link"><i class="fa fa-pencil"></i> <a href="' . esc_url($editlink) . '">' . __('Edit this Post', 'geodirectory') . '</a></p>';
517
-        }
518
-    }// end of if, if its a preview or not
519
-    /**
520
-     * This is called after the edit post link html in the function geodir_edit_post_link()
521
-     *
522
-     * @since 1.0.0
523
-     */
524
-    do_action('geodir_after_edit_post_link');
525
-    $content_html = ob_get_clean();
526
-    if (trim($content_html) != '')
527
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-user-links">' . $content_html . '</div>';
528
-    if ((int)get_option('geodir_disable_user_links_section') != 1) {
529
-        /**
530
-         * Filter the geodir_edit_post_link() function content.
531
-         *
532
-         * @param string $content_html The output html of the geodir_edit_post_link() function.
533
-         */
534
-        echo $content_html = apply_filters('geodir_edit_post_link_html', $content_html);
535
-    }
514
+			$postlink = get_permalink(geodir_add_listing_page_id());
515
+			$editlink = geodir_getlink($postlink, array('pid' => $post_id), false);
516
+			echo ' <p class="edit_link"><i class="fa fa-pencil"></i> <a href="' . esc_url($editlink) . '">' . __('Edit this Post', 'geodirectory') . '</a></p>';
517
+		}
518
+	}// end of if, if its a preview or not
519
+	/**
520
+	 * This is called after the edit post link html in the function geodir_edit_post_link()
521
+	 *
522
+	 * @since 1.0.0
523
+	 */
524
+	do_action('geodir_after_edit_post_link');
525
+	$content_html = ob_get_clean();
526
+	if (trim($content_html) != '')
527
+		$content_html = '<div class="geodir-company_info geodir-details-sidebar-user-links">' . $content_html . '</div>';
528
+	if ((int)get_option('geodir_disable_user_links_section') != 1) {
529
+		/**
530
+		 * Filter the geodir_edit_post_link() function content.
531
+		 *
532
+		 * @param string $content_html The output html of the geodir_edit_post_link() function.
533
+		 */
534
+		echo $content_html = apply_filters('geodir_edit_post_link_html', $content_html);
535
+	}
536 536
 }
537 537
 
538 538
 /**
@@ -546,41 +546,41 @@  discard block
 block discarded – undo
546 546
  */
547 547
 function geodir_detail_page_google_analytics()
548 548
 {
549
-    global $post;
550
-    $package_info = array();
551
-    $package_info = geodir_post_package_info($package_info, $post);
549
+	global $post;
550
+	$package_info = array();
551
+	$package_info = geodir_post_package_info($package_info, $post);
552 552
 
553
-    $id = trim(get_option('geodir_ga_id'));
553
+	$id = trim(get_option('geodir_ga_id'));
554 554
 
555
-    if (!$id) {
556
-        return; //if no Google Analytics ID then bail.
557
-    }
555
+	if (!$id) {
556
+		return; //if no Google Analytics ID then bail.
557
+	}
558 558
 
559
-    ob_start(); // Start buffering;
560
-    /**
561
-     * This is called before the edit post link html in the function geodir_detail_page_google_analytics()
562
-     *
563
-     * @since 1.0.0
564
-     */
565
-    do_action('geodir_before_google_analytics');
559
+	ob_start(); // Start buffering;
560
+	/**
561
+	 * This is called before the edit post link html in the function geodir_detail_page_google_analytics()
562
+	 *
563
+	 * @since 1.0.0
564
+	 */
565
+	do_action('geodir_before_google_analytics');
566 566
     
567
-    $refresh_time = get_option('geodir_ga_refresh_time', 5);
568
-    /**
569
-     * Filter the time interval to check & refresh new users results.
570
-     *
571
-     * @since 1.5.9
572
-     *
573
-     * @param int $refresh_time Time interval to check & refresh new users results.
574
-     */
575
-    $refresh_time = apply_filters('geodir_google_analytics_refresh_time', $refresh_time);
576
-    $refresh_time = absint($refresh_time * 1000);
567
+	$refresh_time = get_option('geodir_ga_refresh_time', 5);
568
+	/**
569
+	 * Filter the time interval to check & refresh new users results.
570
+	 *
571
+	 * @since 1.5.9
572
+	 *
573
+	 * @param int $refresh_time Time interval to check & refresh new users results.
574
+	 */
575
+	$refresh_time = apply_filters('geodir_google_analytics_refresh_time', $refresh_time);
576
+	$refresh_time = absint($refresh_time * 1000);
577 577
     
578
-    $hide_refresh = get_option('geodir_ga_auto_refresh');
578
+	$hide_refresh = get_option('geodir_ga_auto_refresh');
579 579
     
580
-    $auto_refresh = $hide_refresh && $refresh_time && $refresh_time > 0 ? 1 : 0;
581
-    if (get_option('geodir_ga_stats') && is_user_logged_in() &&  (isset($package_info->google_analytics) && $package_info->google_analytics == '1') && (get_current_user_id()==$post->post_author || current_user_can( 'manage_options' )) ) {
582
-        $page_url = urlencode($_SERVER['REQUEST_URI']);
583
-        ?>
580
+	$auto_refresh = $hide_refresh && $refresh_time && $refresh_time > 0 ? 1 : 0;
581
+	if (get_option('geodir_ga_stats') && is_user_logged_in() &&  (isset($package_info->google_analytics) && $package_info->google_analytics == '1') && (get_current_user_id()==$post->post_author || current_user_can( 'manage_options' )) ) {
582
+		$page_url = urlencode($_SERVER['REQUEST_URI']);
583
+		?>
584 584
         <script type="text/javascript">
585 585
             var gd_gaTimeOut;
586 586
             var gd_gaTime = parseInt('<?php echo $refresh_time;?>');
@@ -832,15 +832,15 @@  discard block
 block discarded – undo
832 832
                     var labels = results[1].rows.map(function(row) { return +row[0]; });
833 833
 
834 834
                     <?php
835
-                    // Here we list the shorthand days of the week so it can be used in translation.
836
-                    __("Mon",'geodirectory');
837
-                    __("Tue",'geodirectory');
838
-                    __("Wed",'geodirectory');
839
-                    __("Thu",'geodirectory');
840
-                    __("Fri",'geodirectory');
841
-                    __("Sat",'geodirectory');
842
-                    __("Sun",'geodirectory');
843
-                    ?>
835
+					// Here we list the shorthand days of the week so it can be used in translation.
836
+					__("Mon",'geodirectory');
837
+					__("Tue",'geodirectory');
838
+					__("Wed",'geodirectory');
839
+					__("Thu",'geodirectory');
840
+					__("Fri",'geodirectory');
841
+					__("Sat",'geodirectory');
842
+					__("Sun",'geodirectory');
843
+					?>
844 844
 
845 845
                     labels = [
846 846
                         "<?php _e(date('D', strtotime("+1 day")),'geodirectory'); ?>",
@@ -1089,24 +1089,24 @@  discard block
 block discarded – undo
1089 1089
         </span>
1090 1090
 
1091 1091
     <?php
1092
-    }
1093
-    /**
1094
-     * This is called after the edit post link html in the function geodir_detail_page_google_analytics()
1095
-     *
1096
-     * @since 1.0.0
1097
-     */
1098
-    do_action('geodir_after_google_analytics');
1099
-    $content_html = ob_get_clean();
1100
-    if (trim($content_html) != '')
1101
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-google-analytics">' . $content_html . '</div>';
1102
-    if ((int)get_option('geodir_disable_google_analytics_section') != 1) {
1103
-        /**
1104
-         * Filter the geodir_edit_post_link() function content.
1105
-         *
1106
-         * @param string $content_html The output html of the geodir_edit_post_link() function.
1107
-         */
1108
-        echo $content_html = apply_filters('geodir_google_analytic_html', $content_html);
1109
-    }
1092
+	}
1093
+	/**
1094
+	 * This is called after the edit post link html in the function geodir_detail_page_google_analytics()
1095
+	 *
1096
+	 * @since 1.0.0
1097
+	 */
1098
+	do_action('geodir_after_google_analytics');
1099
+	$content_html = ob_get_clean();
1100
+	if (trim($content_html) != '')
1101
+		$content_html = '<div class="geodir-company_info geodir-details-sidebar-google-analytics">' . $content_html . '</div>';
1102
+	if ((int)get_option('geodir_disable_google_analytics_section') != 1) {
1103
+		/**
1104
+		 * Filter the geodir_edit_post_link() function content.
1105
+		 *
1106
+		 * @param string $content_html The output html of the geodir_edit_post_link() function.
1107
+		 */
1108
+		echo $content_html = apply_filters('geodir_google_analytic_html', $content_html);
1109
+	}
1110 1110
 }
1111 1111
 
1112 1112
 /**
@@ -1120,90 +1120,90 @@  discard block
 block discarded – undo
1120 1120
  */
1121 1121
 function geodir_detail_page_review_rating()
1122 1122
 {
1123
-    global $post, $preview, $post_images;
1124
-    ob_start(); // Start  buffering;
1125
-    /**
1126
-     * This is called before the rating html in the function geodir_detail_page_review_rating().
1127
-     *
1128
-     * This is called outside the check for an actual rating and the check for preview page.
1129
-     *
1130
-     * @since 1.0.0
1131
-     */
1132
-    do_action('geodir_before_detail_page_review_rating');
1133
-
1134
-    $comment_count = geodir_get_review_count_total($post->ID);
1135
-    $post_avgratings = geodir_get_post_rating($post->ID);
1136
-
1137
-    if ($post_avgratings != 0 && !$preview) {
1138
-        /**
1139
-         * This is called before the rating html in the function geodir_detail_page_review_rating().
1140
-         *
1141
-         * This is called inside the check for an actual rating and the check for preview page.
1142
-         *
1143
-         * @since 1.0.0
1144
-         * @param float $post_avgratings Average rating for the surrent post.
1145
-         * @param int $post->ID Current post ID.
1146
-         */
1147
-        do_action('geodir_before_review_rating_stars_on_detail', $post_avgratings, $post->ID);
1148
-
1149
-        $html = '<p style=" float:left;">';
1150
-        $html .= geodir_get_rating_stars($post_avgratings, $post->ID);
1151
-        $html .= '<div class="average-review" itemscope itemtype="http://data-vocabulary.org/Review-aggregate">';
1152
-        $post_avgratings = (is_float($post_avgratings) || (strpos($post_avgratings, ".", 1) == 1 && strlen($post_avgratings) > 3)) ? number_format($post_avgratings, 1, '.', '') : $post_avgratings;
1123
+	global $post, $preview, $post_images;
1124
+	ob_start(); // Start  buffering;
1125
+	/**
1126
+	 * This is called before the rating html in the function geodir_detail_page_review_rating().
1127
+	 *
1128
+	 * This is called outside the check for an actual rating and the check for preview page.
1129
+	 *
1130
+	 * @since 1.0.0
1131
+	 */
1132
+	do_action('geodir_before_detail_page_review_rating');
1133
+
1134
+	$comment_count = geodir_get_review_count_total($post->ID);
1135
+	$post_avgratings = geodir_get_post_rating($post->ID);
1136
+
1137
+	if ($post_avgratings != 0 && !$preview) {
1138
+		/**
1139
+		 * This is called before the rating html in the function geodir_detail_page_review_rating().
1140
+		 *
1141
+		 * This is called inside the check for an actual rating and the check for preview page.
1142
+		 *
1143
+		 * @since 1.0.0
1144
+		 * @param float $post_avgratings Average rating for the surrent post.
1145
+		 * @param int $post->ID Current post ID.
1146
+		 */
1147
+		do_action('geodir_before_review_rating_stars_on_detail', $post_avgratings, $post->ID);
1148
+
1149
+		$html = '<p style=" float:left;">';
1150
+		$html .= geodir_get_rating_stars($post_avgratings, $post->ID);
1151
+		$html .= '<div class="average-review" itemscope itemtype="http://data-vocabulary.org/Review-aggregate">';
1152
+		$post_avgratings = (is_float($post_avgratings) || (strpos($post_avgratings, ".", 1) == 1 && strlen($post_avgratings) > 3)) ? number_format($post_avgratings, 1, '.', '') : $post_avgratings;
1153 1153
        
1154 1154
 	   $reviews_text = $comment_count > 1 ? __("reviews", 'geodirectory') : __("review", 'geodirectory');
1155 1155
 	   
1156 1156
 	   $html .= '<span itemprop="rating" itemscope itemtype="http://data-vocabulary.org/Rating"><span class="rating" itemprop="average" content="' . $post_avgratings . '">' . $post_avgratings . '</span> / <span itemprop="best" content="5">5</span> ' . __("based on", 'geodirectory') . ' </span><span class="count" itemprop="count" content="' . $comment_count . '">' . $comment_count . ' ' . $reviews_text . '</span><br />';
1157 1157
 
1158
-        $html .= '<span class="item">';
1159
-        $html .= '<span class="fn" itemprop="itemreviewed">' . $post->post_title . '</span>';
1158
+		$html .= '<span class="item">';
1159
+		$html .= '<span class="fn" itemprop="itemreviewed">' . $post->post_title . '</span>';
1160 1160
 
1161
-        if ($post_images) {
1162
-            foreach ($post_images as $img) {
1163
-                $post_img = $img->src;
1164
-                break;
1165
-            }
1166
-        }
1167
-
1168
-        if (isset($post_img) && $post_img) {
1169
-            $html .= '<br /><img src="' . $post_img . '" class="photo hreview-img" alt="' . esc_attr($post->post_title) . '" itemprop="photo" content="' . $post_img . '" class="photo hreview-img" />';
1170
-        }
1171
-
1172
-        $html .= '</span>';
1173
-
1174
-        echo $html .= '</div>';
1175
-        /**
1176
-         * This is called after the rating html in the function geodir_detail_page_review_rating().
1177
-         *
1178
-         * This is called inside the check for an actual rating and the check for preview page.
1179
-         *
1180
-         * @since 1.0.0
1181
-         * @param float $post_avgratings Average rating for the surrent post.
1182
-         * @param int $post->ID Current post ID.
1183
-         */
1184
-        do_action('geodir_after_review_rating_stars_on_detail', $post_avgratings, $post->ID);
1185
-    }
1186
-    /**
1187
-     * This is called before the rating html in the function geodir_detail_page_review_rating().
1188
-     *
1189
-     * This is called outside the check for an actual rating and the check for preview page.
1190
-     *
1191
-     * @since 1.0.0
1192
-     */
1193
-    do_action('geodir_after_detail_page_review_rating');
1194
-    $content_html = ob_get_clean();
1195
-    if (trim($content_html) != '') {
1196
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-rating">' . $content_html . '</div>';
1197
-    }
1198
-    if ((int)get_option('geodir_disable_rating_info_section') != 1) {
1199
-        /**
1200
-         * Filter the geodir_detail_page_review_rating() function content.
1201
-         *
1202
-         * @since 1.0.0
1203
-         * @param string $content_html The output html of the geodir_detail_page_review_rating() function.
1204
-         */
1205
-        echo $content_html = apply_filters('geodir_detail_page_review_rating_html', $content_html);
1206
-    }
1161
+		if ($post_images) {
1162
+			foreach ($post_images as $img) {
1163
+				$post_img = $img->src;
1164
+				break;
1165
+			}
1166
+		}
1167
+
1168
+		if (isset($post_img) && $post_img) {
1169
+			$html .= '<br /><img src="' . $post_img . '" class="photo hreview-img" alt="' . esc_attr($post->post_title) . '" itemprop="photo" content="' . $post_img . '" class="photo hreview-img" />';
1170
+		}
1171
+
1172
+		$html .= '</span>';
1173
+
1174
+		echo $html .= '</div>';
1175
+		/**
1176
+		 * This is called after the rating html in the function geodir_detail_page_review_rating().
1177
+		 *
1178
+		 * This is called inside the check for an actual rating and the check for preview page.
1179
+		 *
1180
+		 * @since 1.0.0
1181
+		 * @param float $post_avgratings Average rating for the surrent post.
1182
+		 * @param int $post->ID Current post ID.
1183
+		 */
1184
+		do_action('geodir_after_review_rating_stars_on_detail', $post_avgratings, $post->ID);
1185
+	}
1186
+	/**
1187
+	 * This is called before the rating html in the function geodir_detail_page_review_rating().
1188
+	 *
1189
+	 * This is called outside the check for an actual rating and the check for preview page.
1190
+	 *
1191
+	 * @since 1.0.0
1192
+	 */
1193
+	do_action('geodir_after_detail_page_review_rating');
1194
+	$content_html = ob_get_clean();
1195
+	if (trim($content_html) != '') {
1196
+		$content_html = '<div class="geodir-company_info geodir-details-sidebar-rating">' . $content_html . '</div>';
1197
+	}
1198
+	if ((int)get_option('geodir_disable_rating_info_section') != 1) {
1199
+		/**
1200
+		 * Filter the geodir_detail_page_review_rating() function content.
1201
+		 *
1202
+		 * @since 1.0.0
1203
+		 * @param string $content_html The output html of the geodir_detail_page_review_rating() function.
1204
+		 */
1205
+		echo $content_html = apply_filters('geodir_detail_page_review_rating_html', $content_html);
1206
+	}
1207 1207
 }
1208 1208
 
1209 1209
 /**
@@ -1215,35 +1215,35 @@  discard block
 block discarded – undo
1215 1215
  */
1216 1216
 function geodir_detail_page_more_info()
1217 1217
 {
1218
-    ob_start(); // Start  buffering;
1219
-    /**
1220
-     * This is called before the info section html.
1221
-     *
1222
-     * @since 1.0.0
1223
-     */
1224
-    do_action('geodir_before_detail_page_more_info');
1225
-    if ($geodir_post_detail_fields = geodir_show_listing_info()) {
1226
-        echo $geodir_post_detail_fields;
1227
-    }
1228
-    /**
1229
-     * This is called after the info section html.
1230
-     *
1231
-     * @since 1.0.0
1232
-     */
1233
-    do_action('geodir_after_detail_page_more_info');
1234
-
1235
-    $content_html = ob_get_clean();
1236
-    if (trim($content_html) != '')
1237
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-listing-info">' . $content_html . '</div>';
1238
-    if ((int)get_option('geodir_disable_listing_info_section') != 1) {
1239
-        /**
1240
-         * Filter the output html for function geodir_detail_page_more_info().
1241
-         *
1242
-         * @since 1.0.0
1243
-         * @param string $content_html The output html of the geodir_detail_page_more_info() function.
1244
-         */
1245
-        echo $content_html = apply_filters('geodir_detail_page_more_info_html', $content_html);
1246
-    }
1218
+	ob_start(); // Start  buffering;
1219
+	/**
1220
+	 * This is called before the info section html.
1221
+	 *
1222
+	 * @since 1.0.0
1223
+	 */
1224
+	do_action('geodir_before_detail_page_more_info');
1225
+	if ($geodir_post_detail_fields = geodir_show_listing_info()) {
1226
+		echo $geodir_post_detail_fields;
1227
+	}
1228
+	/**
1229
+	 * This is called after the info section html.
1230
+	 *
1231
+	 * @since 1.0.0
1232
+	 */
1233
+	do_action('geodir_after_detail_page_more_info');
1234
+
1235
+	$content_html = ob_get_clean();
1236
+	if (trim($content_html) != '')
1237
+		$content_html = '<div class="geodir-company_info geodir-details-sidebar-listing-info">' . $content_html . '</div>';
1238
+	if ((int)get_option('geodir_disable_listing_info_section') != 1) {
1239
+		/**
1240
+		 * Filter the output html for function geodir_detail_page_more_info().
1241
+		 *
1242
+		 * @since 1.0.0
1243
+		 * @param string $content_html The output html of the geodir_detail_page_more_info() function.
1244
+		 */
1245
+		echo $content_html = apply_filters('geodir_detail_page_more_info_html', $content_html);
1246
+	}
1247 1247
 }
1248 1248
 
1249 1249
 
@@ -1257,15 +1257,15 @@  discard block
 block discarded – undo
1257 1257
  */
1258 1258
 function geodir_localize_all_js_msg()
1259 1259
 {// check_ajax_referer function is used to make sure no files are uplaoded remotly but it will fail if used between https and non https so we do the check below of the urls
1260
-    if (str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
1261
-        $ajax_url = admin_url('admin-ajax.php');
1262
-    } elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
1263
-        $ajax_url = admin_url('admin-ajax.php');
1264
-    } elseif (str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
1265
-        $ajax_url = str_replace("https", "http", admin_url('admin-ajax.php'));
1266
-    } elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
1267
-        $ajax_url = str_replace("http", "https", admin_url('admin-ajax.php'));
1268
-    }
1260
+	if (str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
1261
+		$ajax_url = admin_url('admin-ajax.php');
1262
+	} elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
1263
+		$ajax_url = admin_url('admin-ajax.php');
1264
+	} elseif (str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
1265
+		$ajax_url = str_replace("https", "http", admin_url('admin-ajax.php'));
1266
+	} elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
1267
+		$ajax_url = str_replace("http", "https", admin_url('admin-ajax.php'));
1268
+	}
1269 1269
 	
1270 1270
 	/**
1271 1271
 	 * Filter the allowed image type extensions for post images.
@@ -1275,59 +1275,59 @@  discard block
 block discarded – undo
1275 1275
 	 */
1276 1276
 	$allowed_img_types = apply_filters('geodir_allowed_post_image_exts', array('jpg', 'jpeg', 'jpe', 'gif', 'png'));
1277 1277
 	
1278
-    $default_marker_icon = get_option('geodir_default_marker_icon');
1279
-    $default_marker_size = geodir_get_marker_size($default_marker_icon, array('w' => 20, 'h' => 34));
1280
-    $default_marker_width = $default_marker_size['w'];
1281
-    $default_marker_height = $default_marker_size['h'];
1278
+	$default_marker_icon = get_option('geodir_default_marker_icon');
1279
+	$default_marker_size = geodir_get_marker_size($default_marker_icon, array('w' => 20, 'h' => 34));
1280
+	$default_marker_width = $default_marker_size['w'];
1281
+	$default_marker_height = $default_marker_size['h'];
1282 1282
     
1283
-    $arr_alert_msg = array(
1284
-        'geodir_plugin_url' => geodir_plugin_url(),
1285
-        'geodir_admin_ajax_url' => $ajax_url,
1286
-        'custom_field_not_blank_var' => __('HTML Variable Name must not be blank', 'geodirectory'),
1287
-        'custom_field_not_special_char' => __('Please do not use special character and spaces in HTML Variable Name.', 'geodirectory'),
1288
-        'custom_field_unique_name' => __('HTML Variable Name should be a unique name.', 'geodirectory'),
1289
-        'custom_field_delete' => __('Are you wish to delete this field?', 'geodirectory'),
1290
-        //start not show alert msg
1291
-        'tax_meta_class_succ_del_msg' => __('File has been successfully deleted.', 'geodirectory'),
1292
-        'tax_meta_class_not_permission_to_del_msg' => __('You do NOT have permission to delete this file.', 'geodirectory'),
1293
-        'tax_meta_class_order_save_msg' => __('Order saved!', 'geodirectory'),
1294
-        'tax_meta_class_not_permission_record_img_msg' => __('You do not have permission to reorder images.', 'geodirectory'),
1295
-        'address_not_found_on_map_msg' => __('Address not found for:', 'geodirectory'),
1296
-        // end not show alert msg
1297
-        'my_place_listing_del' => __('Are you wish to delete this listing?', 'geodirectory'),
1298
-        //start not show alert msg
1299
-        'rating_error_msg' => __('Error : please retry', 'geodirectory'),
1300
-        'listing_url_prefix_msg' => __('Please enter listing url prefix', 'geodirectory'),
1301
-        'invalid_listing_prefix_msg' => __('Invalid character in listing url prefix', 'geodirectory'),
1302
-        'location_url_prefix_msg' => __('Please enter location url prefix', 'geodirectory'),
1303
-        'invalid_location_prefix_msg' => __('Invalid character in location url prefix', 'geodirectory'),
1304
-        'location_and_cat_url_separator_msg' => __('Please enter location and category url separator', 'geodirectory'),
1305
-        'invalid_char_and_cat_url_separator_msg' => __('Invalid character in location and category url separator', 'geodirectory'),
1306
-        'listing_det_url_separator_msg' => __('Please enter listing detail url separator', 'geodirectory'),
1307
-        'invalid_char_listing_det_url_separator_msg' => __('Invalid character in listing detail url separator', 'geodirectory'),
1308
-        'loading_listing_error_favorite' => __('Error loading listing.', 'geodirectory'),
1309
-        'geodir_field_id_required' => __('This field is required.', 'geodirectory'),
1310
-        'geodir_valid_email_address_msg' => __('Please enter valid email address.', 'geodirectory'),
1311
-        'geodir_default_marker_icon' => $default_marker_icon,
1312
-        'geodir_default_marker_w' => $default_marker_width,
1313
-        'geodir_default_marker_h' => $default_marker_height,
1314
-        'geodir_latitude_error_msg' => GEODIR_LATITUDE_ERROR_MSG,
1315
-        'geodir_longgitude_error_msg' => GEODIR_LOGNGITUDE_ERROR_MSG,
1316
-        'geodir_default_rating_star_icon' => get_option('geodir_default_rating_star_icon'),
1317
-        'gd_cmt_btn_post_reply' => __('Post Reply', 'geodirectory'),
1318
-        'gd_cmt_btn_reply_text' => __('Reply text', 'geodirectory'),
1319
-        'gd_cmt_btn_post_review' => __('Post Review', 'geodirectory'),
1320
-        'gd_cmt_btn_review_text' => __('Review text', 'geodirectory'),
1321
-        'gd_cmt_err_no_rating' => __("Please select star rating, you can't leave a review without stars.", 'geodirectory'),
1322
-        /* on/off dragging for phone devices */
1323
-        'geodir_onoff_dragging' => get_option('geodir_map_onoff_dragging') ? true : false,
1324
-        'geodir_is_mobile' => wp_is_mobile() ? true : false,
1325
-        'geodir_on_dragging_text' => __('Enable Dragging', 'geodirectory'),
1326
-        'geodir_off_dragging_text' => __('Disable Dragging', 'geodirectory'),
1327
-        'geodir_err_max_file_size' => __('File size error : You tried to upload a file over %s', 'geodirectory'),
1328
-        'geodir_err_file_upload_limit' => __('You have reached your upload limit of %s files.', 'geodirectory'),
1329
-        'geodir_err_pkg_upload_limit' => __('You may only upload %s files with this package, please try again.', 'geodirectory'),
1330
-        'geodir_action_remove' => __('Remove', 'geodirectory'),
1283
+	$arr_alert_msg = array(
1284
+		'geodir_plugin_url' => geodir_plugin_url(),
1285
+		'geodir_admin_ajax_url' => $ajax_url,
1286
+		'custom_field_not_blank_var' => __('HTML Variable Name must not be blank', 'geodirectory'),
1287
+		'custom_field_not_special_char' => __('Please do not use special character and spaces in HTML Variable Name.', 'geodirectory'),
1288
+		'custom_field_unique_name' => __('HTML Variable Name should be a unique name.', 'geodirectory'),
1289
+		'custom_field_delete' => __('Are you wish to delete this field?', 'geodirectory'),
1290
+		//start not show alert msg
1291
+		'tax_meta_class_succ_del_msg' => __('File has been successfully deleted.', 'geodirectory'),
1292
+		'tax_meta_class_not_permission_to_del_msg' => __('You do NOT have permission to delete this file.', 'geodirectory'),
1293
+		'tax_meta_class_order_save_msg' => __('Order saved!', 'geodirectory'),
1294
+		'tax_meta_class_not_permission_record_img_msg' => __('You do not have permission to reorder images.', 'geodirectory'),
1295
+		'address_not_found_on_map_msg' => __('Address not found for:', 'geodirectory'),
1296
+		// end not show alert msg
1297
+		'my_place_listing_del' => __('Are you wish to delete this listing?', 'geodirectory'),
1298
+		//start not show alert msg
1299
+		'rating_error_msg' => __('Error : please retry', 'geodirectory'),
1300
+		'listing_url_prefix_msg' => __('Please enter listing url prefix', 'geodirectory'),
1301
+		'invalid_listing_prefix_msg' => __('Invalid character in listing url prefix', 'geodirectory'),
1302
+		'location_url_prefix_msg' => __('Please enter location url prefix', 'geodirectory'),
1303
+		'invalid_location_prefix_msg' => __('Invalid character in location url prefix', 'geodirectory'),
1304
+		'location_and_cat_url_separator_msg' => __('Please enter location and category url separator', 'geodirectory'),
1305
+		'invalid_char_and_cat_url_separator_msg' => __('Invalid character in location and category url separator', 'geodirectory'),
1306
+		'listing_det_url_separator_msg' => __('Please enter listing detail url separator', 'geodirectory'),
1307
+		'invalid_char_listing_det_url_separator_msg' => __('Invalid character in listing detail url separator', 'geodirectory'),
1308
+		'loading_listing_error_favorite' => __('Error loading listing.', 'geodirectory'),
1309
+		'geodir_field_id_required' => __('This field is required.', 'geodirectory'),
1310
+		'geodir_valid_email_address_msg' => __('Please enter valid email address.', 'geodirectory'),
1311
+		'geodir_default_marker_icon' => $default_marker_icon,
1312
+		'geodir_default_marker_w' => $default_marker_width,
1313
+		'geodir_default_marker_h' => $default_marker_height,
1314
+		'geodir_latitude_error_msg' => GEODIR_LATITUDE_ERROR_MSG,
1315
+		'geodir_longgitude_error_msg' => GEODIR_LOGNGITUDE_ERROR_MSG,
1316
+		'geodir_default_rating_star_icon' => get_option('geodir_default_rating_star_icon'),
1317
+		'gd_cmt_btn_post_reply' => __('Post Reply', 'geodirectory'),
1318
+		'gd_cmt_btn_reply_text' => __('Reply text', 'geodirectory'),
1319
+		'gd_cmt_btn_post_review' => __('Post Review', 'geodirectory'),
1320
+		'gd_cmt_btn_review_text' => __('Review text', 'geodirectory'),
1321
+		'gd_cmt_err_no_rating' => __("Please select star rating, you can't leave a review without stars.", 'geodirectory'),
1322
+		/* on/off dragging for phone devices */
1323
+		'geodir_onoff_dragging' => get_option('geodir_map_onoff_dragging') ? true : false,
1324
+		'geodir_is_mobile' => wp_is_mobile() ? true : false,
1325
+		'geodir_on_dragging_text' => __('Enable Dragging', 'geodirectory'),
1326
+		'geodir_off_dragging_text' => __('Disable Dragging', 'geodirectory'),
1327
+		'geodir_err_max_file_size' => __('File size error : You tried to upload a file over %s', 'geodirectory'),
1328
+		'geodir_err_file_upload_limit' => __('You have reached your upload limit of %s files.', 'geodirectory'),
1329
+		'geodir_err_pkg_upload_limit' => __('You may only upload %s files with this package, please try again.', 'geodirectory'),
1330
+		'geodir_action_remove' => __('Remove', 'geodirectory'),
1331 1331
 		'geodir_txt_all_files' => __('Allowed files', 'geodirectory'),
1332 1332
 		'geodir_err_file_type' => __('File type error. Allowed file types: %s', 'geodirectory'),
1333 1333
 		'gd_allowed_img_types' => !empty($allowed_img_types) ? implode(',', $allowed_img_types) : '',
@@ -1335,29 +1335,29 @@  discard block
 block discarded – undo
1335 1335
 		'geodir_txt_form_searching' => __('Searching...', 'geodirectory'),
1336 1336
 		'fa_rating' => (int)get_option('geodir_reviewrating_enable_font_awesome') == 1 ? 1 : '',
1337 1337
 		'reviewrating' => defined('GEODIRREVIEWRATING_VERSION') ? 1 : '',
1338
-        'geodir_map_name' => geodir_map_name(),
1339
-    );
1340
-
1341
-    /**
1342
-     * Filters the translated JS strings from function geodir_localize_all_js_msg().
1343
-     *
1344
-     * With this filter you can add, remove or change translated JS strings.
1345
-     * You should add your own translations to this if you are building an addon rather than adding another script block.
1346
-     *
1347
-     * @since 1.0.0
1348
-     */
1349
-    $arr_alert_msg = apply_filters('geodir_all_js_msg', $arr_alert_msg);
1350
-
1351
-    foreach ($arr_alert_msg as $key => $value) {
1352
-        if (!is_scalar($value))
1353
-            continue;
1354
-        $arr_alert_msg[$key] = html_entity_decode((string)$value, ENT_QUOTES, 'UTF-8');
1355
-    }
1338
+		'geodir_map_name' => geodir_map_name(),
1339
+	);
1340
+
1341
+	/**
1342
+	 * Filters the translated JS strings from function geodir_localize_all_js_msg().
1343
+	 *
1344
+	 * With this filter you can add, remove or change translated JS strings.
1345
+	 * You should add your own translations to this if you are building an addon rather than adding another script block.
1346
+	 *
1347
+	 * @since 1.0.0
1348
+	 */
1349
+	$arr_alert_msg = apply_filters('geodir_all_js_msg', $arr_alert_msg);
1356 1350
 
1357
-    $script = "var geodir_all_js_msg = " . json_encode($arr_alert_msg) . ';';
1358
-    echo '<script>';
1359
-    echo $script;
1360
-    echo '</script>';
1351
+	foreach ($arr_alert_msg as $key => $value) {
1352
+		if (!is_scalar($value))
1353
+			continue;
1354
+		$arr_alert_msg[$key] = html_entity_decode((string)$value, ENT_QUOTES, 'UTF-8');
1355
+	}
1356
+
1357
+	$script = "var geodir_all_js_msg = " . json_encode($arr_alert_msg) . ';';
1358
+	echo '<script>';
1359
+	echo $script;
1360
+	echo '</script>';
1361 1361
 }
1362 1362
 
1363 1363
 add_action('admin_bar_menu', 'geodir_admin_bar_site_menu', 31);
@@ -1373,9 +1373,9 @@  discard block
 block discarded – undo
1373 1373
  */
1374 1374
 function geodir_admin_bar_site_menu($wp_admin_bar)
1375 1375
 {
1376
-    if (get_option("geodir_installed")) {
1377
-        $wp_admin_bar->add_menu(array('parent' => 'appearance', 'id' => 'geodirectory', 'title' => __('GeoDirectory', 'geodirectory'), 'href' => admin_url('?page=geodirectory')));
1378
-    }
1376
+	if (get_option("geodir_installed")) {
1377
+		$wp_admin_bar->add_menu(array('parent' => 'appearance', 'id' => 'geodirectory', 'title' => __('GeoDirectory', 'geodirectory'), 'href' => admin_url('?page=geodirectory')));
1378
+	}
1379 1379
 }
1380 1380
 
1381 1381
 add_action('geodir_before_listing', 'geodir_display_sort_options'); /*function in custom_functions.php*/
@@ -1401,25 +1401,25 @@  discard block
 block discarded – undo
1401 1401
  */
1402 1402
 function geodir_store_sidebars()
1403 1403
 {
1404
-    global $geodir_sidebars;
1405
-    global $sidebars_widgets;
1406
-
1407
-    if (!is_array($sidebars_widgets))
1408
-        $sidebars_widgets = wp_get_sidebars_widgets();
1409
-    $geodir_old_sidebars = array();
1410
-
1411
-    if (is_array($geodir_sidebars)) {
1412
-        foreach ($geodir_sidebars as $val) {
1413
-            if (is_array($sidebars_widgets)) {
1414
-                if (array_key_exists($val, $sidebars_widgets))
1415
-                    $geodir_old_sidebars[$val] = $sidebars_widgets[$val];
1416
-                else
1417
-                    $geodir_old_sidebars[$val] = array();
1418
-            }
1419
-        }
1420
-    }
1421
-    update_option('geodir_sidebars', $geodir_old_sidebars);
1422
-    geodir_option_version_backup('geodir_sidebars');
1404
+	global $geodir_sidebars;
1405
+	global $sidebars_widgets;
1406
+
1407
+	if (!is_array($sidebars_widgets))
1408
+		$sidebars_widgets = wp_get_sidebars_widgets();
1409
+	$geodir_old_sidebars = array();
1410
+
1411
+	if (is_array($geodir_sidebars)) {
1412
+		foreach ($geodir_sidebars as $val) {
1413
+			if (is_array($sidebars_widgets)) {
1414
+				if (array_key_exists($val, $sidebars_widgets))
1415
+					$geodir_old_sidebars[$val] = $sidebars_widgets[$val];
1416
+				else
1417
+					$geodir_old_sidebars[$val] = array();
1418
+			}
1419
+		}
1420
+	}
1421
+	update_option('geodir_sidebars', $geodir_old_sidebars);
1422
+	geodir_option_version_backup('geodir_sidebars');
1423 1423
 
1424 1424
 }
1425 1425
 
@@ -1433,34 +1433,34 @@  discard block
 block discarded – undo
1433 1433
  */
1434 1434
 function geodir_restore_sidebars()
1435 1435
 {
1436
-    global $sidebars_widgets;
1437
-
1438
-    if (!is_array($sidebars_widgets))
1439
-        $sidebars_widgets = wp_get_sidebars_widgets();
1440
-
1441
-    if (is_array($sidebars_widgets)) {
1442
-        $geodir_old_sidebars = get_option('geodir_sidebars');
1443
-        if (is_array($geodir_old_sidebars)) {
1444
-            foreach ($geodir_old_sidebars as $key => $val) {
1445
-                //if(array_key_exists($key, $sidebars_widgets))
1446
-                {
1447
-                    $sidebars_widgets[$key] = $geodir_old_sidebars[$key];
1448
-                }
1436
+	global $sidebars_widgets;
1449 1437
 
1438
+	if (!is_array($sidebars_widgets))
1439
+		$sidebars_widgets = wp_get_sidebars_widgets();
1450 1440
 
1451
-            }
1452
-        }
1441
+	if (is_array($sidebars_widgets)) {
1442
+		$geodir_old_sidebars = get_option('geodir_sidebars');
1443
+		if (is_array($geodir_old_sidebars)) {
1444
+			foreach ($geodir_old_sidebars as $key => $val) {
1445
+				//if(array_key_exists($key, $sidebars_widgets))
1446
+				{
1447
+					$sidebars_widgets[$key] = $geodir_old_sidebars[$key];
1448
+				}
1453 1449
 
1454
-        // now clear all non geodiretory sidebars 
1455
-        foreach ($sidebars_widgets as $key => $val) {
1456
-            if (!array_key_exists($key, $geodir_old_sidebars)) {
1457
-                $sidebars_widgets[$key] = array();
1458
-            }
1459
-        }
1460
-    }
1461 1450
 
1462
-    update_option('sidebars_widgets', $sidebars_widgets);
1463
-    update_option('geodir_sidebars', '');
1451
+			}
1452
+		}
1453
+
1454
+		// now clear all non geodiretory sidebars 
1455
+		foreach ($sidebars_widgets as $key => $val) {
1456
+			if (!array_key_exists($key, $geodir_old_sidebars)) {
1457
+				$sidebars_widgets[$key] = array();
1458
+			}
1459
+		}
1460
+	}
1461
+
1462
+	update_option('sidebars_widgets', $sidebars_widgets);
1463
+	update_option('geodir_sidebars', '');
1464 1464
 }
1465 1465
 
1466 1466
 add_action('geodir_after_listing_post_gridview', 'geodir_after_listing_post_gridview');
@@ -1473,9 +1473,9 @@  discard block
 block discarded – undo
1473 1473
  */
1474 1474
 function geodir_after_listing_post_gridview()
1475 1475
 {
1476
-    global $gridview_columns;
1476
+	global $gridview_columns;
1477 1477
 
1478
-    $gridview_columns = '';
1478
+	$gridview_columns = '';
1479 1479
 
1480 1480
 }
1481 1481
 
@@ -1503,11 +1503,11 @@  discard block
 block discarded – undo
1503 1503
  */
1504 1504
 function so_handle_038($url, $original_url, $_context)
1505 1505
 {
1506
-    if (strstr($url, "maps.google.com/maps/api/js") !== false) {
1507
-        $url = str_replace("&#038;", "&amp;", $url); // or $url = $original_url
1508
-    }
1506
+	if (strstr($url, "maps.google.com/maps/api/js") !== false) {
1507
+		$url = str_replace("&#038;", "&amp;", $url); // or $url = $original_url
1508
+	}
1509 1509
 
1510
-    return $url;
1510
+	return $url;
1511 1511
 }
1512 1512
 
1513 1513
 
@@ -1523,34 +1523,34 @@  discard block
 block discarded – undo
1523 1523
 function geodir_after_main_form_fields() {
1524 1524
 	global $gd_session;
1525 1525
 	
1526
-    if (get_option('geodir_accept_term_condition')) {
1527
-        global $post;
1528
-        $term_condition = '';
1529
-        if (isset($_REQUEST['backandedit'])) {
1530
-            $post = (object)$gd_session->get('listing');
1531
-            $term_condition = isset($post->geodir_accept_term_condition) ? $post->geodir_accept_term_condition : '';
1532
-        }
1533
-
1534
-        ?>
1526
+	if (get_option('geodir_accept_term_condition')) {
1527
+		global $post;
1528
+		$term_condition = '';
1529
+		if (isset($_REQUEST['backandedit'])) {
1530
+			$post = (object)$gd_session->get('listing');
1531
+			$term_condition = isset($post->geodir_accept_term_condition) ? $post->geodir_accept_term_condition : '';
1532
+		}
1533
+
1534
+		?>
1535 1535
         <div id="geodir_accept_term_condition_row" class="required_field geodir_form_row clearfix">
1536 1536
             <label>&nbsp;</label>
1537 1537
 
1538 1538
             <div class="geodir_taxonomy_field" style="float:left; width:70%;">
1539 1539
 				<span style="display:block"> 
1540 1540
 				<input class="main_list_selecter" type="checkbox" <?php if ($term_condition == '1') {
1541
-                    echo 'checked="checked"';
1542
-                } ?> field_type="checkbox" name="geodir_accept_term_condition" id="geodir_accept_term_condition"
1541
+					echo 'checked="checked"';
1542
+				} ?> field_type="checkbox" name="geodir_accept_term_condition" id="geodir_accept_term_condition"
1543 1543
                        class="geodir_textfield" value="1"
1544 1544
                        style="display:inline-block"/><a href="<?php $terms_page = get_option('geodir_term_condition_page'); if($terms_page){ echo get_permalink($terms_page);}?>" target="_blank"><?php _e('Please accept our terms and conditions', 'geodirectory'); ?></a>
1545 1545
 				</span>
1546 1546
             </div>
1547 1547
             <span class="geodir_message_error"><?php if (isset($required_msg)) {
1548
-                    _e($required_msg, 'geodirectory');
1549
-                } ?></span>
1548
+					_e($required_msg, 'geodirectory');
1549
+				} ?></span>
1550 1550
         </div>
1551 1551
     <?php
1552 1552
 
1553
-    }
1553
+	}
1554 1554
 }
1555 1555
 
1556 1556
 
@@ -1575,42 +1575,42 @@  discard block
 block discarded – undo
1575 1575
  */
1576 1576
 function geodir_detail_page_tab_is_display($is_display, $tab)
1577 1577
 {
1578
-    global $post, $post_images, $video, $special_offers, $related_listing, $geodir_post_detail_fields;
1578
+	global $post, $post_images, $video, $special_offers, $related_listing, $geodir_post_detail_fields;
1579 1579
 
1580
-    if ($tab == 'post_profile') {
1581
-        /** This action is documented in geodirectory_template_actions.php */
1582
-        $desc_limit = apply_filters('geodir_description_field_desc_limit', '');
1580
+	if ($tab == 'post_profile') {
1581
+		/** This action is documented in geodirectory_template_actions.php */
1582
+		$desc_limit = apply_filters('geodir_description_field_desc_limit', '');
1583 1583
         
1584
-        if (!($desc_limit === '' || (int)$desc_limit > 0)) {
1585
-            $is_display = false;
1586
-        }
1587
-    }
1584
+		if (!($desc_limit === '' || (int)$desc_limit > 0)) {
1585
+			$is_display = false;
1586
+		}
1587
+	}
1588 1588
     
1589
-    if ($tab == 'post_info')
1590
-        $is_display = (!empty($geodir_post_detail_fields)) ? true : false;
1589
+	if ($tab == 'post_info')
1590
+		$is_display = (!empty($geodir_post_detail_fields)) ? true : false;
1591 1591
 
1592
-    if ($tab == 'post_images')
1593
-        $is_display = (!empty($post_images)) ? true : false;
1592
+	if ($tab == 'post_images')
1593
+		$is_display = (!empty($post_images)) ? true : false;
1594 1594
 
1595
-    if ($tab == 'post_video')
1596
-        $is_display = (!empty($video)) ? true : false;
1595
+	if ($tab == 'post_video')
1596
+		$is_display = (!empty($video)) ? true : false;
1597 1597
 
1598
-    if ($tab == 'special_offers')
1599
-        $is_display = (!empty($special_offers)) ? true : false;
1598
+	if ($tab == 'special_offers')
1599
+		$is_display = (!empty($special_offers)) ? true : false;
1600 1600
 
1601
-    if ($tab == 'reviews')
1602
-        $is_display = (geodir_is_page('detail')) ? true : false;
1601
+	if ($tab == 'reviews')
1602
+		$is_display = (geodir_is_page('detail')) ? true : false;
1603 1603
 
1604
-    if ($tab == 'related_listing') {
1605
-       $message = __('No listings found which match your selection.', 'geodirectory');
1604
+	if ($tab == 'related_listing') {
1605
+	   $message = __('No listings found which match your selection.', 'geodirectory');
1606 1606
        
1607
-       /** This action is documented in geodirectory-functions/template_functions.php */
1608
-       $message = apply_filters('geodir_message_listing_not_found', $message, 'listing-listview', false);
1607
+	   /** This action is documented in geodirectory-functions/template_functions.php */
1608
+	   $message = apply_filters('geodir_message_listing_not_found', $message, 'listing-listview', false);
1609 1609
        
1610
-       $is_display = ((strpos($related_listing, $message) !== false || $related_listing == '' || !geodir_is_page('detail'))) ? false : true;
1611
-    }
1610
+	   $is_display = ((strpos($related_listing, $message) !== false || $related_listing == '' || !geodir_is_page('detail'))) ? false : true;
1611
+	}
1612 1612
 
1613
-    return $is_display;
1613
+	return $is_display;
1614 1614
 }
1615 1615
 
1616 1616
 
@@ -1626,69 +1626,69 @@  discard block
 block discarded – undo
1626 1626
  * @global string $plugin_prefix Geodirectory plugin table prefix.
1627 1627
  */
1628 1628
 function geodir_changes_in_custom_fields_table() {
1629
-    global $wpdb, $plugin_prefix;
1629
+	global $wpdb, $plugin_prefix;
1630 1630
 	
1631 1631
 	// Remove unused virtual page
1632 1632
 	$listings_page_id = (int)get_option('geodir_listing_page');
1633 1633
 	if ($listings_page_id) {
1634 1634
 		$wpdb->query($wpdb->prepare("DELETE FROM " . $wpdb->posts . " WHERE ID=%d AND post_name = %s AND post_type=%s", array($listings_page_id, 'listings', 'page')));
1635
-        delete_option('geodir_listing_page');
1635
+		delete_option('geodir_listing_page');
1636 1636
 	}
1637 1637
 
1638
-    if (!get_option('geodir_changes_in_custom_fields_table')) {
1639
-        $wpdb->query(
1640
-            $wpdb->prepare(
1641
-                "UPDATE " . GEODIR_CUSTOM_FIELDS_TABLE . " SET is_default=%s, is_admin=%s WHERE is_default=%s",
1642
-                array('1', '1', 'admin')
1643
-            )
1644
-        );
1638
+	if (!get_option('geodir_changes_in_custom_fields_table')) {
1639
+		$wpdb->query(
1640
+			$wpdb->prepare(
1641
+				"UPDATE " . GEODIR_CUSTOM_FIELDS_TABLE . " SET is_default=%s, is_admin=%s WHERE is_default=%s",
1642
+				array('1', '1', 'admin')
1643
+			)
1644
+		);
1645 1645
 
1646 1646
 
1647
-        /* --- terms meta value set --- */
1647
+		/* --- terms meta value set --- */
1648 1648
 
1649
-        update_option('geodir_default_marker_icon', geodir_plugin_url() . '/geodirectory-functions/map-functions/icons/pin.png');
1649
+		update_option('geodir_default_marker_icon', geodir_plugin_url() . '/geodirectory-functions/map-functions/icons/pin.png');
1650 1650
 
1651
-        $options_data = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "options WHERE option_name LIKE %s", array('%tax_meta_%')));
1651
+		$options_data = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "options WHERE option_name LIKE %s", array('%tax_meta_%')));
1652 1652
 
1653
-        if (!empty($options_data)) {
1653
+		if (!empty($options_data)) {
1654 1654
 
1655
-            foreach ($options_data as $optobj) {
1655
+			foreach ($options_data as $optobj) {
1656 1656
 
1657
-                $option_val = str_replace('tax_meta_', '', $optobj->option_name);
1657
+				$option_val = str_replace('tax_meta_', '', $optobj->option_name);
1658 1658
 
1659
-                $taxonomies_data = $wpdb->get_results($wpdb->prepare("SELECT taxonomy FROM " . $wpdb->prefix . "term_taxonomy WHERE taxonomy LIKE %s AND term_id=%d", array('%category%', $option_val)));
1659
+				$taxonomies_data = $wpdb->get_results($wpdb->prepare("SELECT taxonomy FROM " . $wpdb->prefix . "term_taxonomy WHERE taxonomy LIKE %s AND term_id=%d", array('%category%', $option_val)));
1660 1660
 
1661
-                if (!empty($taxonomies_data)) {
1661
+				if (!empty($taxonomies_data)) {
1662 1662
 
1663
-                    foreach ($taxonomies_data as $taxobj) {
1663
+					foreach ($taxonomies_data as $taxobj) {
1664 1664
 
1665
-                        $taxObject = get_taxonomy($taxobj->taxonomy);
1666
-                        $post_type = $taxObject->object_type[0];
1665
+						$taxObject = get_taxonomy($taxobj->taxonomy);
1666
+						$post_type = $taxObject->object_type[0];
1667 1667
 
1668
-                        $opt_value = 'tax_meta_' . $post_type . '_' . $option_val;
1668
+						$opt_value = 'tax_meta_' . $post_type . '_' . $option_val;
1669 1669
 
1670
-                        $duplicate_data = $wpdb->get_var($wpdb->prepare("SELECT option_id FROM " . $wpdb->prefix . "options WHERE option_name=%s", array('tax_meta_' . $option_val)));
1670
+						$duplicate_data = $wpdb->get_var($wpdb->prepare("SELECT option_id FROM " . $wpdb->prefix . "options WHERE option_name=%s", array('tax_meta_' . $option_val)));
1671 1671
 
1672
-                        if ($duplicate_data) {
1672
+						if ($duplicate_data) {
1673 1673
 
1674
-                            $wpdb->query($wpdb->prepare("UPDATE " . $wpdb->prefix . "options SET	option_name=%s WHERE option_id=%d", array($opt_value, $optobj->option_id)));
1674
+							$wpdb->query($wpdb->prepare("UPDATE " . $wpdb->prefix . "options SET	option_name=%s WHERE option_id=%d", array($opt_value, $optobj->option_id)));
1675 1675
 
1676
-                        } else {
1676
+						} else {
1677 1677
 
1678
-                            $wpdb->query($wpdb->prepare("INSERT INTO " . $wpdb->prefix . "options (option_name,option_value,autoload) VALUES (%s, %s, %s)", array($opt_value, $optobj->option_value, $optobj->autoload)));
1678
+							$wpdb->query($wpdb->prepare("INSERT INTO " . $wpdb->prefix . "options (option_name,option_value,autoload) VALUES (%s, %s, %s)", array($opt_value, $optobj->option_value, $optobj->autoload)));
1679 1679
 
1680
-                        }
1680
+						}
1681 1681
 
1682
-                    }
1682
+					}
1683 1683
 
1684
-                }
1684
+				}
1685 1685
 
1686
-            }
1687
-        }
1686
+			}
1687
+		}
1688 1688
 
1689
-        update_option('geodir_changes_in_custom_fields_table', '1');
1689
+		update_option('geodir_changes_in_custom_fields_table', '1');
1690 1690
 
1691
-    }
1691
+	}
1692 1692
 
1693 1693
 }
1694 1694
 
@@ -1707,24 +1707,24 @@  discard block
 block discarded – undo
1707 1707
 function geodir_location_slug_check($slug)
1708 1708
 {
1709 1709
 
1710
-    global $wpdb, $table_prefix;
1710
+	global $wpdb, $table_prefix;
1711 1711
 
1712
-    $slug_exists = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($slug)));
1712
+	$slug_exists = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($slug)));
1713 1713
 
1714
-    if ($slug_exists) {
1714
+	if ($slug_exists) {
1715 1715
 
1716
-        $suffix = 1;
1717
-        do {
1718
-            $alt_location_name = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix";
1719
-            $location_slug_check = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($alt_location_name)));
1720
-            $suffix++;
1721
-        } while ($location_slug_check && $suffix < 100);
1716
+		$suffix = 1;
1717
+		do {
1718
+			$alt_location_name = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix";
1719
+			$location_slug_check = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($alt_location_name)));
1720
+			$suffix++;
1721
+		} while ($location_slug_check && $suffix < 100);
1722 1722
 
1723
-        $slug = $alt_location_name;
1723
+		$slug = $alt_location_name;
1724 1724
 
1725
-    }
1725
+	}
1726 1726
 
1727
-    return $slug;
1727
+	return $slug;
1728 1728
 
1729 1729
 }
1730 1730
 
@@ -1749,42 +1749,42 @@  discard block
 block discarded – undo
1749 1749
 function geodir_update_term_slug($term_id, $tt_id, $taxonomy)
1750 1750
 {
1751 1751
 
1752
-    global $wpdb, $plugin_prefix, $table_prefix;
1752
+	global $wpdb, $plugin_prefix, $table_prefix;
1753 1753
 
1754
-    $tern_data = get_term_by('id', $term_id, $taxonomy);
1754
+	$tern_data = get_term_by('id', $term_id, $taxonomy);
1755 1755
 
1756
-    $slug = $tern_data->slug;
1756
+	$slug = $tern_data->slug;
1757 1757
 
1758
-    /**
1759
-     * Filter if a term slug exists.
1760
-     *
1761
-     * @since 1.0.0
1762
-     * @package GeoDirectory
1763
-     * @param bool $bool Default: false.
1764
-     * @param string $slug The term slug.
1765
-     * @param int $term_id The term ID.
1766
-     */
1767
-    $slug_exists = apply_filters('geodir_term_slug_is_exists', false, $slug, $term_id);
1758
+	/**
1759
+	 * Filter if a term slug exists.
1760
+	 *
1761
+	 * @since 1.0.0
1762
+	 * @package GeoDirectory
1763
+	 * @param bool $bool Default: false.
1764
+	 * @param string $slug The term slug.
1765
+	 * @param int $term_id The term ID.
1766
+	 */
1767
+	$slug_exists = apply_filters('geodir_term_slug_is_exists', false, $slug, $term_id);
1768 1768
 
1769
-    if ($slug_exists) {
1769
+	if ($slug_exists) {
1770 1770
 
1771
-        $suffix = 1;
1772
-        do {
1773
-            $new_slug = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix";
1771
+		$suffix = 1;
1772
+		do {
1773
+			$new_slug = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix";
1774 1774
 
1775
-            /** This action is documented in geodirectory_hooks_actions.php */
1776
-            $term_slug_check = apply_filters('geodir_term_slug_is_exists', false, $new_slug, $term_id);
1775
+			/** This action is documented in geodirectory_hooks_actions.php */
1776
+			$term_slug_check = apply_filters('geodir_term_slug_is_exists', false, $new_slug, $term_id);
1777 1777
 
1778
-            $suffix++;
1779
-        } while ($term_slug_check && $suffix < 100);
1778
+			$suffix++;
1779
+		} while ($term_slug_check && $suffix < 100);
1780 1780
 
1781
-        $slug = $new_slug;
1781
+		$slug = $new_slug;
1782 1782
 
1783
-        //wp_update_term( $term_id, $taxonomy, array('slug' => $slug) );
1783
+		//wp_update_term( $term_id, $taxonomy, array('slug' => $slug) );
1784 1784
 
1785
-        $wpdb->query($wpdb->prepare("UPDATE " . $table_prefix . "terms SET slug=%s WHERE term_id=%d", array($slug, $term_id)));
1785
+		$wpdb->query($wpdb->prepare("UPDATE " . $table_prefix . "terms SET slug=%s WHERE term_id=%d", array($slug, $term_id)));
1786 1786
 
1787
-    }
1787
+	}
1788 1788
 	
1789 1789
 	// Update tag in detail table.
1790 1790
 	$taxonomy_obj = get_taxonomy($taxonomy);
@@ -1825,21 +1825,21 @@  discard block
 block discarded – undo
1825 1825
 function geodir_term_slug_is_exists($slug_exists, $slug, $term_id)
1826 1826
 {
1827 1827
 
1828
-    global $wpdb, $table_prefix;
1828
+	global $wpdb, $table_prefix;
1829 1829
 
1830
-    $default_location = geodir_get_default_location();
1830
+	$default_location = geodir_get_default_location();
1831 1831
 
1832
-    $country_slug = $default_location->country_slug;
1833
-    $region_slug = $default_location->region_slug;
1834
-    $city_slug = $default_location->city_slug;
1832
+	$country_slug = $default_location->country_slug;
1833
+	$region_slug = $default_location->region_slug;
1834
+	$city_slug = $default_location->city_slug;
1835 1835
 
1836
-    if ($country_slug == $slug || $region_slug == $slug || $city_slug == $slug)
1837
-        return $slug_exists = true;
1836
+	if ($country_slug == $slug || $region_slug == $slug || $city_slug == $slug)
1837
+		return $slug_exists = true;
1838 1838
 
1839
-    if ($wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s AND term_id != %d", array($slug, $term_id))))
1840
-        return $slug_exists = true;
1839
+	if ($wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s AND term_id != %d", array($slug, $term_id))))
1840
+		return $slug_exists = true;
1841 1841
 
1842
-    return $slug_exists;
1842
+	return $slug_exists;
1843 1843
 }
1844 1844
 
1845 1845
 
@@ -1858,75 +1858,75 @@  discard block
 block discarded – undo
1858 1858
  */
1859 1859
 function geodir_custom_page_title($title = '', $sep = '')
1860 1860
 {
1861
-    global $wp;
1862
-    if (class_exists('WPSEO_Frontend') || class_exists('All_in_One_SEO_Pack')) {
1863
-        return $title;
1864
-    }
1861
+	global $wp;
1862
+	if (class_exists('WPSEO_Frontend') || class_exists('All_in_One_SEO_Pack')) {
1863
+		return $title;
1864
+	}
1865 1865
 
1866
-    if ($sep == '') {
1867
-        /**
1868
-         * Filter the page title separator.
1869
-         *
1870
-         * @since 1.0.0
1871
-         * @package GeoDirectory
1872
-         * @param string $sep The separator, default: `|`.
1873
-         */
1874
-        $sep = apply_filters('geodir_page_title_separator', '|');
1875
-    }
1866
+	if ($sep == '') {
1867
+		/**
1868
+		 * Filter the page title separator.
1869
+		 *
1870
+		 * @since 1.0.0
1871
+		 * @package GeoDirectory
1872
+		 * @param string $sep The separator, default: `|`.
1873
+		 */
1874
+		$sep = apply_filters('geodir_page_title_separator', '|');
1875
+	}
1876 1876
 
1877 1877
 
1878
-    $gd_page = '';
1879
-    if(geodir_is_page('home')){
1880
-        $gd_page = 'home';
1881
-        $title = (get_option('geodir_meta_title_homepage')) ? get_option('geodir_meta_title_homepage') : $title;
1882
-    }
1883
-    elseif(geodir_is_page('detail')){
1884
-        $gd_page = 'detail';
1885
-        $title = (get_option('geodir_meta_title_detail')) ? get_option('geodir_meta_title_detail') : $title;
1886
-    }
1887
-    elseif(geodir_is_page('pt')){
1888
-        $gd_page = 'pt';
1889
-        $title = (get_option('geodir_meta_title_pt')) ? get_option('geodir_meta_title_pt') : $title;
1890
-    }
1891
-    elseif(geodir_is_page('listing')){
1892
-        $gd_page = 'listing';
1893
-        $title = (get_option('geodir_meta_title_listing')) ? get_option('geodir_meta_title_listing') : $title;
1894
-    }
1895
-    elseif(geodir_is_page('location')){
1896
-        $gd_page = 'location';
1897
-        $title = (get_option('geodir_meta_title_location')) ? get_option('geodir_meta_title_location') : $title;
1898
-    }
1899
-    elseif(geodir_is_page('search')){
1900
-        $gd_page = 'search';
1901
-        $title = (get_option('geodir_meta_title_search')) ? get_option('geodir_meta_title_search') : $title;
1902
-    }
1903
-    elseif(geodir_is_page('add-listing')){
1904
-        $gd_page = 'add-listing';
1905
-        $title = (get_option('geodir_meta_title_add-listing')) ? get_option('geodir_meta_title_add-listing') : $title;
1906
-    }
1907
-    elseif(geodir_is_page('author')){
1908
-        $gd_page = 'author';
1909
-        $title = (get_option('geodir_meta_title_author')) ? get_option('geodir_meta_title_author') : $title;
1910
-    }
1911
-    elseif(geodir_is_page('login')){
1912
-        $gd_page = 'login';
1913
-        $title = (get_option('geodir_meta_title_login')) ? get_option('geodir_meta_title_login') : $title;
1914
-    }
1915
-    elseif(geodir_is_page('listing-success')){
1916
-        $gd_page = 'listing-success';
1917
-        $title = (get_option('geodir_meta_title_listing-success')) ? get_option('geodir_meta_title_listing-success') : $title;
1918
-    }
1878
+	$gd_page = '';
1879
+	if(geodir_is_page('home')){
1880
+		$gd_page = 'home';
1881
+		$title = (get_option('geodir_meta_title_homepage')) ? get_option('geodir_meta_title_homepage') : $title;
1882
+	}
1883
+	elseif(geodir_is_page('detail')){
1884
+		$gd_page = 'detail';
1885
+		$title = (get_option('geodir_meta_title_detail')) ? get_option('geodir_meta_title_detail') : $title;
1886
+	}
1887
+	elseif(geodir_is_page('pt')){
1888
+		$gd_page = 'pt';
1889
+		$title = (get_option('geodir_meta_title_pt')) ? get_option('geodir_meta_title_pt') : $title;
1890
+	}
1891
+	elseif(geodir_is_page('listing')){
1892
+		$gd_page = 'listing';
1893
+		$title = (get_option('geodir_meta_title_listing')) ? get_option('geodir_meta_title_listing') : $title;
1894
+	}
1895
+	elseif(geodir_is_page('location')){
1896
+		$gd_page = 'location';
1897
+		$title = (get_option('geodir_meta_title_location')) ? get_option('geodir_meta_title_location') : $title;
1898
+	}
1899
+	elseif(geodir_is_page('search')){
1900
+		$gd_page = 'search';
1901
+		$title = (get_option('geodir_meta_title_search')) ? get_option('geodir_meta_title_search') : $title;
1902
+	}
1903
+	elseif(geodir_is_page('add-listing')){
1904
+		$gd_page = 'add-listing';
1905
+		$title = (get_option('geodir_meta_title_add-listing')) ? get_option('geodir_meta_title_add-listing') : $title;
1906
+	}
1907
+	elseif(geodir_is_page('author')){
1908
+		$gd_page = 'author';
1909
+		$title = (get_option('geodir_meta_title_author')) ? get_option('geodir_meta_title_author') : $title;
1910
+	}
1911
+	elseif(geodir_is_page('login')){
1912
+		$gd_page = 'login';
1913
+		$title = (get_option('geodir_meta_title_login')) ? get_option('geodir_meta_title_login') : $title;
1914
+	}
1915
+	elseif(geodir_is_page('listing-success')){
1916
+		$gd_page = 'listing-success';
1917
+		$title = (get_option('geodir_meta_title_listing-success')) ? get_option('geodir_meta_title_listing-success') : $title;
1918
+	}
1919 1919
 
1920 1920
 
1921
-    /**
1922
-     * Filter page meta title to replace variables.
1923
-     *
1924
-     * @since 1.5.4
1925
-     * @param string $title The page title including variables.
1926
-     * @param string $gd_page The GeoDirectory page type if any.
1927
-     * @param string $sep The title separator symbol.
1928
-     */
1929
-    return apply_filters('geodir_seo_meta_title', __($title, 'geodirectory'), $gd_page, $sep);
1921
+	/**
1922
+	 * Filter page meta title to replace variables.
1923
+	 *
1924
+	 * @since 1.5.4
1925
+	 * @param string $title The page title including variables.
1926
+	 * @param string $gd_page The GeoDirectory page type if any.
1927
+	 * @param string $sep The title separator symbol.
1928
+	 */
1929
+	return apply_filters('geodir_seo_meta_title', __($title, 'geodirectory'), $gd_page, $sep);
1930 1930
 
1931 1931
 }
1932 1932
 
@@ -1942,33 +1942,33 @@  discard block
 block discarded – undo
1942 1942
 function geodir_set_post_attachment()
1943 1943
 {
1944 1944
 
1945
-    if (!get_option('geodir_set_post_attachments')) {
1945
+	if (!get_option('geodir_set_post_attachments')) {
1946 1946
 
1947
-        require_once(ABSPATH . 'wp-admin/includes/image.php');
1948
-        require_once(ABSPATH . 'wp-admin/includes/file.php');
1947
+		require_once(ABSPATH . 'wp-admin/includes/image.php');
1948
+		require_once(ABSPATH . 'wp-admin/includes/file.php');
1949 1949
 
1950
-        $all_postypes = geodir_get_posttypes();
1950
+		$all_postypes = geodir_get_posttypes();
1951 1951
 
1952
-        $args = array(
1953
-            'posts_per_page' => -1,
1954
-            'post_type' => $all_postypes,
1955
-            'post_status' => 'publish');
1952
+		$args = array(
1953
+			'posts_per_page' => -1,
1954
+			'post_type' => $all_postypes,
1955
+			'post_status' => 'publish');
1956 1956
 
1957
-        $posts_array = get_posts($args);
1957
+		$posts_array = get_posts($args);
1958 1958
 
1959
-        if (!empty($posts_array)) {
1959
+		if (!empty($posts_array)) {
1960 1960
 
1961
-            foreach ($posts_array as $post) {
1961
+			foreach ($posts_array as $post) {
1962 1962
 
1963
-                geodir_set_wp_featured_image($post->ID);
1963
+				geodir_set_wp_featured_image($post->ID);
1964 1964
 
1965
-            }
1965
+			}
1966 1966
 
1967
-        }
1967
+		}
1968 1968
 
1969
-        update_option('geodir_set_post_attachments', '1');
1969
+		update_option('geodir_set_post_attachments', '1');
1970 1970
 
1971
-    }
1971
+	}
1972 1972
 
1973 1973
 }
1974 1974
 
@@ -1985,19 +1985,19 @@  discard block
 block discarded – undo
1985 1985
 function geodir_remove_url_seperator()
1986 1986
 {
1987 1987
 
1988
-    if (!get_option('geodir_remove_url_seperator')) {
1988
+	if (!get_option('geodir_remove_url_seperator')) {
1989 1989
 
1990
-        if (get_option('geodir_listingurl_separator'))
1991
-            delete_option('geodir_listingurl_separator');
1990
+		if (get_option('geodir_listingurl_separator'))
1991
+			delete_option('geodir_listingurl_separator');
1992 1992
 
1993
-        if (get_option('geodir_detailurl_separator'))
1994
-            delete_option('geodir_detailurl_separator');
1993
+		if (get_option('geodir_detailurl_separator'))
1994
+			delete_option('geodir_detailurl_separator');
1995 1995
 
1996
-        flush_rewrite_rules(false);
1996
+		flush_rewrite_rules(false);
1997 1997
 
1998
-        update_option('geodir_remove_url_seperator', '1');
1998
+		update_option('geodir_remove_url_seperator', '1');
1999 1999
 
2000
-    }
2000
+	}
2001 2001
 
2002 2002
 }
2003 2003
 
@@ -2013,19 +2013,19 @@  discard block
 block discarded – undo
2013 2013
  */
2014 2014
 function geodir_remove_url_seperator_form_permalink_settings($permalink_arr)
2015 2015
 {
2016
-    foreach ($permalink_arr as $key => $value) {
2016
+	foreach ($permalink_arr as $key => $value) {
2017 2017
 
2018
-        if ($value['id'] == 'geodir_listingurl_separator' || $value['id'] == 'geodir_detailurl_separator')
2019
-            unset($permalink_arr[$key]);
2018
+		if ($value['id'] == 'geodir_listingurl_separator' || $value['id'] == 'geodir_detailurl_separator')
2019
+			unset($permalink_arr[$key]);
2020 2020
 
2021
-    }
2021
+	}
2022 2022
 
2023
-    return $permalink_arr;
2023
+	return $permalink_arr;
2024 2024
 
2025 2025
 }
2026 2026
 
2027 2027
 if (!is_admin()) {
2028
-    add_filter('posts_results', 'geodir_set_status_draft_to_publish_for_own_post');
2028
+	add_filter('posts_results', 'geodir_set_status_draft_to_publish_for_own_post');
2029 2029
 }
2030 2030
 /**
2031 2031
  * Set status from draft to publish.
@@ -2038,13 +2038,13 @@  discard block
 block discarded – undo
2038 2038
  */
2039 2039
 function geodir_set_status_draft_to_publish_for_own_post($post)
2040 2040
 {
2041
-    global $wp;
2042
-    $user_id = get_current_user_id();
2041
+	global $wp;
2042
+	$user_id = get_current_user_id();
2043 2043
 
2044
-    if (!empty($post) && $post[0]->post_author == $user_id) {
2045
-        $post[0]->post_status = 'publish';
2046
-    }
2047
-    return $post;
2044
+	if (!empty($post) && $post[0]->post_author == $user_id) {
2045
+		$post[0]->post_status = 'publish';
2046
+	}
2047
+	return $post;
2048 2048
 }
2049 2049
 
2050 2050
 
@@ -2136,33 +2136,33 @@  discard block
 block discarded – undo
2136 2136
  */
2137 2137
 function geodir_detail_page_tab_headings_change($tabs_arr)
2138 2138
 {
2139
-    global $wpdb;
2139
+	global $wpdb;
2140 2140
 
2141
-    $post_type = geodir_get_current_posttype();
2141
+	$post_type = geodir_get_current_posttype();
2142 2142
 
2143
-    $all_postypes = geodir_get_posttypes();
2143
+	$all_postypes = geodir_get_posttypes();
2144 2144
 
2145
-    if (!empty($tabs_arr) && $post_type != '' && in_array($post_type, $all_postypes)) {
2145
+	if (!empty($tabs_arr) && $post_type != '' && in_array($post_type, $all_postypes)) {
2146 2146
 
2147
-        if (array_key_exists('post_video', $tabs_arr)) {
2147
+		if (array_key_exists('post_video', $tabs_arr)) {
2148 2148
 
2149
-            $field_title = $wpdb->get_var($wpdb->prepare("select site_title from " . GEODIR_CUSTOM_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s ", array('geodir_video', $post_type)));
2149
+			$field_title = $wpdb->get_var($wpdb->prepare("select site_title from " . GEODIR_CUSTOM_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s ", array('geodir_video', $post_type)));
2150 2150
 
2151
-            if (isset($tabs_arr['post_video']['heading_text']) && $field_title != '')
2152
-                $tabs_arr['post_video']['heading_text'] = $field_title;
2153
-        }
2151
+			if (isset($tabs_arr['post_video']['heading_text']) && $field_title != '')
2152
+				$tabs_arr['post_video']['heading_text'] = $field_title;
2153
+		}
2154 2154
 
2155
-        if (array_key_exists('special_offers', $tabs_arr)) {
2155
+		if (array_key_exists('special_offers', $tabs_arr)) {
2156 2156
 
2157
-            $field_title = $wpdb->get_var($wpdb->prepare("select site_title from " . GEODIR_CUSTOM_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s ", array('geodir_special_offers', $post_type)));
2157
+			$field_title = $wpdb->get_var($wpdb->prepare("select site_title from " . GEODIR_CUSTOM_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s ", array('geodir_special_offers', $post_type)));
2158 2158
 
2159
-            if (isset($tabs_arr['special_offers']['heading_text']) && $field_title != '')
2160
-                $tabs_arr['special_offers']['heading_text'] = $field_title;
2161
-        }
2159
+			if (isset($tabs_arr['special_offers']['heading_text']) && $field_title != '')
2160
+				$tabs_arr['special_offers']['heading_text'] = $field_title;
2161
+		}
2162 2162
 
2163
-    }
2163
+	}
2164 2164
 
2165
-    return $tabs_arr;
2165
+	return $tabs_arr;
2166 2166
 
2167 2167
 }
2168 2168
 
@@ -2175,10 +2175,10 @@  discard block
 block discarded – undo
2175 2175
  */
2176 2176
 function geodir_remove_template_redirect_actions()
2177 2177
 {
2178
-    if (geodir_is_page('login')){
2179
-        remove_all_actions('template_redirect');
2180
-        remove_action('init', 'avia_modify_front', 10);
2181
-    }
2178
+	if (geodir_is_page('login')){
2179
+		remove_all_actions('template_redirect');
2180
+		remove_action('init', 'avia_modify_front', 10);
2181
+	}
2182 2182
 }
2183 2183
 
2184 2184
 
@@ -2200,51 +2200,51 @@  discard block
 block discarded – undo
2200 2200
 function geodirectory_before_featured_image_delete($attachment_id)
2201 2201
 {
2202 2202
 
2203
-    global $wpdb, $plugin_prefix;
2203
+	global $wpdb, $plugin_prefix;
2204 2204
 
2205
-    $post_id = get_post_field('post_parent', $attachment_id);
2205
+	$post_id = get_post_field('post_parent', $attachment_id);
2206 2206
 
2207
-    $attachment_url = wp_get_attachment_url($attachment_id);
2207
+	$attachment_url = wp_get_attachment_url($attachment_id);
2208 2208
 
2209
-    if ($post_id > 0 && (isset($_REQUEST['action']) && $_REQUEST['action'] == 'delete')) {
2209
+	if ($post_id > 0 && (isset($_REQUEST['action']) && $_REQUEST['action'] == 'delete')) {
2210 2210
 
2211
-        $post_type = get_post_type($post_id);
2211
+		$post_type = get_post_type($post_id);
2212 2212
 
2213
-        $all_postypes = geodir_get_posttypes();
2213
+		$all_postypes = geodir_get_posttypes();
2214 2214
 
2215
-        if (!in_array($post_type, $all_postypes) || !is_admin())
2216
-            return false;
2215
+		if (!in_array($post_type, $all_postypes) || !is_admin())
2216
+			return false;
2217 2217
 
2218
-        $uploads = wp_upload_dir();
2218
+		$uploads = wp_upload_dir();
2219 2219
 
2220
-        $split_img_path = explode($uploads['baseurl'], $attachment_url);
2220
+		$split_img_path = explode($uploads['baseurl'], $attachment_url);
2221 2221
 
2222
-        $split_img_file_path = isset($split_img_path[1]) ? $split_img_path[1] : '';
2222
+		$split_img_file_path = isset($split_img_path[1]) ? $split_img_path[1] : '';
2223 2223
 
2224
-        $wpdb->query(
2225
-            $wpdb->prepare("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id = %d AND file=%s ",
2226
-                array($post_id, $split_img_file_path)
2227
-            )
2228
-        );
2224
+		$wpdb->query(
2225
+			$wpdb->prepare("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id = %d AND file=%s ",
2226
+				array($post_id, $split_img_file_path)
2227
+			)
2228
+		);
2229 2229
 
2230
-        $attachment_data = $wpdb->get_row(
2231
-            $wpdb->prepare("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=%d",
2232
-                array($post_id)
2233
-            )
2234
-        );
2230
+		$attachment_data = $wpdb->get_row(
2231
+			$wpdb->prepare("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=%d",
2232
+				array($post_id)
2233
+			)
2234
+		);
2235 2235
 
2236
-        if (!empty($attachment_data)) {
2237
-            $wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
2238
-        }
2236
+		if (!empty($attachment_data)) {
2237
+			$wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
2238
+		}
2239 2239
 
2240 2240
 
2241
-        $table_name = $plugin_prefix . $post_type . '_detail';
2241
+		$table_name = $plugin_prefix . $post_type . '_detail';
2242 2242
 
2243
-        $wpdb->query("UPDATE " . $table_name . " SET featured_image='' WHERE post_id =" . $post_id);
2243
+		$wpdb->query("UPDATE " . $table_name . " SET featured_image='' WHERE post_id =" . $post_id);
2244 2244
 
2245
-        geodir_set_wp_featured_image($post_id);
2245
+		geodir_set_wp_featured_image($post_id);
2246 2246
 
2247
-    }
2247
+	}
2248 2248
 
2249 2249
 }
2250 2250
 
@@ -2262,79 +2262,79 @@  discard block
 block discarded – undo
2262 2262
 function geodir_temp_set_post_attachment()
2263 2263
 {
2264 2264
 
2265
-    global $wpdb, $plugin_prefix;
2265
+	global $wpdb, $plugin_prefix;
2266 2266
 
2267
-    $all_postypes = geodir_get_posttypes();
2267
+	$all_postypes = geodir_get_posttypes();
2268 2268
 
2269
-    foreach ($all_postypes as $posttype) {
2269
+	foreach ($all_postypes as $posttype) {
2270 2270
 
2271
-        $tablename = $plugin_prefix . $posttype . '_detail';
2271
+		$tablename = $plugin_prefix . $posttype . '_detail';
2272 2272
 
2273
-        $get_post_data = $wpdb->get_results("SELECT post_id FROM " . $tablename);
2273
+		$get_post_data = $wpdb->get_results("SELECT post_id FROM " . $tablename);
2274 2274
 
2275
-        if (!empty($get_post_data)) {
2275
+		if (!empty($get_post_data)) {
2276 2276
 
2277
-            foreach ($get_post_data as $data) {
2277
+			foreach ($get_post_data as $data) {
2278 2278
 
2279
-                $post_id = $data->post_id;
2279
+				$post_id = $data->post_id;
2280 2280
 
2281
-                $attachment_data = $wpdb->get_results("SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id =" . $post_id . " AND file!=''");
2281
+				$attachment_data = $wpdb->get_results("SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id =" . $post_id . " AND file!=''");
2282 2282
 
2283
-                if (!empty($attachment_data)) {
2283
+				if (!empty($attachment_data)) {
2284 2284
 
2285
-                    foreach ($attachment_data as $attach) {
2285
+					foreach ($attachment_data as $attach) {
2286 2286
 
2287
-                        $file_info = pathinfo($attach->file);
2287
+						$file_info = pathinfo($attach->file);
2288 2288
 
2289
-                        $sub_dir = '';
2290
-                        if ($file_info['dirname'] != '.' && $file_info['dirname'] != '..')
2291
-                            $sub_dir = stripslashes_deep($file_info['dirname']);
2289
+						$sub_dir = '';
2290
+						if ($file_info['dirname'] != '.' && $file_info['dirname'] != '..')
2291
+							$sub_dir = stripslashes_deep($file_info['dirname']);
2292 2292
 
2293
-                        $uploads = wp_upload_dir(trim($sub_dir, '/')); // Array of key => value pairs
2294
-                        $uploads_path = $uploads['basedir'];
2293
+						$uploads = wp_upload_dir(trim($sub_dir, '/')); // Array of key => value pairs
2294
+						$uploads_path = $uploads['basedir'];
2295 2295
 
2296
-                        $file_name = $file_info['basename'];
2296
+						$file_name = $file_info['basename'];
2297 2297
 
2298
-                        $img_arr['path'] = $uploads_path . $sub_dir . '/' . $file_name;
2298
+						$img_arr['path'] = $uploads_path . $sub_dir . '/' . $file_name;
2299 2299
 
2300
-                        if (!file_exists($img_arr['path'])) {
2300
+						if (!file_exists($img_arr['path'])) {
2301 2301
 
2302
-                            $wpdb->query("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE ID=" . $attach->ID);
2302
+							$wpdb->query("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE ID=" . $attach->ID);
2303 2303
 
2304
-                        }
2304
+						}
2305 2305
 
2306
-                    }
2306
+					}
2307 2307
 
2308
-                    $attachment_data = $wpdb->get_row("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=" . $post_id . " GROUP BY post_id");
2308
+					$attachment_data = $wpdb->get_row("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=" . $post_id . " GROUP BY post_id");
2309 2309
 
2310
-                    if (!empty($attachment_data)) {
2310
+					if (!empty($attachment_data)) {
2311 2311
 
2312
-                        if ($attachment_data->ID)
2313
-                            $wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
2312
+						if ($attachment_data->ID)
2313
+							$wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
2314 2314
 
2315
-                    } else {
2315
+					} else {
2316 2316
 
2317
-                        if (has_post_thumbnail($post_id)) {
2317
+						if (has_post_thumbnail($post_id)) {
2318 2318
 
2319
-                            $post_thumbnail_id = get_post_thumbnail_id($post_id);
2319
+							$post_thumbnail_id = get_post_thumbnail_id($post_id);
2320 2320
 
2321
-                            wp_delete_attachment($post_thumbnail_id);
2321
+							wp_delete_attachment($post_thumbnail_id);
2322 2322
 
2323
-                        }
2323
+						}
2324 2324
 
2325
-                    }
2325
+					}
2326 2326
 
2327
-                    $wpdb->query("UPDATE " . $tablename . " SET featured_image='' WHERE post_id =" . $post_id);
2327
+					$wpdb->query("UPDATE " . $tablename . " SET featured_image='' WHERE post_id =" . $post_id);
2328 2328
 
2329
-                    geodir_set_wp_featured_image($post_id);
2329
+					geodir_set_wp_featured_image($post_id);
2330 2330
 
2331
-                }
2331
+				}
2332 2332
 
2333
-            }
2333
+			}
2334 2334
 
2335
-        }
2335
+		}
2336 2336
 
2337
-    }
2337
+	}
2338 2338
 
2339 2339
 }
2340 2340
 
@@ -2352,9 +2352,9 @@  discard block
 block discarded – undo
2352 2352
 function geodir_default_rating_star_icon()
2353 2353
 {
2354 2354
 
2355
-    if (!get_option('geodir_default_rating_star_icon')) {
2356
-        update_option('geodir_default_rating_star_icon', geodir_plugin_url() . '/geodirectory-assets/images/stars.png');
2357
-    }
2355
+	if (!get_option('geodir_default_rating_star_icon')) {
2356
+		update_option('geodir_default_rating_star_icon', geodir_plugin_url() . '/geodirectory-assets/images/stars.png');
2357
+	}
2358 2358
 
2359 2359
 }
2360 2360
 
@@ -2372,27 +2372,27 @@  discard block
 block discarded – undo
2372 2372
  */
2373 2373
 function geodir_user_post_listing_count($user_id=null)
2374 2374
 {
2375
-    global $wpdb, $plugin_prefix, $current_user;
2376
-    if(!$user_id){
2377
-        $user_id = $current_user->ID;
2378
-    }
2375
+	global $wpdb, $plugin_prefix, $current_user;
2376
+	if(!$user_id){
2377
+		$user_id = $current_user->ID;
2378
+	}
2379 2379
 
2380
-    $user_id = $current_user->ID;
2381
-    $all_postypes = geodir_get_posttypes();
2382
-    $all_posts = get_option('geodir_listing_link_user_dashboard');
2380
+	$user_id = $current_user->ID;
2381
+	$all_postypes = geodir_get_posttypes();
2382
+	$all_posts = get_option('geodir_listing_link_user_dashboard');
2383 2383
 
2384
-    $user_listing = array();
2385
-    if (is_array($all_posts) && !empty($all_posts)) {
2386
-        foreach ($all_posts as $ptype) {
2387
-            $total_posts = $wpdb->get_var("SELECT count( ID ) FROM " . $wpdb->prefix . "posts WHERE post_author=" . $user_id . " AND post_type='" . $ptype . "' AND ( post_status = 'publish' OR post_status = 'draft' OR post_status = 'private' )");
2384
+	$user_listing = array();
2385
+	if (is_array($all_posts) && !empty($all_posts)) {
2386
+		foreach ($all_posts as $ptype) {
2387
+			$total_posts = $wpdb->get_var("SELECT count( ID ) FROM " . $wpdb->prefix . "posts WHERE post_author=" . $user_id . " AND post_type='" . $ptype . "' AND ( post_status = 'publish' OR post_status = 'draft' OR post_status = 'private' )");
2388 2388
 
2389
-            if ($total_posts > 0) {
2390
-                $user_listing[$ptype] = $total_posts;
2391
-            }
2392
-        }
2393
-    }
2389
+			if ($total_posts > 0) {
2390
+				$user_listing[$ptype] = $total_posts;
2391
+			}
2392
+		}
2393
+	}
2394 2394
 
2395
-    return $user_listing;
2395
+	return $user_listing;
2396 2396
 }
2397 2397
 
2398 2398
 
@@ -2412,579 +2412,579 @@  discard block
 block discarded – undo
2412 2412
  */
2413 2413
 function geodir_detail_page_custom_field_tab($tabs_arr)
2414 2414
 {
2415
-    global $post;
2416
-
2417
-    $post_type = geodir_get_current_posttype();
2418
-    $all_postypes = geodir_get_posttypes();
2419
-
2420
-    if (!empty($tabs_arr) && $post_type != '' && in_array($post_type, $all_postypes) && (geodir_is_page('detail') || geodir_is_page('preview'))) {
2421
-        $package_info = array();
2422
-        $package_info = geodir_post_package_info($package_info, $post);
2423
-        $post_package_id = $package_info->pid;
2424
-        $fields_location = 'detail';
2425
-
2426
-        $custom_fields = geodir_post_custom_fields($post_package_id, 'default', $post_type, $fields_location);
2427
-        if (!empty($custom_fields)) {
2428
-            $parse_custom_fields = array();
2429
-            foreach ($custom_fields as $field) {
2430
-                $field = stripslashes_deep($field); // strip slashes
2415
+	global $post;
2416
+
2417
+	$post_type = geodir_get_current_posttype();
2418
+	$all_postypes = geodir_get_posttypes();
2419
+
2420
+	if (!empty($tabs_arr) && $post_type != '' && in_array($post_type, $all_postypes) && (geodir_is_page('detail') || geodir_is_page('preview'))) {
2421
+		$package_info = array();
2422
+		$package_info = geodir_post_package_info($package_info, $post);
2423
+		$post_package_id = $package_info->pid;
2424
+		$fields_location = 'detail';
2425
+
2426
+		$custom_fields = geodir_post_custom_fields($post_package_id, 'default', $post_type, $fields_location);
2427
+		if (!empty($custom_fields)) {
2428
+			$parse_custom_fields = array();
2429
+			foreach ($custom_fields as $field) {
2430
+				$field = stripslashes_deep($field); // strip slashes
2431 2431
                 
2432
-                $type = $field;
2433
-                $field_name = $field['htmlvar_name'];
2434
-                if (empty($geodir_post_info) && geodir_is_page('preview') && $field_name != '' && !isset($post->{$field_name}) && isset($_REQUEST[$field_name])) {
2435
-                    $post->{$field_name} = $_REQUEST[$field_name];
2436
-                }
2437
-
2438
-                if (isset($field['show_as_tab']) && $field['show_as_tab'] == 1 && ((isset($post->{$field_name}) && $post->{$field_name} != '') || $field['type'] == 'fieldset') && in_array($field['type'], array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file'))) {
2439
-                    if ($type['type'] == 'datepicker' && ($post->{$type['htmlvar_name']} == '' || $post->{$type['htmlvar_name']} == '0000-00-00')) {
2440
-                        continue;
2441
-                    }
2442
-
2443
-                    $parse_custom_fields[] = $field;
2444
-                }
2445
-            }
2446
-            $custom_fields = $parse_custom_fields;
2447
-        }
2448
-
2449
-        if (!empty($custom_fields)) {
2450
-            $field_set_start = 0;
2451
-            $fieldset_count = 0;
2452
-            $fieldset = '';
2453
-            $total_fields = count($custom_fields);
2454
-            $count_field = 0;
2455
-            $fieldset_arr = array();
2456
-            $i = 0;
2457
-            $geodir_post_info = isset($post->ID) && !empty($post->ID) ? geodir_get_post_info($post->ID) : NULL;
2458
-
2459
-            foreach ($custom_fields as $field) {
2460
-                $count_field++;
2461
-                $field_name = $field['htmlvar_name'];
2462
-                if (empty($geodir_post_info) && geodir_is_page('preview') && $field_name != '' && !isset($post->{$field_name}) && isset($_REQUEST[$field_name])) {
2463
-                    $post->{$field_name} = $_REQUEST[$field_name];
2464
-                }
2465
-
2466
-                if (isset($field['show_as_tab']) && $field['show_as_tab'] == 1 && ((isset($post->{$field_name}) && $post->{$field_name} != '') || $field['type'] == 'fieldset') && in_array($field['type'], array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file'))) {
2467
-                    $label = $field['site_title'] != '' ? $field['site_title'] : $field['admin_title'];
2468
-                    $site_title = trim($field['site_title']);
2469
-                    $type = $field;
2470
-                    $html = '';
2471
-                    $html_var = $field_name;
2472
-                    $field_icon = '';
2473
-                    $variables_array = array();
2474
-
2475
-                    if ($type['type'] == 'datepicker' && ($post->{$type['htmlvar_name']} == '' || $post->{$type['htmlvar_name']} == '0000-00-00')) {
2476
-                        continue;
2477
-                    }
2478
-
2479
-                    if ($type['type'] != 'fieldset') {
2480
-                        $i++;
2481
-                        $variables_array['post_id'] = $post->ID;
2482
-                        $variables_array['label'] = __($type['site_title'], 'geodirectory');
2483
-                        $variables_array['value'] = '';
2484
-                        $variables_array['value'] = $post->{$type['htmlvar_name']};
2485
-                    }
2486
-
2487
-                    if (strpos($type['field_icon'], 'http') !== false) {
2488
-                        $field_icon = ' background: url(' . $type['field_icon'] . ') no-repeat left center;background-size:18px 18px;padding-left: 21px;';
2489
-                    } elseif (strpos($type['field_icon'], 'fa fa-') !== false) {
2490
-                        $field_icon = '<i class="' . $type['field_icon'] . '"></i>';
2491
-                    }
2432
+				$type = $field;
2433
+				$field_name = $field['htmlvar_name'];
2434
+				if (empty($geodir_post_info) && geodir_is_page('preview') && $field_name != '' && !isset($post->{$field_name}) && isset($_REQUEST[$field_name])) {
2435
+					$post->{$field_name} = $_REQUEST[$field_name];
2436
+				}
2437
+
2438
+				if (isset($field['show_as_tab']) && $field['show_as_tab'] == 1 && ((isset($post->{$field_name}) && $post->{$field_name} != '') || $field['type'] == 'fieldset') && in_array($field['type'], array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file'))) {
2439
+					if ($type['type'] == 'datepicker' && ($post->{$type['htmlvar_name']} == '' || $post->{$type['htmlvar_name']} == '0000-00-00')) {
2440
+						continue;
2441
+					}
2442
+
2443
+					$parse_custom_fields[] = $field;
2444
+				}
2445
+			}
2446
+			$custom_fields = $parse_custom_fields;
2447
+		}
2492 2448
 
2493
-                    switch ($type['type']) {
2494
-                        case 'fieldset': {
2495
-                            $i = 0;
2496
-                            $fieldset_count++;
2497
-                            $field_set_start = 1;
2498
-                            $fieldset_arr[$fieldset_count]['htmlvar_name'] = 'gd_tab_' . $fieldset_count;
2499
-                            $fieldset_arr[$fieldset_count]['label'] = $label;
2500
-                        }
2501
-                            break;
2502
-                        case 'url': {
2503
-                            if (strpos($field_icon, 'http') !== false) {
2504
-                                $field_icon_af = '';
2505
-                            } elseif ($field_icon == '') {
2506
-
2507
-                                if ($type['name'] == 'geodir_facebook') {
2508
-                                    $field_icon_af = '<i class="fa fa-facebook-square"></i>';
2509
-                                } elseif ($type['name'] == 'geodir_twitter') {
2510
-                                    $field_icon_af = '<i class="fa fa-twitter-square"></i>';
2511
-                                } else {
2512
-                                    $field_icon_af = '<i class="fa fa-link"></i>';
2513
-                                }
2514
-
2515
-                            } else {
2516
-                                $field_icon_af = $field_icon;
2517
-                                $field_icon = '';
2518
-                            }
2449
+		if (!empty($custom_fields)) {
2450
+			$field_set_start = 0;
2451
+			$fieldset_count = 0;
2452
+			$fieldset = '';
2453
+			$total_fields = count($custom_fields);
2454
+			$count_field = 0;
2455
+			$fieldset_arr = array();
2456
+			$i = 0;
2457
+			$geodir_post_info = isset($post->ID) && !empty($post->ID) ? geodir_get_post_info($post->ID) : NULL;
2458
+
2459
+			foreach ($custom_fields as $field) {
2460
+				$count_field++;
2461
+				$field_name = $field['htmlvar_name'];
2462
+				if (empty($geodir_post_info) && geodir_is_page('preview') && $field_name != '' && !isset($post->{$field_name}) && isset($_REQUEST[$field_name])) {
2463
+					$post->{$field_name} = $_REQUEST[$field_name];
2464
+				}
2465
+
2466
+				if (isset($field['show_as_tab']) && $field['show_as_tab'] == 1 && ((isset($post->{$field_name}) && $post->{$field_name} != '') || $field['type'] == 'fieldset') && in_array($field['type'], array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file'))) {
2467
+					$label = $field['site_title'] != '' ? $field['site_title'] : $field['admin_title'];
2468
+					$site_title = trim($field['site_title']);
2469
+					$type = $field;
2470
+					$html = '';
2471
+					$html_var = $field_name;
2472
+					$field_icon = '';
2473
+					$variables_array = array();
2474
+
2475
+					if ($type['type'] == 'datepicker' && ($post->{$type['htmlvar_name']} == '' || $post->{$type['htmlvar_name']} == '0000-00-00')) {
2476
+						continue;
2477
+					}
2478
+
2479
+					if ($type['type'] != 'fieldset') {
2480
+						$i++;
2481
+						$variables_array['post_id'] = $post->ID;
2482
+						$variables_array['label'] = __($type['site_title'], 'geodirectory');
2483
+						$variables_array['value'] = '';
2484
+						$variables_array['value'] = $post->{$type['htmlvar_name']};
2485
+					}
2486
+
2487
+					if (strpos($type['field_icon'], 'http') !== false) {
2488
+						$field_icon = ' background: url(' . $type['field_icon'] . ') no-repeat left center;background-size:18px 18px;padding-left: 21px;';
2489
+					} elseif (strpos($type['field_icon'], 'fa fa-') !== false) {
2490
+						$field_icon = '<i class="' . $type['field_icon'] . '"></i>';
2491
+					}
2492
+
2493
+					switch ($type['type']) {
2494
+						case 'fieldset': {
2495
+							$i = 0;
2496
+							$fieldset_count++;
2497
+							$field_set_start = 1;
2498
+							$fieldset_arr[$fieldset_count]['htmlvar_name'] = 'gd_tab_' . $fieldset_count;
2499
+							$fieldset_arr[$fieldset_count]['label'] = $label;
2500
+						}
2501
+							break;
2502
+						case 'url': {
2503
+							if (strpos($field_icon, 'http') !== false) {
2504
+								$field_icon_af = '';
2505
+							} elseif ($field_icon == '') {
2506
+
2507
+								if ($type['name'] == 'geodir_facebook') {
2508
+									$field_icon_af = '<i class="fa fa-facebook-square"></i>';
2509
+								} elseif ($type['name'] == 'geodir_twitter') {
2510
+									$field_icon_af = '<i class="fa fa-twitter-square"></i>';
2511
+								} else {
2512
+									$field_icon_af = '<i class="fa fa-link"></i>';
2513
+								}
2514
+
2515
+							} else {
2516
+								$field_icon_af = $field_icon;
2517
+								$field_icon = '';
2518
+							}
2519 2519
                             
2520
-                            $a_url = geodir_parse_custom_field_url($post->{$type['htmlvar_name']});
2521
-
2522
-                            $website = !empty($a_url['url']) ? $a_url['url'] : '';
2523
-                            $title = !empty($a_url['label']) ? $a_url['label'] : $type['site_title'];
2524
-                            $title = $title != '' ? __(stripslashes($title), 'geodirectory') : '';
2525
-
2526
-                            $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2527
-
2528
-                            // all search engines that use the nofollow value exclude links that use it from their ranking calculation
2529
-                            $rel = strpos($website, get_site_url()) !== false ? '' : 'rel="nofollow"';
2530
-
2531
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '"><span class="geodir-i-website" style="' . $field_icon . '">' . $field_icon_af . ' <a href="' . $website . '" target="_blank" ' . $rel . ' ><strong>' .
2532
-                                /**
2533
-                                 * Filer the custom field website name.
2534
-                                 *
2535
-                                 * @since 1.0.0
2536
-                                 * @param string $title The field name default: "Website".
2537
-                                 * @param string $website The website address.
2538
-                                 * @param int $post->ID The post ID.
2539
-                                 */
2540
-                                apply_filters('geodir_custom_field_website_name', $title, $website, $post->ID) . '</strong></a></span></div>';
2541
-                        }
2542
-                            break;
2543
-                        case 'phone': {
2544
-                            if (strpos($field_icon, 'http') !== false) {
2545
-                                $field_icon_af = '';
2546
-                            } elseif ($field_icon == '') {
2547
-                                $field_icon_af = '<i class="fa fa-phone"></i>';
2548
-                            } else {
2549
-                                $field_icon_af = $field_icon;
2550
-                                $field_icon = '';
2551
-                            }
2552
-
2553
-                            $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2554
-
2555
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-contact" style="' . $field_icon . '">' . $field_icon_af;
2556
-                            if ($field_set_start == 1 && $site_title != '') {
2557
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2558
-                            }
2559
-                            $html .= ' </span>' . stripslashes($post->{$type['htmlvar_name']}) . '</div>';
2560
-                        }
2561
-                            break;
2562
-                        case 'time': {
2563
-                            $value = '';
2564
-                            if ($post->{$type['htmlvar_name']} != '')
2565
-                                $value = date_i18n(get_option('time_format'), strtotime($post->{$type['htmlvar_name']}));
2566
-
2567
-                            if (strpos($field_icon, 'http') !== false) {
2568
-                                $field_icon_af = '';
2569
-                            } elseif ($field_icon == '') {
2570
-                                $field_icon_af = '<i class="fa fa-clock-o"></i>';
2571
-                            } else {
2572
-                                $field_icon_af = $field_icon;
2573
-                                $field_icon = '';
2574
-                            }
2575
-
2576
-                            $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2577
-
2578
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-time" style="' . $field_icon . '">' . $field_icon_af;
2579
-                            if ($field_set_start == 1 && $site_title != '') {
2580
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2581
-                            }
2582
-                            $html .= ' </span>' . stripslashes($value) . '</div>';
2583
-                        }
2584
-                            break;
2585
-                        case 'datepicker': {
2586
-                            $date_format = geodir_default_date_format();
2587
-                            if ($type['extra_fields'] != '') {
2588
-                                $date_format = unserialize($type['extra_fields']);
2589
-                                $date_format = $date_format['date_format'];
2590
-                            }
2591
-
2592
-                            $search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format
2593
-                            $replace = array('d','j','l','m','n','F','Y');//PHP date format
2594
-
2595
-                            $date_format = str_replace($search, $replace, $date_format);
2596
-
2597
-                            $post_htmlvar_value = $date_format == 'd/m/Y' ? str_replace('/', '-', $post->{$type['htmlvar_name']}) : $post->{$type['htmlvar_name']}; // PHP doesn't work well with dd/mm/yyyy format
2598
-
2599
-                            $value = '';
2600
-                            if ($post->{$type['htmlvar_name']} != '')
2601
-                                $value = date($date_format, strtotime($post_htmlvar_value));
2602
-
2603
-                            if (strpos($field_icon, 'http') !== false) {
2604
-                                $field_icon_af = '';
2605
-                            } elseif ($field_icon == '') {
2606
-                                $field_icon_af = '<i class="fa fa-calendar"></i>';
2607
-                            } else {
2608
-                                $field_icon_af = $field_icon;
2609
-                                $field_icon = '';
2610
-                            }
2611
-
2612
-                            $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2613
-
2614
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-datepicker" style="' . $field_icon . '">' . $field_icon_af;
2615
-                            if ($field_set_start == 1 && $site_title != '') {
2616
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2617
-                            }
2618
-                            $html .= ' </span>' . $value . '</div>';
2619
-                        }
2620
-                            break;
2621
-                        case 'text': {
2622
-                            if (strpos($field_icon, 'http') !== false) {
2623
-                                $field_icon_af = '';
2624
-                            } elseif ($field_icon == '') {
2625
-                                $field_icon_af = '';
2626
-                            } else {
2627
-                                $field_icon_af = $field_icon;
2628
-                                $field_icon = '';
2629
-                            }
2630
-
2631
-                            $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2632
-
2633
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
2634
-                            if ($field_set_start == 1 && $site_title != '') {
2635
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2636
-                            }
2637
-                            $html .= ' </span>' . stripslashes($post->{$type['htmlvar_name']}) . '</div>';
2638
-                        }
2639
-                            break;
2640
-                        case 'radio': {
2641
-
2642
-                            if ($post->{$type['htmlvar_name']} != '') {
2643
-                                if ($post->{$type['htmlvar_name']} == 'f' || $post->{$type['htmlvar_name']} == '0') {
2644
-                                    $html_val = __('No', 'geodirectory');
2645
-                                } else if ($post->{$type['htmlvar_name']} == 't' || $post->{$type['htmlvar_name']} == '1') {
2646
-                                    $html_val = __('Yes', 'geodirectory');
2647
-                                } else {
2648
-                                    $html_val = __($post->{$type['htmlvar_name']}, 'geodirectory');
2520
+							$a_url = geodir_parse_custom_field_url($post->{$type['htmlvar_name']});
2521
+
2522
+							$website = !empty($a_url['url']) ? $a_url['url'] : '';
2523
+							$title = !empty($a_url['label']) ? $a_url['label'] : $type['site_title'];
2524
+							$title = $title != '' ? __(stripslashes($title), 'geodirectory') : '';
2525
+
2526
+							$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2527
+
2528
+							// all search engines that use the nofollow value exclude links that use it from their ranking calculation
2529
+							$rel = strpos($website, get_site_url()) !== false ? '' : 'rel="nofollow"';
2530
+
2531
+							$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '"><span class="geodir-i-website" style="' . $field_icon . '">' . $field_icon_af . ' <a href="' . $website . '" target="_blank" ' . $rel . ' ><strong>' .
2532
+								/**
2533
+								 * Filer the custom field website name.
2534
+								 *
2535
+								 * @since 1.0.0
2536
+								 * @param string $title The field name default: "Website".
2537
+								 * @param string $website The website address.
2538
+								 * @param int $post->ID The post ID.
2539
+								 */
2540
+								apply_filters('geodir_custom_field_website_name', $title, $website, $post->ID) . '</strong></a></span></div>';
2541
+						}
2542
+							break;
2543
+						case 'phone': {
2544
+							if (strpos($field_icon, 'http') !== false) {
2545
+								$field_icon_af = '';
2546
+							} elseif ($field_icon == '') {
2547
+								$field_icon_af = '<i class="fa fa-phone"></i>';
2548
+							} else {
2549
+								$field_icon_af = $field_icon;
2550
+								$field_icon = '';
2551
+							}
2552
+
2553
+							$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2554
+
2555
+							$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-contact" style="' . $field_icon . '">' . $field_icon_af;
2556
+							if ($field_set_start == 1 && $site_title != '') {
2557
+								$html .= ' ' . __($site_title, 'geodirectory') . ': ';
2558
+							}
2559
+							$html .= ' </span>' . stripslashes($post->{$type['htmlvar_name']}) . '</div>';
2560
+						}
2561
+							break;
2562
+						case 'time': {
2563
+							$value = '';
2564
+							if ($post->{$type['htmlvar_name']} != '')
2565
+								$value = date_i18n(get_option('time_format'), strtotime($post->{$type['htmlvar_name']}));
2566
+
2567
+							if (strpos($field_icon, 'http') !== false) {
2568
+								$field_icon_af = '';
2569
+							} elseif ($field_icon == '') {
2570
+								$field_icon_af = '<i class="fa fa-clock-o"></i>';
2571
+							} else {
2572
+								$field_icon_af = $field_icon;
2573
+								$field_icon = '';
2574
+							}
2575
+
2576
+							$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2577
+
2578
+							$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-time" style="' . $field_icon . '">' . $field_icon_af;
2579
+							if ($field_set_start == 1 && $site_title != '') {
2580
+								$html .= ' ' . __($site_title, 'geodirectory') . ': ';
2581
+							}
2582
+							$html .= ' </span>' . stripslashes($value) . '</div>';
2583
+						}
2584
+							break;
2585
+						case 'datepicker': {
2586
+							$date_format = geodir_default_date_format();
2587
+							if ($type['extra_fields'] != '') {
2588
+								$date_format = unserialize($type['extra_fields']);
2589
+								$date_format = $date_format['date_format'];
2590
+							}
2591
+
2592
+							$search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format
2593
+							$replace = array('d','j','l','m','n','F','Y');//PHP date format
2594
+
2595
+							$date_format = str_replace($search, $replace, $date_format);
2596
+
2597
+							$post_htmlvar_value = $date_format == 'd/m/Y' ? str_replace('/', '-', $post->{$type['htmlvar_name']}) : $post->{$type['htmlvar_name']}; // PHP doesn't work well with dd/mm/yyyy format
2598
+
2599
+							$value = '';
2600
+							if ($post->{$type['htmlvar_name']} != '')
2601
+								$value = date($date_format, strtotime($post_htmlvar_value));
2602
+
2603
+							if (strpos($field_icon, 'http') !== false) {
2604
+								$field_icon_af = '';
2605
+							} elseif ($field_icon == '') {
2606
+								$field_icon_af = '<i class="fa fa-calendar"></i>';
2607
+							} else {
2608
+								$field_icon_af = $field_icon;
2609
+								$field_icon = '';
2610
+							}
2611
+
2612
+							$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2613
+
2614
+							$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-datepicker" style="' . $field_icon . '">' . $field_icon_af;
2615
+							if ($field_set_start == 1 && $site_title != '') {
2616
+								$html .= ' ' . __($site_title, 'geodirectory') . ': ';
2617
+							}
2618
+							$html .= ' </span>' . $value . '</div>';
2619
+						}
2620
+							break;
2621
+						case 'text': {
2622
+							if (strpos($field_icon, 'http') !== false) {
2623
+								$field_icon_af = '';
2624
+							} elseif ($field_icon == '') {
2625
+								$field_icon_af = '';
2626
+							} else {
2627
+								$field_icon_af = $field_icon;
2628
+								$field_icon = '';
2629
+							}
2630
+
2631
+							$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2632
+
2633
+							$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
2634
+							if ($field_set_start == 1 && $site_title != '') {
2635
+								$html .= ' ' . __($site_title, 'geodirectory') . ': ';
2636
+							}
2637
+							$html .= ' </span>' . stripslashes($post->{$type['htmlvar_name']}) . '</div>';
2638
+						}
2639
+							break;
2640
+						case 'radio': {
2641
+
2642
+							if ($post->{$type['htmlvar_name']} != '') {
2643
+								if ($post->{$type['htmlvar_name']} == 'f' || $post->{$type['htmlvar_name']} == '0') {
2644
+									$html_val = __('No', 'geodirectory');
2645
+								} else if ($post->{$type['htmlvar_name']} == 't' || $post->{$type['htmlvar_name']} == '1') {
2646
+									$html_val = __('Yes', 'geodirectory');
2647
+								} else {
2648
+									$html_val = __($post->{$type['htmlvar_name']}, 'geodirectory');
2649 2649
                                     
2650
-                                    if (!empty($type['option_values'])) {
2651
-                                        $cf_option_values = geodir_string_values_to_options(stripslashes_deep($type['option_values']), true);
2650
+									if (!empty($type['option_values'])) {
2651
+										$cf_option_values = geodir_string_values_to_options(stripslashes_deep($type['option_values']), true);
2652 2652
                                         
2653
-                                        if (!empty($cf_option_values)) {
2654
-                                            foreach ($cf_option_values as $cf_option_value) {
2655
-                                                if (isset($cf_option_value['value']) && $cf_option_value['value'] == $post->{$type['htmlvar_name']}) {
2656
-                                                    $html_val = $cf_option_value['label'];
2657
-                                                }
2658
-                                            }
2659
-                                        }
2660
-                                    }
2661
-                                }
2662
-
2663
-                                if (strpos($field_icon, 'http') !== false) {
2664
-                                    $field_icon_af = '';
2665
-                                } else if ($field_icon == '') {
2666
-                                    $field_icon_af = '';
2667
-                                } else {
2668
-                                    $field_icon_af = $field_icon;
2669
-                                    $field_icon = '';
2670
-                                }
2671
-
2672
-                                $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2673
-
2674
-                                $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-radio" style="' . $field_icon . '">' . $field_icon_af;
2675
-
2676
-                                if ($field_set_start == 1 && $site_title != '') {
2677
-                                    $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2678
-                                }
2679
-
2680
-                                $html .= ' </span>' . $html_val . '</div>';
2681
-                            }
2682
-                        }
2683
-                            break;
2684
-                        case 'checkbox': {
2685
-                            $html_var = $type['htmlvar_name'];
2686
-                            $html_val = $type['htmlvar_name'];
2687
-
2688
-                            if ((int)$post->{$html_var} == 1) {
2689
-
2690
-                                if ($post->{$type['htmlvar_name']} == '1') {
2691
-                                    $html_val = __('Yes', 'geodirectory');
2692
-                                } else {
2693
-                                    $html_val = __('No', 'geodirectory');
2694
-                                }
2695
-
2696
-                                if (strpos($field_icon, 'http') !== false) {
2697
-                                    $field_icon_af = '';
2698
-                                } else if ($field_icon == '') {
2699
-                                    $field_icon_af = '';
2700
-                                } else {
2701
-                                    $field_icon_af = $field_icon;
2702
-                                    $field_icon = '';
2703
-                                }
2704
-
2705
-                                $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2706
-
2707
-                                $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-checkbox" style="' . $field_icon . '">' . $field_icon_af;
2708
-
2709
-                                if ($field_set_start == 1 && $site_title != '') {
2710
-                                    $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2711
-                                }
2712
-
2713
-                                $html .= ' </span>' . $html_val . '</div>';
2714
-                            }
2715
-                        }
2716
-                            break;
2717
-                        case 'select': {
2718
-                            if (strpos($field_icon, 'http') !== false) {
2719
-                                $field_icon_af = '';
2720
-                            } elseif ($field_icon == '') {
2721
-                                $field_icon_af = '';
2722
-                            } else {
2723
-                                $field_icon_af = $field_icon;
2724
-                                $field_icon = '';
2725
-                            }
2653
+										if (!empty($cf_option_values)) {
2654
+											foreach ($cf_option_values as $cf_option_value) {
2655
+												if (isset($cf_option_value['value']) && $cf_option_value['value'] == $post->{$type['htmlvar_name']}) {
2656
+													$html_val = $cf_option_value['label'];
2657
+												}
2658
+											}
2659
+										}
2660
+									}
2661
+								}
2662
+
2663
+								if (strpos($field_icon, 'http') !== false) {
2664
+									$field_icon_af = '';
2665
+								} else if ($field_icon == '') {
2666
+									$field_icon_af = '';
2667
+								} else {
2668
+									$field_icon_af = $field_icon;
2669
+									$field_icon = '';
2670
+								}
2671
+
2672
+								$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2673
+
2674
+								$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-radio" style="' . $field_icon . '">' . $field_icon_af;
2675
+
2676
+								if ($field_set_start == 1 && $site_title != '') {
2677
+									$html .= ' ' . __($site_title, 'geodirectory') . ': ';
2678
+								}
2679
+
2680
+								$html .= ' </span>' . $html_val . '</div>';
2681
+							}
2682
+						}
2683
+							break;
2684
+						case 'checkbox': {
2685
+							$html_var = $type['htmlvar_name'];
2686
+							$html_val = $type['htmlvar_name'];
2687
+
2688
+							if ((int)$post->{$html_var} == 1) {
2689
+
2690
+								if ($post->{$type['htmlvar_name']} == '1') {
2691
+									$html_val = __('Yes', 'geodirectory');
2692
+								} else {
2693
+									$html_val = __('No', 'geodirectory');
2694
+								}
2695
+
2696
+								if (strpos($field_icon, 'http') !== false) {
2697
+									$field_icon_af = '';
2698
+								} else if ($field_icon == '') {
2699
+									$field_icon_af = '';
2700
+								} else {
2701
+									$field_icon_af = $field_icon;
2702
+									$field_icon = '';
2703
+								}
2704
+
2705
+								$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2706
+
2707
+								$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-checkbox" style="' . $field_icon . '">' . $field_icon_af;
2708
+
2709
+								if ($field_set_start == 1 && $site_title != '') {
2710
+									$html .= ' ' . __($site_title, 'geodirectory') . ': ';
2711
+								}
2712
+
2713
+								$html .= ' </span>' . $html_val . '</div>';
2714
+							}
2715
+						}
2716
+							break;
2717
+						case 'select': {
2718
+							if (strpos($field_icon, 'http') !== false) {
2719
+								$field_icon_af = '';
2720
+							} elseif ($field_icon == '') {
2721
+								$field_icon_af = '';
2722
+							} else {
2723
+								$field_icon_af = $field_icon;
2724
+								$field_icon = '';
2725
+							}
2726 2726
                             
2727
-                            $field_value = __($post->{$type['htmlvar_name']}, 'geodirectory');
2727
+							$field_value = __($post->{$type['htmlvar_name']}, 'geodirectory');
2728 2728
                             
2729
-                            if (!empty($type['option_values'])) {
2730
-                                $cf_option_values = geodir_string_values_to_options(stripslashes_deep($type['option_values']), true);
2729
+							if (!empty($type['option_values'])) {
2730
+								$cf_option_values = geodir_string_values_to_options(stripslashes_deep($type['option_values']), true);
2731 2731
                                 
2732
-                                if (!empty($cf_option_values)) {
2733
-                                    foreach ($cf_option_values as $cf_option_value) {
2734
-                                        if (isset($cf_option_value['value']) && $cf_option_value['value'] == $post->{$type['htmlvar_name']}) {
2735
-                                            $field_value = $cf_option_value['label'];
2736
-                                        }
2737
-                                    }
2738
-                                }
2739
-                            }
2740
-
2741
-                            $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2742
-
2743
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
2744
-                            if ($field_set_start == 1 && $site_title != '') {
2745
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2746
-                            }
2747
-                            $html .= ' </span>' . $field_value . '</div>';
2748
-                        }
2749
-                            break;
2750
-                        case 'multiselect': {
2751
-                            if (is_array($post->{$type['htmlvar_name']})) {
2752
-                                $post->{$type['htmlvar_name']} = implode(', ', $post->{$type['htmlvar_name']});
2753
-                            }
2754
-
2755
-                            if (strpos($field_icon, 'http') !== false) {
2756
-                                $field_icon_af = '';
2757
-                            } elseif ($field_icon == '') {
2758
-                                $field_icon_af = '';
2759
-                            } else {
2760
-                                $field_icon_af = $field_icon;
2761
-                                $field_icon = '';
2762
-                            }
2763
-
2764
-                            $field_values = explode(',', trim($post->{$type['htmlvar_name']}, ","));
2765
-
2766
-                            $option_values = array();
2767
-                            if (!empty($type['option_values'])) {
2768
-                                $cf_option_values = geodir_string_values_to_options(stripslashes_deep($type['option_values']), true);
2732
+								if (!empty($cf_option_values)) {
2733
+									foreach ($cf_option_values as $cf_option_value) {
2734
+										if (isset($cf_option_value['value']) && $cf_option_value['value'] == $post->{$type['htmlvar_name']}) {
2735
+											$field_value = $cf_option_value['label'];
2736
+										}
2737
+									}
2738
+								}
2739
+							}
2740
+
2741
+							$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2742
+
2743
+							$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
2744
+							if ($field_set_start == 1 && $site_title != '') {
2745
+								$html .= ' ' . __($site_title, 'geodirectory') . ': ';
2746
+							}
2747
+							$html .= ' </span>' . $field_value . '</div>';
2748
+						}
2749
+							break;
2750
+						case 'multiselect': {
2751
+							if (is_array($post->{$type['htmlvar_name']})) {
2752
+								$post->{$type['htmlvar_name']} = implode(', ', $post->{$type['htmlvar_name']});
2753
+							}
2754
+
2755
+							if (strpos($field_icon, 'http') !== false) {
2756
+								$field_icon_af = '';
2757
+							} elseif ($field_icon == '') {
2758
+								$field_icon_af = '';
2759
+							} else {
2760
+								$field_icon_af = $field_icon;
2761
+								$field_icon = '';
2762
+							}
2763
+
2764
+							$field_values = explode(',', trim($post->{$type['htmlvar_name']}, ","));
2765
+
2766
+							$option_values = array();
2767
+							if (!empty($type['option_values'])) {
2768
+								$cf_option_values = geodir_string_values_to_options(stripslashes_deep($type['option_values']), true);
2769 2769
                                 
2770
-                                if (!empty($cf_option_values)) {
2771
-                                    foreach ($cf_option_values as $cf_option_value) {
2772
-                                        if (isset($cf_option_value['value']) && in_array($cf_option_value['value'], $field_values)) {
2773
-                                            $option_values[] = $cf_option_value['label'];
2774
-                                        }
2775
-                                    }
2776
-                                }
2777
-                            }
2778
-
2779
-                            $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2780
-
2781
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
2782
-                            if ($field_set_start == 1 && $site_title != '') {
2783
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2784
-                            }
2785
-                            $html .= ' </span>';
2786
-
2787
-                            if (count($option_values) > 1) {
2788
-                                $html .= '<ul>';
2789
-                                foreach ($option_values as $val) {
2790
-                                    $html .= '<li>' . $val . '</li>';
2791
-                                }
2792
-                                $html .= '</ul>';
2793
-                            } else {
2794
-                                $html .= $post->{$type['htmlvar_name']};
2795
-                            }
2796
-                            $html .= '</div>';
2797
-                        }
2798
-                            break;
2799
-                        case 'email': {
2800
-                            if (strpos($field_icon, 'http') !== false) {
2801
-                                $field_icon_af = '';
2802
-                            } elseif ($field_icon == '') {
2803
-                                $field_icon_af = '<i class="fa fa-envelope"></i>';
2804
-                            } else {
2805
-                                $field_icon_af = $field_icon;
2806
-                                $field_icon = '';
2807
-                            }
2808
-
2809
-                            $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2810
-
2811
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af;
2812
-                            if ($field_set_start == 1 && $site_title != '') {
2813
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2814
-                            }
2815
-                            $html .= ' </span>' . stripslashes($post->{$type['htmlvar_name']}) . '</div>';
2816
-                        }
2817
-                            break;
2818
-                        case 'textarea': {
2819
-                            if (strpos($field_icon, 'http') !== false) {
2820
-                                $field_icon_af = '';
2821
-                            } elseif ($field_icon == '') {
2822
-                                $field_icon_af = '';
2823
-                            } else {
2824
-                                $field_icon_af = $field_icon;
2825
-                                $field_icon = '';
2826
-                            }
2827
-
2828
-                            $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2829
-
2830
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
2831
-                            if ($field_set_start == 1 && $site_title != '') {
2832
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2833
-                            }
2834
-                            $html .= '</span>' . wpautop(stripslashes($post->{$type['htmlvar_name']})) . '</div>';
2835
-                        }
2836
-                            break;
2837
-                        case 'html': {
2838
-                            if (strpos($field_icon, 'http') !== false) {
2839
-                                $field_icon_af = '';
2840
-                            } elseif ($field_icon == '') {
2841
-                                $field_icon_af = '';
2842
-                            } else {
2843
-                                $field_icon_af = $field_icon;
2844
-                                $field_icon = '';
2845
-                            }
2846
-
2847
-                            $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2848
-
2849
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
2850
-                            if ($field_set_start == 1 && $site_title != '') {
2851
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2852
-                            }
2853
-                            $html .= ' </span>' . wpautop(stripslashes($post->{$type['htmlvar_name']})) . '</div>';
2854
-                        }
2855
-                        break;
2856
-                        case 'file': {
2857
-                            $html_var = $type['htmlvar_name'];
2858
-
2859
-                            if (!empty($post->{$type['htmlvar_name']})) {
2860
-                                $files = explode(",", $post->{$type['htmlvar_name']});
2861
-
2862
-                                if (!empty($files)) {
2863
-                                    $extra_fields = !empty($type['extra_fields']) ? maybe_unserialize($type['extra_fields']) : NULL;
2864
-                                    $allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types'] ) ? $extra_fields['gd_file_types'] : '';
2770
+								if (!empty($cf_option_values)) {
2771
+									foreach ($cf_option_values as $cf_option_value) {
2772
+										if (isset($cf_option_value['value']) && in_array($cf_option_value['value'], $field_values)) {
2773
+											$option_values[] = $cf_option_value['label'];
2774
+										}
2775
+									}
2776
+								}
2777
+							}
2778
+
2779
+							$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2780
+
2781
+							$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
2782
+							if ($field_set_start == 1 && $site_title != '') {
2783
+								$html .= ' ' . __($site_title, 'geodirectory') . ': ';
2784
+							}
2785
+							$html .= ' </span>';
2786
+
2787
+							if (count($option_values) > 1) {
2788
+								$html .= '<ul>';
2789
+								foreach ($option_values as $val) {
2790
+									$html .= '<li>' . $val . '</li>';
2791
+								}
2792
+								$html .= '</ul>';
2793
+							} else {
2794
+								$html .= $post->{$type['htmlvar_name']};
2795
+							}
2796
+							$html .= '</div>';
2797
+						}
2798
+							break;
2799
+						case 'email': {
2800
+							if (strpos($field_icon, 'http') !== false) {
2801
+								$field_icon_af = '';
2802
+							} elseif ($field_icon == '') {
2803
+								$field_icon_af = '<i class="fa fa-envelope"></i>';
2804
+							} else {
2805
+								$field_icon_af = $field_icon;
2806
+								$field_icon = '';
2807
+							}
2808
+
2809
+							$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2810
+
2811
+							$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af;
2812
+							if ($field_set_start == 1 && $site_title != '') {
2813
+								$html .= ' ' . __($site_title, 'geodirectory') . ': ';
2814
+							}
2815
+							$html .= ' </span>' . stripslashes($post->{$type['htmlvar_name']}) . '</div>';
2816
+						}
2817
+							break;
2818
+						case 'textarea': {
2819
+							if (strpos($field_icon, 'http') !== false) {
2820
+								$field_icon_af = '';
2821
+							} elseif ($field_icon == '') {
2822
+								$field_icon_af = '';
2823
+							} else {
2824
+								$field_icon_af = $field_icon;
2825
+								$field_icon = '';
2826
+							}
2827
+
2828
+							$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2829
+
2830
+							$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
2831
+							if ($field_set_start == 1 && $site_title != '') {
2832
+								$html .= ' ' . __($site_title, 'geodirectory') . ': ';
2833
+							}
2834
+							$html .= '</span>' . wpautop(stripslashes($post->{$type['htmlvar_name']})) . '</div>';
2835
+						}
2836
+							break;
2837
+						case 'html': {
2838
+							if (strpos($field_icon, 'http') !== false) {
2839
+								$field_icon_af = '';
2840
+							} elseif ($field_icon == '') {
2841
+								$field_icon_af = '';
2842
+							} else {
2843
+								$field_icon_af = $field_icon;
2844
+								$field_icon = '';
2845
+							}
2846
+
2847
+							$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2848
+
2849
+							$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
2850
+							if ($field_set_start == 1 && $site_title != '') {
2851
+								$html .= ' ' . __($site_title, 'geodirectory') . ': ';
2852
+							}
2853
+							$html .= ' </span>' . wpautop(stripslashes($post->{$type['htmlvar_name']})) . '</div>';
2854
+						}
2855
+						break;
2856
+						case 'file': {
2857
+							$html_var = $type['htmlvar_name'];
2858
+
2859
+							if (!empty($post->{$type['htmlvar_name']})) {
2860
+								$files = explode(",", $post->{$type['htmlvar_name']});
2861
+
2862
+								if (!empty($files)) {
2863
+									$extra_fields = !empty($type['extra_fields']) ? maybe_unserialize($type['extra_fields']) : NULL;
2864
+									$allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types'] ) ? $extra_fields['gd_file_types'] : '';
2865 2865
                                
2866
-                                    $file_paths = '';
2867
-                                    foreach ($files as $file) {
2868
-                                        if (!empty($file)) {
2869
-                                            $image_name_arr = explode('/', $file);
2870
-                                            $filename = end($image_name_arr);
2871
-
2872
-                                            $arr_file_type = wp_check_filetype($filename);
2873
-                                            if (empty($arr_file_type['ext']) || empty($arr_file_type['type'])) {
2874
-                                                continue;
2875
-                                            }
2876
-                                            $uploaded_file_type = $arr_file_type['type'];
2877
-                                            $uploaded_file_ext = $arr_file_type['ext'];
2866
+									$file_paths = '';
2867
+									foreach ($files as $file) {
2868
+										if (!empty($file)) {
2869
+											$image_name_arr = explode('/', $file);
2870
+											$filename = end($image_name_arr);
2871
+
2872
+											$arr_file_type = wp_check_filetype($filename);
2873
+											if (empty($arr_file_type['ext']) || empty($arr_file_type['type'])) {
2874
+												continue;
2875
+											}
2876
+											$uploaded_file_type = $arr_file_type['type'];
2877
+											$uploaded_file_ext = $arr_file_type['ext'];
2878 2878
                                             
2879
-                                            if (!empty($allowed_file_types) && !in_array($uploaded_file_ext, $allowed_file_types)) {
2880
-                                                continue; // Invalid file type.
2881
-                                            }
2882
-
2883
-                                            $image_file_types = array('image/jpg', 'image/jpeg', 'image/gif', 'image/png', 'image/bmp', 'image/x-icon');
2884
-
2885
-                                            // If the uploaded file is image
2886
-                                            if (in_array($uploaded_file_type, $image_file_types)) {
2887
-                                                $file_paths .= '<div class="geodir-custom-post-gallery" class="clearfix">';
2888
-                                                $file_paths .= '<a href="'.$file.'">';
2889
-                                                $file_paths .= geodir_show_image(array('src' => $file), 'thumbnail', false, false);
2890
-                                                $file_paths .= '</a>';
2891
-                                                $file_paths .= '</div>';
2892
-                                            } else {
2893
-                                                $ext_path = '_' . $html_var . '_';
2894
-                                                $filename = explode($ext_path, $filename);
2895
-                                                $file_paths .= '<a href="' . $file . '" target="_blank">' . $filename[count($filename) - 1] . '</a>';
2896
-                                            }
2897
-                                        }
2898
-                                    }
2899
-
2900
-                                    if (strpos($field_icon, 'http') !== false) {
2901
-                                        $field_icon_af = '';
2902
-                                    } else if ($field_icon == '') {
2903
-                                        $field_icon_af = '';
2904
-                                    } else {
2905
-                                        $field_icon_af = $field_icon;
2906
-                                        $field_icon = '';
2907
-                                    }
2908
-
2909
-                                    $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2910
-
2911
-
2912
-                                    $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . ' geodir-custom-file-box" style="clear:both;"><span class="geodir-i-file" style="display:inline-block;vertical-align:top;padding-right:14px;' . $field_icon . '">' . $field_icon_af;
2913
-
2914
-                                    if ($field_set_start == 1 && $site_title != '') {
2915
-                                        $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2916
-                                    }
2917
-
2918
-                                    $html .= ' </span>' . $file_paths . '</div>';
2919
-                                }
2920
-                            }
2921
-                        }
2922
-                            break;
2923
-                    }
2924
-
2925
-
2926
-                    /**
2927
-                     * Filter custom field output in tab.
2928
-                     *
2929
-                     * @since 1.5.6
2930
-                     *
2931
-                     * @param string $html_var The HTML variable name for the field.
2932
-                     * @param string $html Custom field unfiltered HTML.
2933
-                     * @param array $variables_array Custom field variables array.
2934
-                     */
2935
-                    $html = apply_filters("geodir_tab_show_{$html_var}", $html, $variables_array);
2936
-
2937
-                    $fieldset_html = '';
2938
-                    if ($field_set_start == 1) {
2939
-                        $add_html = false;
2940
-                        if ($type['type'] == 'fieldset' && $fieldset_count > 1) {
2941
-                            if ($fieldset != '') {
2942
-                                $add_html = true;
2943
-                                $label = $fieldset_arr[$fieldset_count - 1]['label'];
2944
-                                $htmlvar_name = $fieldset_arr[$fieldset_count - 1]['htmlvar_name'];
2945
-                            }
2946
-                            $fieldset_html = $fieldset;
2947
-                            $fieldset = '';
2948
-                        } else {
2949
-                            $fieldset .= $html;
2950
-                            if ($total_fields == $count_field && $fieldset != '') {
2951
-                                $add_html = true;
2952
-                                $label = $fieldset_arr[$fieldset_count]['label'];
2953
-                                $htmlvar_name = $fieldset_arr[$fieldset_count]['htmlvar_name'];
2954
-                                $fieldset_html = $fieldset;
2955
-                            }
2956
-                        }
2957
-
2958
-                        if ($add_html) {
2959
-                            $tabs_arr[$htmlvar_name] = array(
2960
-                                'heading_text' => __($label, 'geodirectory'),
2961
-                                'is_active_tab' => false,
2962
-                                /**
2963
-                                 * Filter if a custom field should be displayed on the details page tab.
2964
-                                 *
2965
-                                 * @since 1.0.0
2966
-                                 * @param string $htmlvar_name The field HTML var name.
2967
-                                 */
2968
-                                'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, $htmlvar_name),
2969
-                                'tab_content' => '<div class="geodir-company_info field-group">' . $fieldset_html . '</html>'
2970
-                            );
2971
-                        }
2972
-                    } else {
2973
-                        if ($html != '') {
2974
-                            $tabs_arr[$field['htmlvar_name']] = array(
2975
-                                'heading_text' => __($label, 'geodirectory'),
2976
-                                'is_active_tab' => false,
2977
-                                /** This action is documented in geodirectory_hooks_actions.php */
2978
-                                'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, $field['htmlvar_name']),
2979
-                                'tab_content' => $html
2980
-                            );
2981
-                        }
2982
-                    }
2983
-                }
2984
-            }
2985
-        }
2986
-    }
2987
-    return $tabs_arr;
2879
+											if (!empty($allowed_file_types) && !in_array($uploaded_file_ext, $allowed_file_types)) {
2880
+												continue; // Invalid file type.
2881
+											}
2882
+
2883
+											$image_file_types = array('image/jpg', 'image/jpeg', 'image/gif', 'image/png', 'image/bmp', 'image/x-icon');
2884
+
2885
+											// If the uploaded file is image
2886
+											if (in_array($uploaded_file_type, $image_file_types)) {
2887
+												$file_paths .= '<div class="geodir-custom-post-gallery" class="clearfix">';
2888
+												$file_paths .= '<a href="'.$file.'">';
2889
+												$file_paths .= geodir_show_image(array('src' => $file), 'thumbnail', false, false);
2890
+												$file_paths .= '</a>';
2891
+												$file_paths .= '</div>';
2892
+											} else {
2893
+												$ext_path = '_' . $html_var . '_';
2894
+												$filename = explode($ext_path, $filename);
2895
+												$file_paths .= '<a href="' . $file . '" target="_blank">' . $filename[count($filename) - 1] . '</a>';
2896
+											}
2897
+										}
2898
+									}
2899
+
2900
+									if (strpos($field_icon, 'http') !== false) {
2901
+										$field_icon_af = '';
2902
+									} else if ($field_icon == '') {
2903
+										$field_icon_af = '';
2904
+									} else {
2905
+										$field_icon_af = $field_icon;
2906
+										$field_icon = '';
2907
+									}
2908
+
2909
+									$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2910
+
2911
+
2912
+									$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . ' geodir-custom-file-box" style="clear:both;"><span class="geodir-i-file" style="display:inline-block;vertical-align:top;padding-right:14px;' . $field_icon . '">' . $field_icon_af;
2913
+
2914
+									if ($field_set_start == 1 && $site_title != '') {
2915
+										$html .= ' ' . __($site_title, 'geodirectory') . ': ';
2916
+									}
2917
+
2918
+									$html .= ' </span>' . $file_paths . '</div>';
2919
+								}
2920
+							}
2921
+						}
2922
+							break;
2923
+					}
2924
+
2925
+
2926
+					/**
2927
+					 * Filter custom field output in tab.
2928
+					 *
2929
+					 * @since 1.5.6
2930
+					 *
2931
+					 * @param string $html_var The HTML variable name for the field.
2932
+					 * @param string $html Custom field unfiltered HTML.
2933
+					 * @param array $variables_array Custom field variables array.
2934
+					 */
2935
+					$html = apply_filters("geodir_tab_show_{$html_var}", $html, $variables_array);
2936
+
2937
+					$fieldset_html = '';
2938
+					if ($field_set_start == 1) {
2939
+						$add_html = false;
2940
+						if ($type['type'] == 'fieldset' && $fieldset_count > 1) {
2941
+							if ($fieldset != '') {
2942
+								$add_html = true;
2943
+								$label = $fieldset_arr[$fieldset_count - 1]['label'];
2944
+								$htmlvar_name = $fieldset_arr[$fieldset_count - 1]['htmlvar_name'];
2945
+							}
2946
+							$fieldset_html = $fieldset;
2947
+							$fieldset = '';
2948
+						} else {
2949
+							$fieldset .= $html;
2950
+							if ($total_fields == $count_field && $fieldset != '') {
2951
+								$add_html = true;
2952
+								$label = $fieldset_arr[$fieldset_count]['label'];
2953
+								$htmlvar_name = $fieldset_arr[$fieldset_count]['htmlvar_name'];
2954
+								$fieldset_html = $fieldset;
2955
+							}
2956
+						}
2957
+
2958
+						if ($add_html) {
2959
+							$tabs_arr[$htmlvar_name] = array(
2960
+								'heading_text' => __($label, 'geodirectory'),
2961
+								'is_active_tab' => false,
2962
+								/**
2963
+								 * Filter if a custom field should be displayed on the details page tab.
2964
+								 *
2965
+								 * @since 1.0.0
2966
+								 * @param string $htmlvar_name The field HTML var name.
2967
+								 */
2968
+								'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, $htmlvar_name),
2969
+								'tab_content' => '<div class="geodir-company_info field-group">' . $fieldset_html . '</html>'
2970
+							);
2971
+						}
2972
+					} else {
2973
+						if ($html != '') {
2974
+							$tabs_arr[$field['htmlvar_name']] = array(
2975
+								'heading_text' => __($label, 'geodirectory'),
2976
+								'is_active_tab' => false,
2977
+								/** This action is documented in geodirectory_hooks_actions.php */
2978
+								'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, $field['htmlvar_name']),
2979
+								'tab_content' => $html
2980
+							);
2981
+						}
2982
+					}
2983
+				}
2984
+			}
2985
+		}
2986
+	}
2987
+	return $tabs_arr;
2988 2988
 }
2989 2989
 
2990 2990
 /* display add listing page for wpml */
@@ -3008,37 +3008,37 @@  discard block
 block discarded – undo
3008 3008
  */
3009 3009
 function geodir_add_post_status_author_page()
3010 3010
 {
3011
-    global $wpdb, $post;
3012
-
3013
-    $html = '';
3014
-    if (get_current_user_id()) {
3015
-        if (geodir_is_page('author') && !empty($post) && isset($post->post_author) && $post->post_author == get_current_user_id()) {
3016
-
3017
-            // we need to query real status direct as we dynamically change the status for author on author page so even non author status can view them.
3018
-            $real_status = $wpdb->get_var("SELECT post_status from $wpdb->posts WHERE ID=$post->ID");
3019
-            $status = "<strong>(";
3020
-            $status_icon = '<i class="fa fa-play"></i>';
3021
-            if ($real_status == 'publish') {
3022
-                $status .= __('Published', 'geodirectory');
3023
-            } else {
3024
-                $status .= __('Not published', 'geodirectory');
3025
-                $status_icon = '<i class="fa fa-pause"></i>';
3026
-            }
3027
-            $status .= ")</strong>";
3011
+	global $wpdb, $post;
3012
+
3013
+	$html = '';
3014
+	if (get_current_user_id()) {
3015
+		if (geodir_is_page('author') && !empty($post) && isset($post->post_author) && $post->post_author == get_current_user_id()) {
3016
+
3017
+			// we need to query real status direct as we dynamically change the status for author on author page so even non author status can view them.
3018
+			$real_status = $wpdb->get_var("SELECT post_status from $wpdb->posts WHERE ID=$post->ID");
3019
+			$status = "<strong>(";
3020
+			$status_icon = '<i class="fa fa-play"></i>';
3021
+			if ($real_status == 'publish') {
3022
+				$status .= __('Published', 'geodirectory');
3023
+			} else {
3024
+				$status .= __('Not published', 'geodirectory');
3025
+				$status_icon = '<i class="fa fa-pause"></i>';
3026
+			}
3027
+			$status .= ")</strong>";
3028 3028
 
3029
-            $html = '<span class="geodir-post-status">' . $status_icon . ' <font class="geodir-status-label">' . __('Status: ', 'geodirectory') . '</font>' . $status . '</span>';
3030
-        }
3031
-    }
3029
+			$html = '<span class="geodir-post-status">' . $status_icon . ' <font class="geodir-status-label">' . __('Status: ', 'geodirectory') . '</font>' . $status . '</span>';
3030
+		}
3031
+	}
3032 3032
 
3033
-    if ($html != '') {
3034
-        /**
3035
-         * Filter the post status text on the author page.
3036
-         *
3037
-         * @since 1.0.0
3038
-         * @param string $html The HTML of the status.
3039
-         */
3040
-        echo apply_filters('geodir_filter_status_text_on_author_page', $html);
3041
-    }
3033
+	if ($html != '') {
3034
+		/**
3035
+		 * Filter the post status text on the author page.
3036
+		 *
3037
+		 * @since 1.0.0
3038
+		 * @param string $html The HTML of the status.
3039
+		 */
3040
+		echo apply_filters('geodir_filter_status_text_on_author_page', $html);
3041
+	}
3042 3042
 
3043 3043
 
3044 3044
 }
@@ -3052,21 +3052,21 @@  discard block
 block discarded – undo
3052 3052
  */
3053 3053
 function geodir_init_no_rating()
3054 3054
 {
3055
-    if (get_option('geodir_disable_rating')) {
3056
-        remove_action('comment_form_logged_in_after', 'geodir_comment_rating_fields');
3057
-        remove_action('comment_form_before_fields', 'geodir_comment_rating_fields');
3058
-        remove_action('comment_form_logged_in_after', 'geodir_reviewrating_comment_rating_fields');
3059
-        remove_action('comment_form_before_fields', 'geodir_reviewrating_comment_rating_fields');
3060
-        remove_action('add_meta_boxes_comment', 'geodir_comment_add_meta_box');
3061
-        remove_action('add_meta_boxes', 'geodir_reviewrating_comment_metabox', 13);
3062
-        remove_filter('comment_text', 'geodir_wrap_comment_text', 40);
3063
-
3064
-        add_action('comment_form_logged_in_after', 'geodir_no_rating_rating_fields');
3065
-        add_action('comment_form_before_fields', 'geodir_no_rating_rating_fields');
3066
-        add_filter('comment_text', 'geodir_no_rating_comment_text', 100, 2);
3067
-        add_filter('geodir_detail_page_review_rating_html', 'geodir_no_rating_review_rating_html', 100);
3068
-        add_filter('geodir_get_sort_options', 'geodir_no_rating_get_sort_options', 100, 2);
3069
-    }
3055
+	if (get_option('geodir_disable_rating')) {
3056
+		remove_action('comment_form_logged_in_after', 'geodir_comment_rating_fields');
3057
+		remove_action('comment_form_before_fields', 'geodir_comment_rating_fields');
3058
+		remove_action('comment_form_logged_in_after', 'geodir_reviewrating_comment_rating_fields');
3059
+		remove_action('comment_form_before_fields', 'geodir_reviewrating_comment_rating_fields');
3060
+		remove_action('add_meta_boxes_comment', 'geodir_comment_add_meta_box');
3061
+		remove_action('add_meta_boxes', 'geodir_reviewrating_comment_metabox', 13);
3062
+		remove_filter('comment_text', 'geodir_wrap_comment_text', 40);
3063
+
3064
+		add_action('comment_form_logged_in_after', 'geodir_no_rating_rating_fields');
3065
+		add_action('comment_form_before_fields', 'geodir_no_rating_rating_fields');
3066
+		add_filter('comment_text', 'geodir_no_rating_comment_text', 100, 2);
3067
+		add_filter('geodir_detail_page_review_rating_html', 'geodir_no_rating_review_rating_html', 100);
3068
+		add_filter('geodir_get_sort_options', 'geodir_no_rating_get_sort_options', 100, 2);
3069
+	}
3070 3070
 }
3071 3071
 
3072 3072
 /**
@@ -3078,20 +3078,20 @@  discard block
 block discarded – undo
3078 3078
  */
3079 3079
 function geodir_no_rating_rating_fields()
3080 3080
 {
3081
-    global $post;
3081
+	global $post;
3082 3082
 
3083
-    $post_types = geodir_get_posttypes();
3083
+	$post_types = geodir_get_posttypes();
3084 3084
 
3085
-    if (!empty($post) && isset($post->post_type) && in_array($post->post_type, $post_types)) {
3086
-        if (is_plugin_active('geodir_review_rating_manager/geodir_review_rating_manager.php')) {
3087
-            echo '<input type="hidden" value="1" name="geodir_rating[overall]" />';
3088
-            if (get_option('geodir_reviewrating_enable_images')) {
3089
-                geodir_reviewrating_rating_img_html();
3090
-            }
3091
-        } else {
3092
-            echo '<input type="hidden" id="geodir_overallrating" name="geodir_overallrating" value="1" />';
3093
-        }
3094
-    }
3085
+	if (!empty($post) && isset($post->post_type) && in_array($post->post_type, $post_types)) {
3086
+		if (is_plugin_active('geodir_review_rating_manager/geodir_review_rating_manager.php')) {
3087
+			echo '<input type="hidden" value="1" name="geodir_rating[overall]" />';
3088
+			if (get_option('geodir_reviewrating_enable_images')) {
3089
+				geodir_reviewrating_rating_img_html();
3090
+			}
3091
+		} else {
3092
+			echo '<input type="hidden" id="geodir_overallrating" name="geodir_overallrating" value="1" />';
3093
+		}
3094
+	}
3095 3095
 }
3096 3096
 
3097 3097
 /**
@@ -3105,11 +3105,11 @@  discard block
 block discarded – undo
3105 3105
  */
3106 3106
 function geodir_no_rating_comment_text($content, $comment = '')
3107 3107
 {
3108
-    if (!is_admin()) {
3109
-        return '<div class="description">' . $content . '</div>';
3110
-    } else {
3111
-        return $content;
3112
-    }
3108
+	if (!is_admin()) {
3109
+		return '<div class="description">' . $content . '</div>';
3110
+	} else {
3111
+		return $content;
3112
+	}
3113 3113
 }
3114 3114
 
3115 3115
 /**
@@ -3122,7 +3122,7 @@  discard block
 block discarded – undo
3122 3122
  */
3123 3123
 function geodir_no_rating_review_rating_html($content = '')
3124 3124
 {
3125
-    return NULL;
3125
+	return NULL;
3126 3126
 }
3127 3127
 
3128 3128
 /**
@@ -3136,19 +3136,19 @@  discard block
 block discarded – undo
3136 3136
  */
3137 3137
 function geodir_no_rating_get_sort_options($options, $post_type = '')
3138 3138
 {
3139
-    $new_options = array();
3140
-    if (!empty($options)) {
3141
-        foreach ($options as $option) {
3142
-            if (is_object($option) && isset($option->htmlvar_name) && $option->htmlvar_name == 'overall_rating') {
3143
-                continue;
3144
-            }
3145
-            $new_options[] = $option;
3146
-        }
3139
+	$new_options = array();
3140
+	if (!empty($options)) {
3141
+		foreach ($options as $option) {
3142
+			if (is_object($option) && isset($option->htmlvar_name) && $option->htmlvar_name == 'overall_rating') {
3143
+				continue;
3144
+			}
3145
+			$new_options[] = $option;
3146
+		}
3147 3147
 
3148
-        $options = $new_options;
3149
-    }
3148
+		$options = $new_options;
3149
+	}
3150 3150
 
3151
-    return $options;
3151
+	return $options;
3152 3152
 }
3153 3153
 
3154 3154
 add_filter('geodir_all_js_msg', 'geodir_all_js_msg_no_rating', 100);
@@ -3162,11 +3162,11 @@  discard block
 block discarded – undo
3162 3162
  */
3163 3163
 function geodir_all_js_msg_no_rating($msg = array())
3164 3164
 {
3165
-    if (get_option('geodir_disable_rating')) {
3166
-        $msg['gd_cmt_no_rating'] = true;
3167
-    }
3165
+	if (get_option('geodir_disable_rating')) {
3166
+		$msg['gd_cmt_no_rating'] = true;
3167
+	}
3168 3168
 
3169
-    return $msg;
3169
+	return $msg;
3170 3170
 }
3171 3171
 
3172 3172
 add_filter('body_class', 'geodir_body_class_no_rating', 100);
@@ -3180,13 +3180,13 @@  discard block
 block discarded – undo
3180 3180
  */
3181 3181
 function geodir_body_class_no_rating($classes = array())
3182 3182
 {
3183
-    if (get_option('geodir_disable_rating')) {
3184
-        $classes[] = 'gd-no-rating';
3185
-    }
3183
+	if (get_option('geodir_disable_rating')) {
3184
+		$classes[] = 'gd-no-rating';
3185
+	}
3186 3186
     
3187
-    $classes[] = 'gd-map-' . geodir_map_name();
3187
+	$classes[] = 'gd-map-' . geodir_map_name();
3188 3188
 
3189
-    return $classes;
3189
+	return $classes;
3190 3190
 }
3191 3191
 
3192 3192
 add_filter('admin_body_class', 'geodir_admin_body_class_no_rating', 100);
@@ -3200,13 +3200,13 @@  discard block
 block discarded – undo
3200 3200
  */
3201 3201
 function geodir_admin_body_class_no_rating($class = '')
3202 3202
 {
3203
-    if (get_option('geodir_disable_rating')) {
3204
-        $class .= ' gd-no-rating';
3205
-    }
3203
+	if (get_option('geodir_disable_rating')) {
3204
+		$class .= ' gd-no-rating';
3205
+	}
3206 3206
     
3207
-    $class .= ' gd-map-' . geodir_map_name();
3207
+	$class .= ' gd-map-' . geodir_map_name();
3208 3208
 
3209
-    return $class;
3209
+	return $class;
3210 3210
 }
3211 3211
 
3212 3212
 add_action('wp_head', 'geodir_wp_head_no_rating');
@@ -3219,10 +3219,10 @@  discard block
 block discarded – undo
3219 3219
  */
3220 3220
 function geodir_wp_head_no_rating()
3221 3221
 {
3222
-    if (get_option('geodir_disable_rating')) {
3223
-        echo '<style>body .geodir-rating, body .geodir-bubble-rating, body .gd_ratings_module_box{display:none!important;}</style>';
3224
-        echo '<script type="text/javascript">jQuery(function(){jQuery(".gd_rating_show").parent(".geodir-rating").remove();});</script>';
3225
-    }
3222
+	if (get_option('geodir_disable_rating')) {
3223
+		echo '<style>body .geodir-rating, body .geodir-bubble-rating, body .gd_ratings_module_box{display:none!important;}</style>';
3224
+		echo '<script type="text/javascript">jQuery(function(){jQuery(".gd_rating_show").parent(".geodir-rating").remove();});</script>';
3225
+	}
3226 3226
 }
3227 3227
 
3228 3228
 add_filter('geodir_load_db_language', 'geodir_load_custom_field_translation');
@@ -3239,36 +3239,36 @@  discard block
 block discarded – undo
3239 3239
  * @return array Translation texts.
3240 3240
  */
3241 3241
 function geodir_load_gd_options_text_translation($translation_texts = array()) {
3242
-    $translation_texts = !empty( $translation_texts ) && is_array( $translation_texts ) ? $translation_texts : array();
3243
-
3244
-    $gd_options = array('geodir_post_submited_success_email_subject_admin', 'geodir_post_submited_success_email_content_admin', 'geodir_post_submited_success_email_subject', 'geodir_post_submited_success_email_content', 'geodir_forgot_password_subject', 'geodir_forgot_password_content', 'geodir_registration_success_email_subject', 'geodir_registration_success_email_content', 'geodir_post_published_email_subject', 'geodir_post_published_email_content', 'geodir_email_friend_subject', 'geodir_email_friend_content', 'geodir_email_enquiry_subject', 'geodir_email_enquiry_content', 'geodir_post_added_success_msg_content', 'geodir_post_edited_email_subject_admin', 'geodir_post_edited_email_content_admin');
3245
-
3246
-    /**
3247
-     * Filters the geodirectory option names that requires to add for translation.
3248
-     *
3249
-     * @since 1.5.7
3250
-     * @package GeoDirectory
3251
-     *
3252
-     * @param  array $gd_options Array of option names.
3253
-     */
3254
-    $gd_options = apply_filters('geodir_gd_options_for_translation', $gd_options);
3255
-    $gd_options = array_unique($gd_options);
3256
-
3257
-    if (!empty($gd_options)) {
3258
-        foreach ($gd_options as $gd_option) {
3259
-            if ($gd_option != '' && $option_value = get_option($gd_option)) {
3260
-                $option_value = is_string($option_value) ? stripslashes_deep($option_value) : '';
3242
+	$translation_texts = !empty( $translation_texts ) && is_array( $translation_texts ) ? $translation_texts : array();
3243
+
3244
+	$gd_options = array('geodir_post_submited_success_email_subject_admin', 'geodir_post_submited_success_email_content_admin', 'geodir_post_submited_success_email_subject', 'geodir_post_submited_success_email_content', 'geodir_forgot_password_subject', 'geodir_forgot_password_content', 'geodir_registration_success_email_subject', 'geodir_registration_success_email_content', 'geodir_post_published_email_subject', 'geodir_post_published_email_content', 'geodir_email_friend_subject', 'geodir_email_friend_content', 'geodir_email_enquiry_subject', 'geodir_email_enquiry_content', 'geodir_post_added_success_msg_content', 'geodir_post_edited_email_subject_admin', 'geodir_post_edited_email_content_admin');
3245
+
3246
+	/**
3247
+	 * Filters the geodirectory option names that requires to add for translation.
3248
+	 *
3249
+	 * @since 1.5.7
3250
+	 * @package GeoDirectory
3251
+	 *
3252
+	 * @param  array $gd_options Array of option names.
3253
+	 */
3254
+	$gd_options = apply_filters('geodir_gd_options_for_translation', $gd_options);
3255
+	$gd_options = array_unique($gd_options);
3256
+
3257
+	if (!empty($gd_options)) {
3258
+		foreach ($gd_options as $gd_option) {
3259
+			if ($gd_option != '' && $option_value = get_option($gd_option)) {
3260
+				$option_value = is_string($option_value) ? stripslashes_deep($option_value) : '';
3261 3261
                 
3262
-                if ($option_value != '' && !in_array($option_value, $translation_texts)) {
3263
-                    $translation_texts[] = stripslashes_deep($option_value);
3264
-                }
3265
-            }
3266
-        }
3267
-    }
3262
+				if ($option_value != '' && !in_array($option_value, $translation_texts)) {
3263
+					$translation_texts[] = stripslashes_deep($option_value);
3264
+				}
3265
+			}
3266
+		}
3267
+	}
3268 3268
 
3269
-    $translation_texts = !empty($translation_texts) ? array_unique($translation_texts) : $translation_texts;
3269
+	$translation_texts = !empty($translation_texts) ? array_unique($translation_texts) : $translation_texts;
3270 3270
 
3271
-    return $translation_texts;
3271
+	return $translation_texts;
3272 3272
 }
3273 3273
 
3274 3274
 add_filter('geodir_load_db_language', 'geodir_load_gd_options_text_translation');
Please login to merge, or discard this patch.
Spacing   +175 added lines, -175 removed lines patch added patch discarded remove patch
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 /* ON TEMPLATE INCLUDE */
137 137
 /////////////////////////
138 138
 
139
-add_filter('template_include', 'geodir_template_loader',9);
139
+add_filter('template_include', 'geodir_template_loader', 9);
140 140
 
141 141
 /////////////////////////
142 142
 /* CATEGORY / TAXONOMY / CUSTOM POST ACTIONS */
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
 ////////////////////////
178 178
 
179 179
 add_action('geodir_update_postrating', 'geodir_term_review_count_force_update', 100);
180
-add_action('transition_post_status', 'geodir_term_review_count_force_update', 100,3);
180
+add_action('transition_post_status', 'geodir_term_review_count_force_update', 100, 3);
181 181
 add_action('created_term', 'geodir_term_review_count_force_update', 100);
182 182
 add_action('edited_term', 'geodir_term_review_count_force_update', 100);
183 183
 add_action('delete_term', 'geodir_term_review_count_force_update', 100);
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
  */
222 222
 function geodir_unset_prev_theme_nav_location($newname)
223 223
 {
224
-    $geodir_theme_location = get_option('geodir_theme_location_nav_' . $newname);
224
+    $geodir_theme_location = get_option('geodir_theme_location_nav_'.$newname);
225 225
     if ($geodir_theme_location) {
226 226
         update_option('geodir_theme_location_nav', $geodir_theme_location);
227 227
     } else {
@@ -319,8 +319,8 @@  discard block
 block discarded – undo
319 319
 
320 320
 /////// GEO DIRECOTORY CUSTOM HOOKS ///
321 321
 
322
-add_action('geodir_before_tab_content', 'geodir_before_tab_content');// this function is in custom_functions.php and it is used to wrap detail page tab content 
323
-add_action('geodir_after_tab_content', 'geodir_after_tab_content');// this function is in custom_functions.php and it is used to wrap detail page tab content
322
+add_action('geodir_before_tab_content', 'geodir_before_tab_content'); // this function is in custom_functions.php and it is used to wrap detail page tab content 
323
+add_action('geodir_after_tab_content', 'geodir_after_tab_content'); // this function is in custom_functions.php and it is used to wrap detail page tab content
324 324
 
325 325
 // Detail page sidebar content 
326 326
 add_action('geodir_detail_page_sidebar', 'geodir_detail_page_sidebar_content_sorting', 1);
@@ -421,8 +421,8 @@  discard block
 block discarded – undo
421 421
     do_action('geodir_after_social_sharing_buttons');
422 422
     $content_html = ob_get_clean();
423 423
     if (trim($content_html) != '')
424
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-social-sharing">' . $content_html . '</div>';
425
-    if ((int)get_option('geodir_disable_tfg_buttons_section') != 1) {
424
+        $content_html = '<div class="geodir-company_info geodir-details-sidebar-social-sharing">'.$content_html.'</div>';
425
+    if ((int) get_option('geodir_disable_tfg_buttons_section') != 1) {
426 426
         /**
427 427
          * Filter the geodir_social_sharing_buttons() function content.
428 428
          *
@@ -468,8 +468,8 @@  discard block
 block discarded – undo
468 468
     do_action('geodir_after_share_this_button');
469 469
     $content_html = ob_get_clean();
470 470
     if (trim($content_html) != '')
471
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-sharethis">' . $content_html . '</div>';
472
-    if ((int)get_option('geodir_disable_sharethis_button_section') != 1) {
471
+        $content_html = '<div class="geodir-company_info geodir-details-sidebar-sharethis">'.$content_html.'</div>';
472
+    if ((int) get_option('geodir_disable_sharethis_button_section') != 1) {
473 473
         /**
474 474
          * Filter the geodir_share_this_button() function content.
475 475
          *
@@ -508,12 +508,12 @@  discard block
 block discarded – undo
508 508
             $post_id = $post->ID;
509 509
             
510 510
             if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
511
-                $post_id = (int)$_REQUEST['pid'];
511
+                $post_id = (int) $_REQUEST['pid'];
512 512
             }
513 513
 
514 514
             $postlink = get_permalink(geodir_add_listing_page_id());
515 515
             $editlink = geodir_getlink($postlink, array('pid' => $post_id), false);
516
-            echo ' <p class="edit_link"><i class="fa fa-pencil"></i> <a href="' . esc_url($editlink) . '">' . __('Edit this Post', 'geodirectory') . '</a></p>';
516
+            echo ' <p class="edit_link"><i class="fa fa-pencil"></i> <a href="'.esc_url($editlink).'">'.__('Edit this Post', 'geodirectory').'</a></p>';
517 517
         }
518 518
     }// end of if, if its a preview or not
519 519
     /**
@@ -524,8 +524,8 @@  discard block
 block discarded – undo
524 524
     do_action('geodir_after_edit_post_link');
525 525
     $content_html = ob_get_clean();
526 526
     if (trim($content_html) != '')
527
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-user-links">' . $content_html . '</div>';
528
-    if ((int)get_option('geodir_disable_user_links_section') != 1) {
527
+        $content_html = '<div class="geodir-company_info geodir-details-sidebar-user-links">'.$content_html.'</div>';
528
+    if ((int) get_option('geodir_disable_user_links_section') != 1) {
529 529
         /**
530 530
          * Filter the geodir_edit_post_link() function content.
531 531
          *
@@ -578,14 +578,14 @@  discard block
 block discarded – undo
578 578
     $hide_refresh = get_option('geodir_ga_auto_refresh');
579 579
     
580 580
     $auto_refresh = $hide_refresh && $refresh_time && $refresh_time > 0 ? 1 : 0;
581
-    if (get_option('geodir_ga_stats') && is_user_logged_in() &&  (isset($package_info->google_analytics) && $package_info->google_analytics == '1') && (get_current_user_id()==$post->post_author || current_user_can( 'manage_options' )) ) {
581
+    if (get_option('geodir_ga_stats') && is_user_logged_in() && (isset($package_info->google_analytics) && $package_info->google_analytics == '1') && (get_current_user_id() == $post->post_author || current_user_can('manage_options'))) {
582 582
         $page_url = urlencode($_SERVER['REQUEST_URI']);
583 583
         ?>
584 584
         <script type="text/javascript">
585 585
             var gd_gaTimeOut;
586
-            var gd_gaTime = parseInt('<?php echo $refresh_time;?>');
587
-            var gd_gaHideRefresh = <?php echo (int)$hide_refresh;?>;
588
-            var gd_gaAutoRefresh = <?php echo $auto_refresh;?>;
586
+            var gd_gaTime = parseInt('<?php echo $refresh_time; ?>');
587
+            var gd_gaHideRefresh = <?php echo (int) $hide_refresh; ?>;
588
+            var gd_gaAutoRefresh = <?php echo $auto_refresh; ?>;
589 589
             ga_data1 = false;
590 590
             ga_data2 = false;
591 591
             ga_data3 = false;
@@ -726,7 +726,7 @@  discard block
 block discarded – undo
726 726
             }
727 727
 
728 728
             function gdga_noResults() {
729
-                jQuery('#gdga-chart-container').html('<?php _e('No results available','geodirectory');?>');
729
+                jQuery('#gdga-chart-container').html('<?php _e('No results available', 'geodirectory'); ?>');
730 730
                 jQuery('#gdga-legend-container').html('');
731 731
             }
732 732
 
@@ -758,18 +758,18 @@  discard block
 block discarded – undo
758 758
                     var data2 = results[1].rows.map(function(row) { return +row[2]; });
759 759
                     //var labelsN = results[0].rows.map(function(row) { return +row[1]; });
760 760
 
761
-                    var labels = ['<?php _e('Jan', 'geodirectory');?>',
762
-                        '<?php _e('Feb', 'geodirectory');?>',
763
-                        '<?php _e('Mar', 'geodirectory');?>',
764
-                        '<?php _e('Apr', 'geodirectory');?>',
765
-                        '<?php _e('May', 'geodirectory');?>',
766
-                        '<?php _e('Jun', 'geodirectory');?>',
767
-                        '<?php _e('Jul', 'geodirectory');?>',
768
-                        '<?php _e('Aug', 'geodirectory');?>',
769
-                        '<?php _e('Sep', 'geodirectory');?>',
770
-                        '<?php _e('Oct', 'geodirectory');?>',
771
-                        '<?php _e('Nov', 'geodirectory');?>',
772
-                        '<?php _e('Dec', 'geodirectory');?>'];
761
+                    var labels = ['<?php _e('Jan', 'geodirectory'); ?>',
762
+                        '<?php _e('Feb', 'geodirectory'); ?>',
763
+                        '<?php _e('Mar', 'geodirectory'); ?>',
764
+                        '<?php _e('Apr', 'geodirectory'); ?>',
765
+                        '<?php _e('May', 'geodirectory'); ?>',
766
+                        '<?php _e('Jun', 'geodirectory'); ?>',
767
+                        '<?php _e('Jul', 'geodirectory'); ?>',
768
+                        '<?php _e('Aug', 'geodirectory'); ?>',
769
+                        '<?php _e('Sep', 'geodirectory'); ?>',
770
+                        '<?php _e('Oct', 'geodirectory'); ?>',
771
+                        '<?php _e('Nov', 'geodirectory'); ?>',
772
+                        '<?php _e('Dec', 'geodirectory'); ?>'];
773 773
 
774 774
                     // Ensure the data arrays are at least as long as the labels array.
775 775
                     // Chart.js bar charts don't (yet) accept sparse datasets.
@@ -782,13 +782,13 @@  discard block
 block discarded – undo
782 782
                         labels : labels,
783 783
                         datasets : [
784 784
                             {
785
-                                label: '<?php _e('Last Year', 'geodirectory');?>',
785
+                                label: '<?php _e('Last Year', 'geodirectory'); ?>',
786 786
                                 fillColor : "rgba(220,220,220,0.5)",
787 787
                                 strokeColor : "rgba(220,220,220,1)",
788 788
                                 data : data2
789 789
                             },
790 790
                             {
791
-                                label: '<?php _e('This Year', 'geodirectory');?>',
791
+                                label: '<?php _e('This Year', 'geodirectory'); ?>',
792 792
                                 fillColor : "rgba(151,187,205,0.5)",
793 793
                                 strokeColor : "rgba(151,187,205,1)",
794 794
                                 data : data1
@@ -833,30 +833,30 @@  discard block
 block discarded – undo
833 833
 
834 834
                     <?php
835 835
                     // Here we list the shorthand days of the week so it can be used in translation.
836
-                    __("Mon",'geodirectory');
837
-                    __("Tue",'geodirectory');
838
-                    __("Wed",'geodirectory');
839
-                    __("Thu",'geodirectory');
840
-                    __("Fri",'geodirectory');
841
-                    __("Sat",'geodirectory');
842
-                    __("Sun",'geodirectory');
836
+                    __("Mon", 'geodirectory');
837
+                    __("Tue", 'geodirectory');
838
+                    __("Wed", 'geodirectory');
839
+                    __("Thu", 'geodirectory');
840
+                    __("Fri", 'geodirectory');
841
+                    __("Sat", 'geodirectory');
842
+                    __("Sun", 'geodirectory');
843 843
                     ?>
844 844
 
845 845
                     labels = [
846
-                        "<?php _e(date('D', strtotime("+1 day")),'geodirectory'); ?>",
847
-                        "<?php _e(date('D', strtotime("+2 day")),'geodirectory'); ?>",
848
-                        "<?php _e(date('D', strtotime("+3 day")),'geodirectory'); ?>",
849
-                        "<?php _e(date('D', strtotime("+4 day")),'geodirectory'); ?>",
850
-                        "<?php _e(date('D', strtotime("+5 day")),'geodirectory'); ?>",
851
-                        "<?php _e(date('D', strtotime("+6 day")),'geodirectory'); ?>",
852
-                        "<?php _e(date('D', strtotime("+7 day")),'geodirectory'); ?>"
846
+                        "<?php _e(date('D', strtotime("+1 day")), 'geodirectory'); ?>",
847
+                        "<?php _e(date('D', strtotime("+2 day")), 'geodirectory'); ?>",
848
+                        "<?php _e(date('D', strtotime("+3 day")), 'geodirectory'); ?>",
849
+                        "<?php _e(date('D', strtotime("+4 day")), 'geodirectory'); ?>",
850
+                        "<?php _e(date('D', strtotime("+5 day")), 'geodirectory'); ?>",
851
+                        "<?php _e(date('D', strtotime("+6 day")), 'geodirectory'); ?>",
852
+                        "<?php _e(date('D', strtotime("+7 day")), 'geodirectory'); ?>"
853 853
                     ];
854 854
 
855 855
                     var data = {
856 856
                         labels : labels,
857 857
                         datasets : [
858 858
                             {
859
-                                label: '<?php _e('Last Week', 'geodirectory');?>',
859
+                                label: '<?php _e('Last Week', 'geodirectory'); ?>',
860 860
                                 fillColor : "rgba(220,220,220,0.5)",
861 861
                                 strokeColor : "rgba(220,220,220,1)",
862 862
                                 pointColor : "rgba(220,220,220,1)",
@@ -864,7 +864,7 @@  discard block
 block discarded – undo
864 864
                                 data : data2
865 865
                             },
866 866
                             {
867
-                                label: '<?php _e('This Week', 'geodirectory');?>',
867
+                                label: '<?php _e('This Week', 'geodirectory'); ?>',
868 868
                                 fillColor : "rgba(151,187,205,0.5)",
869 869
                                 strokeColor : "rgba(151,187,205,1)",
870 870
                                 pointColor : "rgba(151,187,205,1)",
@@ -1071,18 +1071,18 @@  discard block
 block discarded – undo
1071 1071
         </style>
1072 1072
         <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.2/Chart.min.js"></script>
1073 1073
         <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.2/moment.min.js"></script>
1074
-        <button type="button" class="gdga-show-analytics"><?php _e('Show Google Analytics', 'geodirectory');?></button>
1074
+        <button type="button" class="gdga-show-analytics"><?php _e('Show Google Analytics', 'geodirectory'); ?></button>
1075 1075
         <span id="ga_stats" class="gdga-analytics-box" style="display:none">
1076
-            <div id="ga-analytics-title"><?php _e("Analytics", 'geodirectory');?></div>
1076
+            <div id="ga-analytics-title"><?php _e("Analytics", 'geodirectory'); ?></div>
1077 1077
             <div id="gd-active-users-container">
1078
-                <div class="gd-ActiveUsers"><i id="gdga-loader-icon" class="fa fa-refresh fa-spin" title="<?php esc_attr_e("Refresh", 'geodirectory');?>"></i><?php _e("Active Users:", 'geodirectory');?>
1078
+                <div class="gd-ActiveUsers"><i id="gdga-loader-icon" class="fa fa-refresh fa-spin" title="<?php esc_attr_e("Refresh", 'geodirectory'); ?>"></i><?php _e("Active Users:", 'geodirectory'); ?>
1079 1079
                     <b class="gd-ActiveUsers-value">0</b>
1080 1080
                 </div>
1081 1081
             </div>
1082 1082
             <select id="gdga-select-analytic" onchange="gdga_select_option();" style="display: none;">
1083
-                <option value="weeks"><?php _e("Last Week vs This Week", 'geodirectory');?></option>
1084
-                <option value="years"><?php _e("This Year vs Last Year", 'geodirectory');?></option>
1085
-                <option value="country"><?php _e("Top Countries", 'geodirectory');?></option>
1083
+                <option value="weeks"><?php _e("Last Week vs This Week", 'geodirectory'); ?></option>
1084
+                <option value="years"><?php _e("This Year vs Last Year", 'geodirectory'); ?></option>
1085
+                <option value="country"><?php _e("Top Countries", 'geodirectory'); ?></option>
1086 1086
             </select>
1087 1087
             <div class="Chartjs-figure" id="gdga-chart-container"></div>
1088 1088
             <ol class="Chartjs-legend" id="gdga-legend-container"></ol>
@@ -1098,8 +1098,8 @@  discard block
 block discarded – undo
1098 1098
     do_action('geodir_after_google_analytics');
1099 1099
     $content_html = ob_get_clean();
1100 1100
     if (trim($content_html) != '')
1101
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-google-analytics">' . $content_html . '</div>';
1102
-    if ((int)get_option('geodir_disable_google_analytics_section') != 1) {
1101
+        $content_html = '<div class="geodir-company_info geodir-details-sidebar-google-analytics">'.$content_html.'</div>';
1102
+    if ((int) get_option('geodir_disable_google_analytics_section') != 1) {
1103 1103
         /**
1104 1104
          * Filter the geodir_edit_post_link() function content.
1105 1105
          *
@@ -1153,10 +1153,10 @@  discard block
 block discarded – undo
1153 1153
        
1154 1154
 	   $reviews_text = $comment_count > 1 ? __("reviews", 'geodirectory') : __("review", 'geodirectory');
1155 1155
 	   
1156
-	   $html .= '<span itemprop="rating" itemscope itemtype="http://data-vocabulary.org/Rating"><span class="rating" itemprop="average" content="' . $post_avgratings . '">' . $post_avgratings . '</span> / <span itemprop="best" content="5">5</span> ' . __("based on", 'geodirectory') . ' </span><span class="count" itemprop="count" content="' . $comment_count . '">' . $comment_count . ' ' . $reviews_text . '</span><br />';
1156
+	   $html .= '<span itemprop="rating" itemscope itemtype="http://data-vocabulary.org/Rating"><span class="rating" itemprop="average" content="'.$post_avgratings.'">'.$post_avgratings.'</span> / <span itemprop="best" content="5">5</span> '.__("based on", 'geodirectory').' </span><span class="count" itemprop="count" content="'.$comment_count.'">'.$comment_count.' '.$reviews_text.'</span><br />';
1157 1157
 
1158 1158
         $html .= '<span class="item">';
1159
-        $html .= '<span class="fn" itemprop="itemreviewed">' . $post->post_title . '</span>';
1159
+        $html .= '<span class="fn" itemprop="itemreviewed">'.$post->post_title.'</span>';
1160 1160
 
1161 1161
         if ($post_images) {
1162 1162
             foreach ($post_images as $img) {
@@ -1166,7 +1166,7 @@  discard block
 block discarded – undo
1166 1166
         }
1167 1167
 
1168 1168
         if (isset($post_img) && $post_img) {
1169
-            $html .= '<br /><img src="' . $post_img . '" class="photo hreview-img" alt="' . esc_attr($post->post_title) . '" itemprop="photo" content="' . $post_img . '" class="photo hreview-img" />';
1169
+            $html .= '<br /><img src="'.$post_img.'" class="photo hreview-img" alt="'.esc_attr($post->post_title).'" itemprop="photo" content="'.$post_img.'" class="photo hreview-img" />';
1170 1170
         }
1171 1171
 
1172 1172
         $html .= '</span>';
@@ -1193,9 +1193,9 @@  discard block
 block discarded – undo
1193 1193
     do_action('geodir_after_detail_page_review_rating');
1194 1194
     $content_html = ob_get_clean();
1195 1195
     if (trim($content_html) != '') {
1196
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-rating">' . $content_html . '</div>';
1196
+        $content_html = '<div class="geodir-company_info geodir-details-sidebar-rating">'.$content_html.'</div>';
1197 1197
     }
1198
-    if ((int)get_option('geodir_disable_rating_info_section') != 1) {
1198
+    if ((int) get_option('geodir_disable_rating_info_section') != 1) {
1199 1199
         /**
1200 1200
          * Filter the geodir_detail_page_review_rating() function content.
1201 1201
          *
@@ -1234,8 +1234,8 @@  discard block
 block discarded – undo
1234 1234
 
1235 1235
     $content_html = ob_get_clean();
1236 1236
     if (trim($content_html) != '')
1237
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-listing-info">' . $content_html . '</div>';
1238
-    if ((int)get_option('geodir_disable_listing_info_section') != 1) {
1237
+        $content_html = '<div class="geodir-company_info geodir-details-sidebar-listing-info">'.$content_html.'</div>';
1238
+    if ((int) get_option('geodir_disable_listing_info_section') != 1) {
1239 1239
         /**
1240 1240
          * Filter the output html for function geodir_detail_page_more_info().
1241 1241
          *
@@ -1333,7 +1333,7 @@  discard block
 block discarded – undo
1333 1333
 		'gd_allowed_img_types' => !empty($allowed_img_types) ? implode(',', $allowed_img_types) : '',
1334 1334
 		'geodir_txt_form_wait' => __('Wait...', 'geodirectory'),
1335 1335
 		'geodir_txt_form_searching' => __('Searching...', 'geodirectory'),
1336
-		'fa_rating' => (int)get_option('geodir_reviewrating_enable_font_awesome') == 1 ? 1 : '',
1336
+		'fa_rating' => (int) get_option('geodir_reviewrating_enable_font_awesome') == 1 ? 1 : '',
1337 1337
 		'reviewrating' => defined('GEODIRREVIEWRATING_VERSION') ? 1 : '',
1338 1338
         'geodir_map_name' => geodir_map_name(),
1339 1339
     );
@@ -1351,10 +1351,10 @@  discard block
 block discarded – undo
1351 1351
     foreach ($arr_alert_msg as $key => $value) {
1352 1352
         if (!is_scalar($value))
1353 1353
             continue;
1354
-        $arr_alert_msg[$key] = html_entity_decode((string)$value, ENT_QUOTES, 'UTF-8');
1354
+        $arr_alert_msg[$key] = html_entity_decode((string) $value, ENT_QUOTES, 'UTF-8');
1355 1355
     }
1356 1356
 
1357
-    $script = "var geodir_all_js_msg = " . json_encode($arr_alert_msg) . ';';
1357
+    $script = "var geodir_all_js_msg = ".json_encode($arr_alert_msg).';';
1358 1358
     echo '<script>';
1359 1359
     echo $script;
1360 1360
     echo '</script>';
@@ -1527,7 +1527,7 @@  discard block
 block discarded – undo
1527 1527
         global $post;
1528 1528
         $term_condition = '';
1529 1529
         if (isset($_REQUEST['backandedit'])) {
1530
-            $post = (object)$gd_session->get('listing');
1530
+            $post = (object) $gd_session->get('listing');
1531 1531
             $term_condition = isset($post->geodir_accept_term_condition) ? $post->geodir_accept_term_condition : '';
1532 1532
         }
1533 1533
 
@@ -1541,7 +1541,7 @@  discard block
 block discarded – undo
1541 1541
                     echo 'checked="checked"';
1542 1542
                 } ?> field_type="checkbox" name="geodir_accept_term_condition" id="geodir_accept_term_condition"
1543 1543
                        class="geodir_textfield" value="1"
1544
-                       style="display:inline-block"/><a href="<?php $terms_page = get_option('geodir_term_condition_page'); if($terms_page){ echo get_permalink($terms_page);}?>" target="_blank"><?php _e('Please accept our terms and conditions', 'geodirectory'); ?></a>
1544
+                       style="display:inline-block"/><a href="<?php $terms_page = get_option('geodir_term_condition_page'); if ($terms_page) { echo get_permalink($terms_page); }?>" target="_blank"><?php _e('Please accept our terms and conditions', 'geodirectory'); ?></a>
1545 1545
 				</span>
1546 1546
             </div>
1547 1547
             <span class="geodir_message_error"><?php if (isset($required_msg)) {
@@ -1581,7 +1581,7 @@  discard block
 block discarded – undo
1581 1581
         /** This action is documented in geodirectory_template_actions.php */
1582 1582
         $desc_limit = apply_filters('geodir_description_field_desc_limit', '');
1583 1583
         
1584
-        if (!($desc_limit === '' || (int)$desc_limit > 0)) {
1584
+        if (!($desc_limit === '' || (int) $desc_limit > 0)) {
1585 1585
             $is_display = false;
1586 1586
         }
1587 1587
     }
@@ -1629,16 +1629,16 @@  discard block
 block discarded – undo
1629 1629
     global $wpdb, $plugin_prefix;
1630 1630
 	
1631 1631
 	// Remove unused virtual page
1632
-	$listings_page_id = (int)get_option('geodir_listing_page');
1632
+	$listings_page_id = (int) get_option('geodir_listing_page');
1633 1633
 	if ($listings_page_id) {
1634
-		$wpdb->query($wpdb->prepare("DELETE FROM " . $wpdb->posts . " WHERE ID=%d AND post_name = %s AND post_type=%s", array($listings_page_id, 'listings', 'page')));
1634
+		$wpdb->query($wpdb->prepare("DELETE FROM ".$wpdb->posts." WHERE ID=%d AND post_name = %s AND post_type=%s", array($listings_page_id, 'listings', 'page')));
1635 1635
         delete_option('geodir_listing_page');
1636 1636
 	}
1637 1637
 
1638 1638
     if (!get_option('geodir_changes_in_custom_fields_table')) {
1639 1639
         $wpdb->query(
1640 1640
             $wpdb->prepare(
1641
-                "UPDATE " . GEODIR_CUSTOM_FIELDS_TABLE . " SET is_default=%s, is_admin=%s WHERE is_default=%s",
1641
+                "UPDATE ".GEODIR_CUSTOM_FIELDS_TABLE." SET is_default=%s, is_admin=%s WHERE is_default=%s",
1642 1642
                 array('1', '1', 'admin')
1643 1643
             )
1644 1644
         );
@@ -1646,9 +1646,9 @@  discard block
 block discarded – undo
1646 1646
 
1647 1647
         /* --- terms meta value set --- */
1648 1648
 
1649
-        update_option('geodir_default_marker_icon', geodir_plugin_url() . '/geodirectory-functions/map-functions/icons/pin.png');
1649
+        update_option('geodir_default_marker_icon', geodir_plugin_url().'/geodirectory-functions/map-functions/icons/pin.png');
1650 1650
 
1651
-        $options_data = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "options WHERE option_name LIKE %s", array('%tax_meta_%')));
1651
+        $options_data = $wpdb->get_results($wpdb->prepare("SELECT * FROM ".$wpdb->prefix."options WHERE option_name LIKE %s", array('%tax_meta_%')));
1652 1652
 
1653 1653
         if (!empty($options_data)) {
1654 1654
 
@@ -1656,7 +1656,7 @@  discard block
 block discarded – undo
1656 1656
 
1657 1657
                 $option_val = str_replace('tax_meta_', '', $optobj->option_name);
1658 1658
 
1659
-                $taxonomies_data = $wpdb->get_results($wpdb->prepare("SELECT taxonomy FROM " . $wpdb->prefix . "term_taxonomy WHERE taxonomy LIKE %s AND term_id=%d", array('%category%', $option_val)));
1659
+                $taxonomies_data = $wpdb->get_results($wpdb->prepare("SELECT taxonomy FROM ".$wpdb->prefix."term_taxonomy WHERE taxonomy LIKE %s AND term_id=%d", array('%category%', $option_val)));
1660 1660
 
1661 1661
                 if (!empty($taxonomies_data)) {
1662 1662
 
@@ -1665,17 +1665,17 @@  discard block
 block discarded – undo
1665 1665
                         $taxObject = get_taxonomy($taxobj->taxonomy);
1666 1666
                         $post_type = $taxObject->object_type[0];
1667 1667
 
1668
-                        $opt_value = 'tax_meta_' . $post_type . '_' . $option_val;
1668
+                        $opt_value = 'tax_meta_'.$post_type.'_'.$option_val;
1669 1669
 
1670
-                        $duplicate_data = $wpdb->get_var($wpdb->prepare("SELECT option_id FROM " . $wpdb->prefix . "options WHERE option_name=%s", array('tax_meta_' . $option_val)));
1670
+                        $duplicate_data = $wpdb->get_var($wpdb->prepare("SELECT option_id FROM ".$wpdb->prefix."options WHERE option_name=%s", array('tax_meta_'.$option_val)));
1671 1671
 
1672 1672
                         if ($duplicate_data) {
1673 1673
 
1674
-                            $wpdb->query($wpdb->prepare("UPDATE " . $wpdb->prefix . "options SET	option_name=%s WHERE option_id=%d", array($opt_value, $optobj->option_id)));
1674
+                            $wpdb->query($wpdb->prepare("UPDATE ".$wpdb->prefix."options SET	option_name=%s WHERE option_id=%d", array($opt_value, $optobj->option_id)));
1675 1675
 
1676 1676
                         } else {
1677 1677
 
1678
-                            $wpdb->query($wpdb->prepare("INSERT INTO " . $wpdb->prefix . "options (option_name,option_value,autoload) VALUES (%s, %s, %s)", array($opt_value, $optobj->option_value, $optobj->autoload)));
1678
+                            $wpdb->query($wpdb->prepare("INSERT INTO ".$wpdb->prefix."options (option_name,option_value,autoload) VALUES (%s, %s, %s)", array($opt_value, $optobj->option_value, $optobj->autoload)));
1679 1679
 
1680 1680
                         }
1681 1681
 
@@ -1709,14 +1709,14 @@  discard block
 block discarded – undo
1709 1709
 
1710 1710
     global $wpdb, $table_prefix;
1711 1711
 
1712
-    $slug_exists = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($slug)));
1712
+    $slug_exists = $wpdb->get_var($wpdb->prepare("SELECT slug FROM ".$table_prefix."terms WHERE slug=%s", array($slug)));
1713 1713
 
1714 1714
     if ($slug_exists) {
1715 1715
 
1716 1716
         $suffix = 1;
1717 1717
         do {
1718
-            $alt_location_name = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix";
1719
-            $location_slug_check = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($alt_location_name)));
1718
+            $alt_location_name = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1))."-$suffix";
1719
+            $location_slug_check = $wpdb->get_var($wpdb->prepare("SELECT slug FROM ".$table_prefix."terms WHERE slug=%s", array($alt_location_name)));
1720 1720
             $suffix++;
1721 1721
         } while ($location_slug_check && $suffix < 100);
1722 1722
 
@@ -1770,7 +1770,7 @@  discard block
 block discarded – undo
1770 1770
 
1771 1771
         $suffix = 1;
1772 1772
         do {
1773
-            $new_slug = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix";
1773
+            $new_slug = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1))."-$suffix";
1774 1774
 
1775 1775
             /** This action is documented in geodirectory_hooks_actions.php */
1776 1776
             $term_slug_check = apply_filters('geodir_term_slug_is_exists', false, $new_slug, $term_id);
@@ -1782,7 +1782,7 @@  discard block
 block discarded – undo
1782 1782
 
1783 1783
         //wp_update_term( $term_id, $taxonomy, array('slug' => $slug) );
1784 1784
 
1785
-        $wpdb->query($wpdb->prepare("UPDATE " . $table_prefix . "terms SET slug=%s WHERE term_id=%d", array($slug, $term_id)));
1785
+        $wpdb->query($wpdb->prepare("UPDATE ".$table_prefix."terms SET slug=%s WHERE term_id=%d", array($slug, $term_id)));
1786 1786
 
1787 1787
     }
1788 1788
 	
@@ -1791,18 +1791,18 @@  discard block
 block discarded – undo
1791 1791
 	$post_type = !empty($taxonomy_obj) ? $taxonomy_obj->object_type[0] : NULL;
1792 1792
 	
1793 1793
 	$post_types = geodir_get_posttypes();
1794
-	if ($post_type && in_array($post_type, $post_types) && $post_type . '_tags' == $taxonomy) {		
1795
-		$posts_obj = $wpdb->get_results($wpdb->prepare("SELECT object_id FROM " . $wpdb->term_relationships . " WHERE term_taxonomy_id = %d", array($tt_id)));
1794
+	if ($post_type && in_array($post_type, $post_types) && $post_type.'_tags' == $taxonomy) {		
1795
+		$posts_obj = $wpdb->get_results($wpdb->prepare("SELECT object_id FROM ".$wpdb->term_relationships." WHERE term_taxonomy_id = %d", array($tt_id)));
1796 1796
 		
1797 1797
 		if (!empty($posts_obj)) {
1798 1798
 			foreach ($posts_obj as $post_obj) {
1799 1799
 				$post_id = $post_obj->object_id;
1800 1800
 				
1801
-				$raw_tags = wp_get_object_terms($post_id, $post_type . '_tags', array('fields' => 'names'));
1801
+				$raw_tags = wp_get_object_terms($post_id, $post_type.'_tags', array('fields' => 'names'));
1802 1802
 				$post_tags = !empty($raw_tags) ? implode(',', $raw_tags) : '';
1803 1803
 				
1804
-				$listing_table = $plugin_prefix . $post_type . '_detail';
1805
-				$wpdb->query($wpdb->prepare("UPDATE " . $listing_table . " SET post_tags=%s WHERE post_id =%d", array($post_tags, $post_id)));
1804
+				$listing_table = $plugin_prefix.$post_type.'_detail';
1805
+				$wpdb->query($wpdb->prepare("UPDATE ".$listing_table." SET post_tags=%s WHERE post_id =%d", array($post_tags, $post_id)));
1806 1806
 			}
1807 1807
 		}
1808 1808
 	}
@@ -1836,7 +1836,7 @@  discard block
 block discarded – undo
1836 1836
     if ($country_slug == $slug || $region_slug == $slug || $city_slug == $slug)
1837 1837
         return $slug_exists = true;
1838 1838
 
1839
-    if ($wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s AND term_id != %d", array($slug, $term_id))))
1839
+    if ($wpdb->get_var($wpdb->prepare("SELECT slug FROM ".$table_prefix."terms WHERE slug=%s AND term_id != %d", array($slug, $term_id))))
1840 1840
         return $slug_exists = true;
1841 1841
 
1842 1842
     return $slug_exists;
@@ -1876,43 +1876,43 @@  discard block
 block discarded – undo
1876 1876
 
1877 1877
 
1878 1878
     $gd_page = '';
1879
-    if(geodir_is_page('home')){
1879
+    if (geodir_is_page('home')) {
1880 1880
         $gd_page = 'home';
1881 1881
         $title = (get_option('geodir_meta_title_homepage')) ? get_option('geodir_meta_title_homepage') : $title;
1882 1882
     }
1883
-    elseif(geodir_is_page('detail')){
1883
+    elseif (geodir_is_page('detail')) {
1884 1884
         $gd_page = 'detail';
1885 1885
         $title = (get_option('geodir_meta_title_detail')) ? get_option('geodir_meta_title_detail') : $title;
1886 1886
     }
1887
-    elseif(geodir_is_page('pt')){
1887
+    elseif (geodir_is_page('pt')) {
1888 1888
         $gd_page = 'pt';
1889 1889
         $title = (get_option('geodir_meta_title_pt')) ? get_option('geodir_meta_title_pt') : $title;
1890 1890
     }
1891
-    elseif(geodir_is_page('listing')){
1891
+    elseif (geodir_is_page('listing')) {
1892 1892
         $gd_page = 'listing';
1893 1893
         $title = (get_option('geodir_meta_title_listing')) ? get_option('geodir_meta_title_listing') : $title;
1894 1894
     }
1895
-    elseif(geodir_is_page('location')){
1895
+    elseif (geodir_is_page('location')) {
1896 1896
         $gd_page = 'location';
1897 1897
         $title = (get_option('geodir_meta_title_location')) ? get_option('geodir_meta_title_location') : $title;
1898 1898
     }
1899
-    elseif(geodir_is_page('search')){
1899
+    elseif (geodir_is_page('search')) {
1900 1900
         $gd_page = 'search';
1901 1901
         $title = (get_option('geodir_meta_title_search')) ? get_option('geodir_meta_title_search') : $title;
1902 1902
     }
1903
-    elseif(geodir_is_page('add-listing')){
1903
+    elseif (geodir_is_page('add-listing')) {
1904 1904
         $gd_page = 'add-listing';
1905 1905
         $title = (get_option('geodir_meta_title_add-listing')) ? get_option('geodir_meta_title_add-listing') : $title;
1906 1906
     }
1907
-    elseif(geodir_is_page('author')){
1907
+    elseif (geodir_is_page('author')) {
1908 1908
         $gd_page = 'author';
1909 1909
         $title = (get_option('geodir_meta_title_author')) ? get_option('geodir_meta_title_author') : $title;
1910 1910
     }
1911
-    elseif(geodir_is_page('login')){
1911
+    elseif (geodir_is_page('login')) {
1912 1912
         $gd_page = 'login';
1913 1913
         $title = (get_option('geodir_meta_title_login')) ? get_option('geodir_meta_title_login') : $title;
1914 1914
     }
1915
-    elseif(geodir_is_page('listing-success')){
1915
+    elseif (geodir_is_page('listing-success')) {
1916 1916
         $gd_page = 'listing-success';
1917 1917
         $title = (get_option('geodir_meta_title_listing-success')) ? get_option('geodir_meta_title_listing-success') : $title;
1918 1918
     }
@@ -1944,8 +1944,8 @@  discard block
 block discarded – undo
1944 1944
 
1945 1945
     if (!get_option('geodir_set_post_attachments')) {
1946 1946
 
1947
-        require_once(ABSPATH . 'wp-admin/includes/image.php');
1948
-        require_once(ABSPATH . 'wp-admin/includes/file.php');
1947
+        require_once(ABSPATH.'wp-admin/includes/image.php');
1948
+        require_once(ABSPATH.'wp-admin/includes/file.php');
1949 1949
 
1950 1950
         $all_postypes = geodir_get_posttypes();
1951 1951
 
@@ -2146,7 +2146,7 @@  discard block
 block discarded – undo
2146 2146
 
2147 2147
         if (array_key_exists('post_video', $tabs_arr)) {
2148 2148
 
2149
-            $field_title = $wpdb->get_var($wpdb->prepare("select site_title from " . GEODIR_CUSTOM_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s ", array('geodir_video', $post_type)));
2149
+            $field_title = $wpdb->get_var($wpdb->prepare("select site_title from ".GEODIR_CUSTOM_FIELDS_TABLE." where htmlvar_name = %s and post_type = %s ", array('geodir_video', $post_type)));
2150 2150
 
2151 2151
             if (isset($tabs_arr['post_video']['heading_text']) && $field_title != '')
2152 2152
                 $tabs_arr['post_video']['heading_text'] = $field_title;
@@ -2154,7 +2154,7 @@  discard block
 block discarded – undo
2154 2154
 
2155 2155
         if (array_key_exists('special_offers', $tabs_arr)) {
2156 2156
 
2157
-            $field_title = $wpdb->get_var($wpdb->prepare("select site_title from " . GEODIR_CUSTOM_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s ", array('geodir_special_offers', $post_type)));
2157
+            $field_title = $wpdb->get_var($wpdb->prepare("select site_title from ".GEODIR_CUSTOM_FIELDS_TABLE." where htmlvar_name = %s and post_type = %s ", array('geodir_special_offers', $post_type)));
2158 2158
 
2159 2159
             if (isset($tabs_arr['special_offers']['heading_text']) && $field_title != '')
2160 2160
                 $tabs_arr['special_offers']['heading_text'] = $field_title;
@@ -2175,7 +2175,7 @@  discard block
 block discarded – undo
2175 2175
  */
2176 2176
 function geodir_remove_template_redirect_actions()
2177 2177
 {
2178
-    if (geodir_is_page('login')){
2178
+    if (geodir_is_page('login')) {
2179 2179
         remove_all_actions('template_redirect');
2180 2180
         remove_action('init', 'avia_modify_front', 10);
2181 2181
     }
@@ -2222,25 +2222,25 @@  discard block
 block discarded – undo
2222 2222
         $split_img_file_path = isset($split_img_path[1]) ? $split_img_path[1] : '';
2223 2223
 
2224 2224
         $wpdb->query(
2225
-            $wpdb->prepare("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id = %d AND file=%s ",
2225
+            $wpdb->prepare("DELETE FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id = %d AND file=%s ",
2226 2226
                 array($post_id, $split_img_file_path)
2227 2227
             )
2228 2228
         );
2229 2229
 
2230 2230
         $attachment_data = $wpdb->get_row(
2231
-            $wpdb->prepare("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=%d",
2231
+            $wpdb->prepare("SELECT ID, MIN(`menu_order`) FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id=%d",
2232 2232
                 array($post_id)
2233 2233
             )
2234 2234
         );
2235 2235
 
2236 2236
         if (!empty($attachment_data)) {
2237
-            $wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
2237
+            $wpdb->query("UPDATE ".GEODIR_ATTACHMENT_TABLE." SET menu_order=1 WHERE ID=".$attachment_data->ID);
2238 2238
         }
2239 2239
 
2240 2240
 
2241
-        $table_name = $plugin_prefix . $post_type . '_detail';
2241
+        $table_name = $plugin_prefix.$post_type.'_detail';
2242 2242
 
2243
-        $wpdb->query("UPDATE " . $table_name . " SET featured_image='' WHERE post_id =" . $post_id);
2243
+        $wpdb->query("UPDATE ".$table_name." SET featured_image='' WHERE post_id =".$post_id);
2244 2244
 
2245 2245
         geodir_set_wp_featured_image($post_id);
2246 2246
 
@@ -2268,9 +2268,9 @@  discard block
 block discarded – undo
2268 2268
 
2269 2269
     foreach ($all_postypes as $posttype) {
2270 2270
 
2271
-        $tablename = $plugin_prefix . $posttype . '_detail';
2271
+        $tablename = $plugin_prefix.$posttype.'_detail';
2272 2272
 
2273
-        $get_post_data = $wpdb->get_results("SELECT post_id FROM " . $tablename);
2273
+        $get_post_data = $wpdb->get_results("SELECT post_id FROM ".$tablename);
2274 2274
 
2275 2275
         if (!empty($get_post_data)) {
2276 2276
 
@@ -2278,7 +2278,7 @@  discard block
 block discarded – undo
2278 2278
 
2279 2279
                 $post_id = $data->post_id;
2280 2280
 
2281
-                $attachment_data = $wpdb->get_results("SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id =" . $post_id . " AND file!=''");
2281
+                $attachment_data = $wpdb->get_results("SELECT * FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id =".$post_id." AND file!=''");
2282 2282
 
2283 2283
                 if (!empty($attachment_data)) {
2284 2284
 
@@ -2295,22 +2295,22 @@  discard block
 block discarded – undo
2295 2295
 
2296 2296
                         $file_name = $file_info['basename'];
2297 2297
 
2298
-                        $img_arr['path'] = $uploads_path . $sub_dir . '/' . $file_name;
2298
+                        $img_arr['path'] = $uploads_path.$sub_dir.'/'.$file_name;
2299 2299
 
2300 2300
                         if (!file_exists($img_arr['path'])) {
2301 2301
 
2302
-                            $wpdb->query("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE ID=" . $attach->ID);
2302
+                            $wpdb->query("DELETE FROM ".GEODIR_ATTACHMENT_TABLE." WHERE ID=".$attach->ID);
2303 2303
 
2304 2304
                         }
2305 2305
 
2306 2306
                     }
2307 2307
 
2308
-                    $attachment_data = $wpdb->get_row("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=" . $post_id . " GROUP BY post_id");
2308
+                    $attachment_data = $wpdb->get_row("SELECT ID, MIN(`menu_order`) FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id=".$post_id." GROUP BY post_id");
2309 2309
 
2310 2310
                     if (!empty($attachment_data)) {
2311 2311
 
2312 2312
                         if ($attachment_data->ID)
2313
-                            $wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
2313
+                            $wpdb->query("UPDATE ".GEODIR_ATTACHMENT_TABLE." SET menu_order=1 WHERE ID=".$attachment_data->ID);
2314 2314
 
2315 2315
                     } else {
2316 2316
 
@@ -2324,7 +2324,7 @@  discard block
 block discarded – undo
2324 2324
 
2325 2325
                     }
2326 2326
 
2327
-                    $wpdb->query("UPDATE " . $tablename . " SET featured_image='' WHERE post_id =" . $post_id);
2327
+                    $wpdb->query("UPDATE ".$tablename." SET featured_image='' WHERE post_id =".$post_id);
2328 2328
 
2329 2329
                     geodir_set_wp_featured_image($post_id);
2330 2330
 
@@ -2353,7 +2353,7 @@  discard block
 block discarded – undo
2353 2353
 {
2354 2354
 
2355 2355
     if (!get_option('geodir_default_rating_star_icon')) {
2356
-        update_option('geodir_default_rating_star_icon', geodir_plugin_url() . '/geodirectory-assets/images/stars.png');
2356
+        update_option('geodir_default_rating_star_icon', geodir_plugin_url().'/geodirectory-assets/images/stars.png');
2357 2357
     }
2358 2358
 
2359 2359
 }
@@ -2370,10 +2370,10 @@  discard block
 block discarded – undo
2370 2370
  * @global string $plugin_prefix Geodirectory plugin table prefix.
2371 2371
  * @return array User listing count for each post type.
2372 2372
  */
2373
-function geodir_user_post_listing_count($user_id=null)
2373
+function geodir_user_post_listing_count($user_id = null)
2374 2374
 {
2375 2375
     global $wpdb, $plugin_prefix, $current_user;
2376
-    if(!$user_id){
2376
+    if (!$user_id) {
2377 2377
         $user_id = $current_user->ID;
2378 2378
     }
2379 2379
 
@@ -2384,7 +2384,7 @@  discard block
 block discarded – undo
2384 2384
     $user_listing = array();
2385 2385
     if (is_array($all_posts) && !empty($all_posts)) {
2386 2386
         foreach ($all_posts as $ptype) {
2387
-            $total_posts = $wpdb->get_var("SELECT count( ID ) FROM " . $wpdb->prefix . "posts WHERE post_author=" . $user_id . " AND post_type='" . $ptype . "' AND ( post_status = 'publish' OR post_status = 'draft' OR post_status = 'private' )");
2387
+            $total_posts = $wpdb->get_var("SELECT count( ID ) FROM ".$wpdb->prefix."posts WHERE post_author=".$user_id." AND post_type='".$ptype."' AND ( post_status = 'publish' OR post_status = 'draft' OR post_status = 'private' )");
2388 2388
 
2389 2389
             if ($total_posts > 0) {
2390 2390
                 $user_listing[$ptype] = $total_posts;
@@ -2485,9 +2485,9 @@  discard block
 block discarded – undo
2485 2485
                     }
2486 2486
 
2487 2487
                     if (strpos($type['field_icon'], 'http') !== false) {
2488
-                        $field_icon = ' background: url(' . $type['field_icon'] . ') no-repeat left center;background-size:18px 18px;padding-left: 21px;';
2488
+                        $field_icon = ' background: url('.$type['field_icon'].') no-repeat left center;background-size:18px 18px;padding-left: 21px;';
2489 2489
                     } elseif (strpos($type['field_icon'], 'fa fa-') !== false) {
2490
-                        $field_icon = '<i class="' . $type['field_icon'] . '"></i>';
2490
+                        $field_icon = '<i class="'.$type['field_icon'].'"></i>';
2491 2491
                     }
2492 2492
 
2493 2493
                     switch ($type['type']) {
@@ -2495,7 +2495,7 @@  discard block
 block discarded – undo
2495 2495
                             $i = 0;
2496 2496
                             $fieldset_count++;
2497 2497
                             $field_set_start = 1;
2498
-                            $fieldset_arr[$fieldset_count]['htmlvar_name'] = 'gd_tab_' . $fieldset_count;
2498
+                            $fieldset_arr[$fieldset_count]['htmlvar_name'] = 'gd_tab_'.$fieldset_count;
2499 2499
                             $fieldset_arr[$fieldset_count]['label'] = $label;
2500 2500
                         }
2501 2501
                             break;
@@ -2528,7 +2528,7 @@  discard block
 block discarded – undo
2528 2528
                             // all search engines that use the nofollow value exclude links that use it from their ranking calculation
2529 2529
                             $rel = strpos($website, get_site_url()) !== false ? '' : 'rel="nofollow"';
2530 2530
 
2531
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '"><span class="geodir-i-website" style="' . $field_icon . '">' . $field_icon_af . ' <a href="' . $website . '" target="_blank" ' . $rel . ' ><strong>' .
2531
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'"><span class="geodir-i-website" style="'.$field_icon.'">'.$field_icon_af.' <a href="'.$website.'" target="_blank" '.$rel.' ><strong>'.
2532 2532
                                 /**
2533 2533
                                  * Filer the custom field website name.
2534 2534
                                  *
@@ -2537,7 +2537,7 @@  discard block
 block discarded – undo
2537 2537
                                  * @param string $website The website address.
2538 2538
                                  * @param int $post->ID The post ID.
2539 2539
                                  */
2540
-                                apply_filters('geodir_custom_field_website_name', $title, $website, $post->ID) . '</strong></a></span></div>';
2540
+                                apply_filters('geodir_custom_field_website_name', $title, $website, $post->ID).'</strong></a></span></div>';
2541 2541
                         }
2542 2542
                             break;
2543 2543
                         case 'phone': {
@@ -2552,11 +2552,11 @@  discard block
 block discarded – undo
2552 2552
 
2553 2553
                             $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2554 2554
 
2555
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-contact" style="' . $field_icon . '">' . $field_icon_af;
2555
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-contact" style="'.$field_icon.'">'.$field_icon_af;
2556 2556
                             if ($field_set_start == 1 && $site_title != '') {
2557
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2557
+                                $html .= ' '.__($site_title, 'geodirectory').': ';
2558 2558
                             }
2559
-                            $html .= ' </span>' . stripslashes($post->{$type['htmlvar_name']}) . '</div>';
2559
+                            $html .= ' </span>'.stripslashes($post->{$type['htmlvar_name']}).'</div>';
2560 2560
                         }
2561 2561
                             break;
2562 2562
                         case 'time': {
@@ -2575,11 +2575,11 @@  discard block
 block discarded – undo
2575 2575
 
2576 2576
                             $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2577 2577
 
2578
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-time" style="' . $field_icon . '">' . $field_icon_af;
2578
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-time" style="'.$field_icon.'">'.$field_icon_af;
2579 2579
                             if ($field_set_start == 1 && $site_title != '') {
2580
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2580
+                                $html .= ' '.__($site_title, 'geodirectory').': ';
2581 2581
                             }
2582
-                            $html .= ' </span>' . stripslashes($value) . '</div>';
2582
+                            $html .= ' </span>'.stripslashes($value).'</div>';
2583 2583
                         }
2584 2584
                             break;
2585 2585
                         case 'datepicker': {
@@ -2589,8 +2589,8 @@  discard block
 block discarded – undo
2589 2589
                                 $date_format = $date_format['date_format'];
2590 2590
                             }
2591 2591
 
2592
-                            $search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format
2593
-                            $replace = array('d','j','l','m','n','F','Y');//PHP date format
2592
+                            $search = array('dd', 'd', 'DD', 'mm', 'm', 'MM', 'yy'); //jQuery UI datepicker format
2593
+                            $replace = array('d', 'j', 'l', 'm', 'n', 'F', 'Y'); //PHP date format
2594 2594
 
2595 2595
                             $date_format = str_replace($search, $replace, $date_format);
2596 2596
 
@@ -2611,11 +2611,11 @@  discard block
 block discarded – undo
2611 2611
 
2612 2612
                             $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2613 2613
 
2614
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-datepicker" style="' . $field_icon . '">' . $field_icon_af;
2614
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-datepicker" style="'.$field_icon.'">'.$field_icon_af;
2615 2615
                             if ($field_set_start == 1 && $site_title != '') {
2616
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2616
+                                $html .= ' '.__($site_title, 'geodirectory').': ';
2617 2617
                             }
2618
-                            $html .= ' </span>' . $value . '</div>';
2618
+                            $html .= ' </span>'.$value.'</div>';
2619 2619
                         }
2620 2620
                             break;
2621 2621
                         case 'text': {
@@ -2630,11 +2630,11 @@  discard block
 block discarded – undo
2630 2630
 
2631 2631
                             $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2632 2632
 
2633
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
2633
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-text" style="'.$field_icon.'">'.$field_icon_af;
2634 2634
                             if ($field_set_start == 1 && $site_title != '') {
2635
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2635
+                                $html .= ' '.__($site_title, 'geodirectory').': ';
2636 2636
                             }
2637
-                            $html .= ' </span>' . stripslashes($post->{$type['htmlvar_name']}) . '</div>';
2637
+                            $html .= ' </span>'.stripslashes($post->{$type['htmlvar_name']}).'</div>';
2638 2638
                         }
2639 2639
                             break;
2640 2640
                         case 'radio': {
@@ -2671,13 +2671,13 @@  discard block
 block discarded – undo
2671 2671
 
2672 2672
                                 $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2673 2673
 
2674
-                                $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-radio" style="' . $field_icon . '">' . $field_icon_af;
2674
+                                $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-radio" style="'.$field_icon.'">'.$field_icon_af;
2675 2675
 
2676 2676
                                 if ($field_set_start == 1 && $site_title != '') {
2677
-                                    $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2677
+                                    $html .= ' '.__($site_title, 'geodirectory').': ';
2678 2678
                                 }
2679 2679
 
2680
-                                $html .= ' </span>' . $html_val . '</div>';
2680
+                                $html .= ' </span>'.$html_val.'</div>';
2681 2681
                             }
2682 2682
                         }
2683 2683
                             break;
@@ -2685,7 +2685,7 @@  discard block
 block discarded – undo
2685 2685
                             $html_var = $type['htmlvar_name'];
2686 2686
                             $html_val = $type['htmlvar_name'];
2687 2687
 
2688
-                            if ((int)$post->{$html_var} == 1) {
2688
+                            if ((int) $post->{$html_var} == 1) {
2689 2689
 
2690 2690
                                 if ($post->{$type['htmlvar_name']} == '1') {
2691 2691
                                     $html_val = __('Yes', 'geodirectory');
@@ -2704,13 +2704,13 @@  discard block
 block discarded – undo
2704 2704
 
2705 2705
                                 $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2706 2706
 
2707
-                                $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-checkbox" style="' . $field_icon . '">' . $field_icon_af;
2707
+                                $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-checkbox" style="'.$field_icon.'">'.$field_icon_af;
2708 2708
 
2709 2709
                                 if ($field_set_start == 1 && $site_title != '') {
2710
-                                    $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2710
+                                    $html .= ' '.__($site_title, 'geodirectory').': ';
2711 2711
                                 }
2712 2712
 
2713
-                                $html .= ' </span>' . $html_val . '</div>';
2713
+                                $html .= ' </span>'.$html_val.'</div>';
2714 2714
                             }
2715 2715
                         }
2716 2716
                             break;
@@ -2740,11 +2740,11 @@  discard block
 block discarded – undo
2740 2740
 
2741 2741
                             $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2742 2742
 
2743
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
2743
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-select" style="'.$field_icon.'">'.$field_icon_af;
2744 2744
                             if ($field_set_start == 1 && $site_title != '') {
2745
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2745
+                                $html .= ' '.__($site_title, 'geodirectory').': ';
2746 2746
                             }
2747
-                            $html .= ' </span>' . $field_value . '</div>';
2747
+                            $html .= ' </span>'.$field_value.'</div>';
2748 2748
                         }
2749 2749
                             break;
2750 2750
                         case 'multiselect': {
@@ -2778,16 +2778,16 @@  discard block
 block discarded – undo
2778 2778
 
2779 2779
                             $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2780 2780
 
2781
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
2781
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-select" style="'.$field_icon.'">'.$field_icon_af;
2782 2782
                             if ($field_set_start == 1 && $site_title != '') {
2783
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2783
+                                $html .= ' '.__($site_title, 'geodirectory').': ';
2784 2784
                             }
2785 2785
                             $html .= ' </span>';
2786 2786
 
2787 2787
                             if (count($option_values) > 1) {
2788 2788
                                 $html .= '<ul>';
2789 2789
                                 foreach ($option_values as $val) {
2790
-                                    $html .= '<li>' . $val . '</li>';
2790
+                                    $html .= '<li>'.$val.'</li>';
2791 2791
                                 }
2792 2792
                                 $html .= '</ul>';
2793 2793
                             } else {
@@ -2808,11 +2808,11 @@  discard block
 block discarded – undo
2808 2808
 
2809 2809
                             $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2810 2810
 
2811
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af;
2811
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-email" style="'.$field_icon.'">'.$field_icon_af;
2812 2812
                             if ($field_set_start == 1 && $site_title != '') {
2813
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2813
+                                $html .= ' '.__($site_title, 'geodirectory').': ';
2814 2814
                             }
2815
-                            $html .= ' </span>' . stripslashes($post->{$type['htmlvar_name']}) . '</div>';
2815
+                            $html .= ' </span>'.stripslashes($post->{$type['htmlvar_name']}).'</div>';
2816 2816
                         }
2817 2817
                             break;
2818 2818
                         case 'textarea': {
@@ -2827,11 +2827,11 @@  discard block
 block discarded – undo
2827 2827
 
2828 2828
                             $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2829 2829
 
2830
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
2830
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-text" style="'.$field_icon.'">'.$field_icon_af;
2831 2831
                             if ($field_set_start == 1 && $site_title != '') {
2832
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2832
+                                $html .= ' '.__($site_title, 'geodirectory').': ';
2833 2833
                             }
2834
-                            $html .= '</span>' . wpautop(stripslashes($post->{$type['htmlvar_name']})) . '</div>';
2834
+                            $html .= '</span>'.wpautop(stripslashes($post->{$type['htmlvar_name']})).'</div>';
2835 2835
                         }
2836 2836
                             break;
2837 2837
                         case 'html': {
@@ -2846,11 +2846,11 @@  discard block
 block discarded – undo
2846 2846
 
2847 2847
                             $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2848 2848
 
2849
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
2849
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-text" style="'.$field_icon.'">'.$field_icon_af;
2850 2850
                             if ($field_set_start == 1 && $site_title != '') {
2851
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2851
+                                $html .= ' '.__($site_title, 'geodirectory').': ';
2852 2852
                             }
2853
-                            $html .= ' </span>' . wpautop(stripslashes($post->{$type['htmlvar_name']})) . '</div>';
2853
+                            $html .= ' </span>'.wpautop(stripslashes($post->{$type['htmlvar_name']})).'</div>';
2854 2854
                         }
2855 2855
                         break;
2856 2856
                         case 'file': {
@@ -2861,7 +2861,7 @@  discard block
 block discarded – undo
2861 2861
 
2862 2862
                                 if (!empty($files)) {
2863 2863
                                     $extra_fields = !empty($type['extra_fields']) ? maybe_unserialize($type['extra_fields']) : NULL;
2864
-                                    $allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types'] ) ? $extra_fields['gd_file_types'] : '';
2864
+                                    $allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types']) ? $extra_fields['gd_file_types'] : '';
2865 2865
                                
2866 2866
                                     $file_paths = '';
2867 2867
                                     foreach ($files as $file) {
@@ -2890,9 +2890,9 @@  discard block
 block discarded – undo
2890 2890
                                                 $file_paths .= '</a>';
2891 2891
                                                 $file_paths .= '</div>';
2892 2892
                                             } else {
2893
-                                                $ext_path = '_' . $html_var . '_';
2893
+                                                $ext_path = '_'.$html_var.'_';
2894 2894
                                                 $filename = explode($ext_path, $filename);
2895
-                                                $file_paths .= '<a href="' . $file . '" target="_blank">' . $filename[count($filename) - 1] . '</a>';
2895
+                                                $file_paths .= '<a href="'.$file.'" target="_blank">'.$filename[count($filename) - 1].'</a>';
2896 2896
                                             }
2897 2897
                                         }
2898 2898
                                     }
@@ -2909,13 +2909,13 @@  discard block
 block discarded – undo
2909 2909
                                     $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2910 2910
 
2911 2911
 
2912
-                                    $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . ' geodir-custom-file-box" style="clear:both;"><span class="geodir-i-file" style="display:inline-block;vertical-align:top;padding-right:14px;' . $field_icon . '">' . $field_icon_af;
2912
+                                    $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].' geodir-custom-file-box" style="clear:both;"><span class="geodir-i-file" style="display:inline-block;vertical-align:top;padding-right:14px;'.$field_icon.'">'.$field_icon_af;
2913 2913
 
2914 2914
                                     if ($field_set_start == 1 && $site_title != '') {
2915
-                                        $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2915
+                                        $html .= ' '.__($site_title, 'geodirectory').': ';
2916 2916
                                     }
2917 2917
 
2918
-                                    $html .= ' </span>' . $file_paths . '</div>';
2918
+                                    $html .= ' </span>'.$file_paths.'</div>';
2919 2919
                                 }
2920 2920
                             }
2921 2921
                         }
@@ -2966,7 +2966,7 @@  discard block
 block discarded – undo
2966 2966
                                  * @param string $htmlvar_name The field HTML var name.
2967 2967
                                  */
2968 2968
                                 'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, $htmlvar_name),
2969
-                                'tab_content' => '<div class="geodir-company_info field-group">' . $fieldset_html . '</html>'
2969
+                                'tab_content' => '<div class="geodir-company_info field-group">'.$fieldset_html.'</html>'
2970 2970
                             );
2971 2971
                         }
2972 2972
                     } else {
@@ -3026,7 +3026,7 @@  discard block
 block discarded – undo
3026 3026
             }
3027 3027
             $status .= ")</strong>";
3028 3028
 
3029
-            $html = '<span class="geodir-post-status">' . $status_icon . ' <font class="geodir-status-label">' . __('Status: ', 'geodirectory') . '</font>' . $status . '</span>';
3029
+            $html = '<span class="geodir-post-status">'.$status_icon.' <font class="geodir-status-label">'.__('Status: ', 'geodirectory').'</font>'.$status.'</span>';
3030 3030
         }
3031 3031
     }
3032 3032
 
@@ -3106,7 +3106,7 @@  discard block
 block discarded – undo
3106 3106
 function geodir_no_rating_comment_text($content, $comment = '')
3107 3107
 {
3108 3108
     if (!is_admin()) {
3109
-        return '<div class="description">' . $content . '</div>';
3109
+        return '<div class="description">'.$content.'</div>';
3110 3110
     } else {
3111 3111
         return $content;
3112 3112
     }
@@ -3184,7 +3184,7 @@  discard block
 block discarded – undo
3184 3184
         $classes[] = 'gd-no-rating';
3185 3185
     }
3186 3186
     
3187
-    $classes[] = 'gd-map-' . geodir_map_name();
3187
+    $classes[] = 'gd-map-'.geodir_map_name();
3188 3188
 
3189 3189
     return $classes;
3190 3190
 }
@@ -3204,7 +3204,7 @@  discard block
 block discarded – undo
3204 3204
         $class .= ' gd-no-rating';
3205 3205
     }
3206 3206
     
3207
-    $class .= ' gd-map-' . geodir_map_name();
3207
+    $class .= ' gd-map-'.geodir_map_name();
3208 3208
 
3209 3209
     return $class;
3210 3210
 }
@@ -3239,7 +3239,7 @@  discard block
 block discarded – undo
3239 3239
  * @return array Translation texts.
3240 3240
  */
3241 3241
 function geodir_load_gd_options_text_translation($translation_texts = array()) {
3242
-    $translation_texts = !empty( $translation_texts ) && is_array( $translation_texts ) ? $translation_texts : array();
3242
+    $translation_texts = !empty($translation_texts) && is_array($translation_texts) ? $translation_texts : array();
3243 3243
 
3244 3244
     $gd_options = array('geodir_post_submited_success_email_subject_admin', 'geodir_post_submited_success_email_content_admin', 'geodir_post_submited_success_email_subject', 'geodir_post_submited_success_email_content', 'geodir_forgot_password_subject', 'geodir_forgot_password_content', 'geodir_registration_success_email_subject', 'geodir_registration_success_email_content', 'geodir_post_published_email_subject', 'geodir_post_published_email_content', 'geodir_email_friend_subject', 'geodir_email_friend_content', 'geodir_email_enquiry_subject', 'geodir_email_enquiry_content', 'geodir_post_added_success_msg_content', 'geodir_post_edited_email_subject_admin', 'geodir_post_edited_email_content_admin');
3245 3245
 
Please login to merge, or discard this patch.
tests/selenium/stest-13_Send_Enquiry.php 2 patches
Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -1,42 +1,42 @@
 block discarded – undo
1 1
 <?php
2 2
 class SendEnquiry extends GD_Test
3 3
 {
4
-    public function setUp()
5
-    {
6
-        parent::setUp();
4
+	public function setUp()
5
+	{
6
+		parent::setUp();
7 7
 
8
-        //skip test if already completed.
9
-        if ($this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
10
-            $this->markTestSkipped('Skipping '.pathinfo(__FILE__, PATHINFO_FILENAME).' since its already completed......');
11
-            return;
12
-        } else {
13
-            $this->prepareSession()->currentWindow()->maximize();
14
-        }
15
-    }
8
+		//skip test if already completed.
9
+		if ($this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
10
+			$this->markTestSkipped('Skipping '.pathinfo(__FILE__, PATHINFO_FILENAME).' since its already completed......');
11
+			return;
12
+		} else {
13
+			$this->prepareSession()->currentWindow()->maximize();
14
+		}
15
+	}
16 16
 
17
-    public function testSendEnquiry()
18
-    {
19
-        $this->logInfo('Send Enquiry......');
20
-        $this->url(self::GDTEST_BASE_URL.'places/united-states/new-york/new-york/attractions/test-listing/');
21
-        $this->waitForPageLoadAndCheckForErrors();
22
-        $this->byClassName('b_send_inquiry')->click();
23
-        $this->waitForPageLoadAndCheckForErrors();
24
-        $this->byName('inq_name')->value('Test User');
25
-        $this->byName('inq_email')->value('[email protected]');
26
-        $this->byId('agt_mail_phone')->value('44444444444');
27
-        $this->byName('Send')->click();
28
-        $this->waitForPageLoadAndCheckForErrors();
29
-        $this->assertTrue( $this->isTextPresent("Enquiry sent successfully"), "Success text not found");
30
-    }
17
+	public function testSendEnquiry()
18
+	{
19
+		$this->logInfo('Send Enquiry......');
20
+		$this->url(self::GDTEST_BASE_URL.'places/united-states/new-york/new-york/attractions/test-listing/');
21
+		$this->waitForPageLoadAndCheckForErrors();
22
+		$this->byClassName('b_send_inquiry')->click();
23
+		$this->waitForPageLoadAndCheckForErrors();
24
+		$this->byName('inq_name')->value('Test User');
25
+		$this->byName('inq_email')->value('[email protected]');
26
+		$this->byId('agt_mail_phone')->value('44444444444');
27
+		$this->byName('Send')->click();
28
+		$this->waitForPageLoadAndCheckForErrors();
29
+		$this->assertTrue( $this->isTextPresent("Enquiry sent successfully"), "Success text not found");
30
+	}
31 31
 
32
-    public function tearDown()
33
-    {
34
-        if (!$this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
35
-            //write current file number to completed.txt
36
-            $CurrentFileNumber = $this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME));
37
-            $completed = fopen("tests/selenium/completed.txt", "w") or die("Unable to open file!");
38
-            fwrite($completed, $CurrentFileNumber);
39
-        }
40
-    }
32
+	public function tearDown()
33
+	{
34
+		if (!$this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
35
+			//write current file number to completed.txt
36
+			$CurrentFileNumber = $this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME));
37
+			$completed = fopen("tests/selenium/completed.txt", "w") or die("Unable to open file!");
38
+			fwrite($completed, $CurrentFileNumber);
39
+		}
40
+	}
41 41
 }
42 42
 ?>
43 43
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
         $this->byId('agt_mail_phone')->value('44444444444');
27 27
         $this->byName('Send')->click();
28 28
         $this->waitForPageLoadAndCheckForErrors();
29
-        $this->assertTrue( $this->isTextPresent("Enquiry sent successfully"), "Success text not found");
29
+        $this->assertTrue($this->isTextPresent("Enquiry sent successfully"), "Success text not found");
30 30
     }
31 31
 
32 32
     public function tearDown()
Please login to merge, or discard this patch.
tests/selenium/stest-17_Add_Custom_Fields.php 1 patch
Indentation   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -1,74 +1,74 @@
 block discarded – undo
1 1
 <?php
2 2
 class AddCustomFields extends GD_Test
3 3
 {
4
-    public function setUp()
5
-    {
6
-        parent::setUp();
4
+	public function setUp()
5
+	{
6
+		parent::setUp();
7 7
 
8
-        //skip test if already completed.
9
-        if ($this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
10
-            $this->markTestSkipped('Skipping '.pathinfo(__FILE__, PATHINFO_FILENAME).' since its already completed......');
11
-            return;
12
-        } else {
13
-            $this->prepareSession()->currentWindow()->maximize();
14
-        }
15
-    }
8
+		//skip test if already completed.
9
+		if ($this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
10
+			$this->markTestSkipped('Skipping '.pathinfo(__FILE__, PATHINFO_FILENAME).' since its already completed......');
11
+			return;
12
+		} else {
13
+			$this->prepareSession()->currentWindow()->maximize();
14
+		}
15
+	}
16 16
 
17
-    public function testAddCustomFields()
18
-    {
19
-        $this->logInfo('Add custom fields......');
20
-        $this->prepareSession()->currentWindow()->maximize();
21
-        //Field 1
22
-        $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=gd_place_fields_settings&subtab=custom_fields&listing_type=gd_place');
23
-        $this->waitForPageLoadAndCheckForErrors();
24
-        $this->byId('gt-text')->click();
25
-        $this->waitForPageLoadAndCheckForErrors();
26
-        $link = $this->byXPath("//li[@id='licontainer_new10']/div[contains(@class,'titlenew10')]");
27
-        $this->moveto($link);
28
-        $this->doubleclick();
29
-        $this->waitForPageLoadAndCheckForErrors();
30
-        $this->byXPath("//div[@id='field_frmnew10']//input[@id='admin_title']")->value('Text Field 1');
31
-        $this->byXPath("//div[@id='field_frmnew10']//input[@id='site_title']")->value('Text Field 1');
32
-        $this->byXPath("//div[@id='field_frmnew10']//input[@id='htmlvar_name']")->value('text_field_1');
33
-        $this->byXPath("//div[@id='field_frmnew10']//input[@id='clabels']")->value('Text Field 1');
34
-        $this->select($this->byXPath("//div[@id='field_frmnew10']//select[@id='is_active']"))->selectOptionByLabel('Yes');
35
-        $this->select($this->byXPath("//div[@id='field_frmnew10']//select[@id='show_on_listing']"))->selectOptionByLabel('Yes');
36
-        $this->select($this->byXPath("//div[@id='field_frmnew10']//select[@id='show_on_detail']"))->selectOptionByLabel('Yes');
37
-        $this->byXPath("//div[@id='field_frmnew10']//input[@id='cat_sort']")->click();
38
-        $this->byXPath("//div[@id='field_frmnew10']//input[@id='cat_filter']")->click();
39
-        $this->byXPath("//div[@id='field_frmnew10']//input[@id='save']")->click();
40
-        $this->waitForPageLoadAndCheckForErrors();
17
+	public function testAddCustomFields()
18
+	{
19
+		$this->logInfo('Add custom fields......');
20
+		$this->prepareSession()->currentWindow()->maximize();
21
+		//Field 1
22
+		$this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=gd_place_fields_settings&subtab=custom_fields&listing_type=gd_place');
23
+		$this->waitForPageLoadAndCheckForErrors();
24
+		$this->byId('gt-text')->click();
25
+		$this->waitForPageLoadAndCheckForErrors();
26
+		$link = $this->byXPath("//li[@id='licontainer_new10']/div[contains(@class,'titlenew10')]");
27
+		$this->moveto($link);
28
+		$this->doubleclick();
29
+		$this->waitForPageLoadAndCheckForErrors();
30
+		$this->byXPath("//div[@id='field_frmnew10']//input[@id='admin_title']")->value('Text Field 1');
31
+		$this->byXPath("//div[@id='field_frmnew10']//input[@id='site_title']")->value('Text Field 1');
32
+		$this->byXPath("//div[@id='field_frmnew10']//input[@id='htmlvar_name']")->value('text_field_1');
33
+		$this->byXPath("//div[@id='field_frmnew10']//input[@id='clabels']")->value('Text Field 1');
34
+		$this->select($this->byXPath("//div[@id='field_frmnew10']//select[@id='is_active']"))->selectOptionByLabel('Yes');
35
+		$this->select($this->byXPath("//div[@id='field_frmnew10']//select[@id='show_on_listing']"))->selectOptionByLabel('Yes');
36
+		$this->select($this->byXPath("//div[@id='field_frmnew10']//select[@id='show_on_detail']"))->selectOptionByLabel('Yes');
37
+		$this->byXPath("//div[@id='field_frmnew10']//input[@id='cat_sort']")->click();
38
+		$this->byXPath("//div[@id='field_frmnew10']//input[@id='cat_filter']")->click();
39
+		$this->byXPath("//div[@id='field_frmnew10']//input[@id='save']")->click();
40
+		$this->waitForPageLoadAndCheckForErrors();
41 41
 
42
-        //Field 2
43
-        $this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=gd_place_fields_settings&subtab=custom_fields&listing_type=gd_place');
44
-        $this->waitForPageLoadAndCheckForErrors();
45
-        $this->byId('gt-text')->click();
46
-        $this->waitForPageLoadAndCheckForErrors();
47
-        $link = $this->byXPath("//li[@id='licontainer_new11']/div[contains(@class,'titlenew11')]");
48
-        $this->moveto($link);
49
-        $this->doubleclick();
50
-        $this->waitForPageLoadAndCheckForErrors();
51
-        $this->byXPath("//div[@id='field_frmnew11']//input[@id='admin_title']")->value('Text Field 2');
52
-        $this->byXPath("//div[@id='field_frmnew11']//input[@id='site_title']")->value('Text Field 2');
53
-        $this->byXPath("//div[@id='field_frmnew11']//input[@id='htmlvar_name']")->value('text_field_2');
54
-        $this->byXPath("//div[@id='field_frmnew11']//input[@id='clabels']")->value('Text Field 2');
55
-        $this->select($this->byXPath("//div[@id='field_frmnew11']//select[@id='is_active']"))->selectOptionByLabel('Yes');
56
-        $this->select($this->byXPath("//div[@id='field_frmnew11']//select[@id='show_on_listing']"))->selectOptionByLabel('Yes');
57
-        $this->select($this->byXPath("//div[@id='field_frmnew11']//select[@id='show_on_detail']"))->selectOptionByLabel('Yes');
58
-        $this->byXPath("//div[@id='field_frmnew11']//input[@id='cat_sort']")->click();
59
-        $this->byXPath("//div[@id='field_frmnew11']//input[@id='cat_filter']")->click();
60
-        $this->byXPath("//div[@id='field_frmnew11']//input[@id='save']")->click();
61
-        $this->waitForPageLoadAndCheckForErrors();
62
-    }
42
+		//Field 2
43
+		$this->maybeAdminLogin(self::GDTEST_BASE_URL.'wp-admin/admin.php?page=geodirectory&tab=gd_place_fields_settings&subtab=custom_fields&listing_type=gd_place');
44
+		$this->waitForPageLoadAndCheckForErrors();
45
+		$this->byId('gt-text')->click();
46
+		$this->waitForPageLoadAndCheckForErrors();
47
+		$link = $this->byXPath("//li[@id='licontainer_new11']/div[contains(@class,'titlenew11')]");
48
+		$this->moveto($link);
49
+		$this->doubleclick();
50
+		$this->waitForPageLoadAndCheckForErrors();
51
+		$this->byXPath("//div[@id='field_frmnew11']//input[@id='admin_title']")->value('Text Field 2');
52
+		$this->byXPath("//div[@id='field_frmnew11']//input[@id='site_title']")->value('Text Field 2');
53
+		$this->byXPath("//div[@id='field_frmnew11']//input[@id='htmlvar_name']")->value('text_field_2');
54
+		$this->byXPath("//div[@id='field_frmnew11']//input[@id='clabels']")->value('Text Field 2');
55
+		$this->select($this->byXPath("//div[@id='field_frmnew11']//select[@id='is_active']"))->selectOptionByLabel('Yes');
56
+		$this->select($this->byXPath("//div[@id='field_frmnew11']//select[@id='show_on_listing']"))->selectOptionByLabel('Yes');
57
+		$this->select($this->byXPath("//div[@id='field_frmnew11']//select[@id='show_on_detail']"))->selectOptionByLabel('Yes');
58
+		$this->byXPath("//div[@id='field_frmnew11']//input[@id='cat_sort']")->click();
59
+		$this->byXPath("//div[@id='field_frmnew11']//input[@id='cat_filter']")->click();
60
+		$this->byXPath("//div[@id='field_frmnew11']//input[@id='save']")->click();
61
+		$this->waitForPageLoadAndCheckForErrors();
62
+	}
63 63
 
64
-    public function tearDown()
65
-    {
66
-        if (!$this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
67
-            //write current file number to completed.txt
68
-            $CurrentFileNumber = $this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME));
69
-            $completed = fopen("tests/selenium/completed.txt", "w") or die("Unable to open file!");
70
-            fwrite($completed, $CurrentFileNumber);
71
-        }
72
-    }
64
+	public function tearDown()
65
+	{
66
+		if (!$this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
67
+			//write current file number to completed.txt
68
+			$CurrentFileNumber = $this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME));
69
+			$completed = fopen("tests/selenium/completed.txt", "w") or die("Unable to open file!");
70
+			fwrite($completed, $CurrentFileNumber);
71
+		}
72
+	}
73 73
 }
74 74
 ?>
75 75
\ No newline at end of file
Please login to merge, or discard this patch.
tests/selenium/stest-10_Add_A_Review.php 1 patch
Indentation   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -1,48 +1,48 @@
 block discarded – undo
1 1
 <?php
2 2
 class AddReview extends GD_Test
3 3
 {
4
-    public function setUp()
5
-    {
6
-        parent::setUp();
4
+	public function setUp()
5
+	{
6
+		parent::setUp();
7 7
 
8
-        //skip test if already completed.
9
-        if ($this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
10
-            $this->markTestSkipped('Skipping '.pathinfo(__FILE__, PATHINFO_FILENAME).' since its already completed......');
11
-            return;
12
-        } else {
13
-            $this->prepareSession()->currentWindow()->maximize();
14
-        }
15
-    }
8
+		//skip test if already completed.
9
+		if ($this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
10
+			$this->markTestSkipped('Skipping '.pathinfo(__FILE__, PATHINFO_FILENAME).' since its already completed......');
11
+			return;
12
+		} else {
13
+			$this->prepareSession()->currentWindow()->maximize();
14
+		}
15
+	}
16 16
 
17
-    public function testAddReview()
18
-    {
19
-        $this->logInfo('Adding a review......');
20
-        $this->maybeUserLogin(self::GDTEST_BASE_URL.'places/united-states/new-york/new-york/attractions/franklin-square/', true);
21
-        $this->waitForPageLoadAndCheckForErrors();
22
-        $this->prepareSession()->currentWindow()->maximize();
23
-        $this->ExecuteScript('jQuery(".geodir-tab-head").css("overflow", "hidden");');
24
-        try {
25
-            $this->byXPath("//a[text()='Reviews']")->click();
26
-        } catch (PHPUnit_Extensions_Selenium2TestCase_WebDriverException $e) {
27
-            if (PHPUnit_Extensions_Selenium2TestCase_WebDriverException::ElementNotVisible == $e->getCode()) {
28
-                $this->ExecuteScript('jQuery("#geodir-tab-mobile-menu").click();');
29
-                $this->byXPath("//a[text()='Reviews']")->click();
30
-            }
31
-        }
32
-        $this->ExecuteScript('jQuery("#geodir_overallrating").val("4");');
33
-        $this->byId('comment')->value('Cool xyz');
34
-        $this->byId('submit')->click();
35
-        $this->waitForPageLoadAndCheckForErrors();
36
-    }
17
+	public function testAddReview()
18
+	{
19
+		$this->logInfo('Adding a review......');
20
+		$this->maybeUserLogin(self::GDTEST_BASE_URL.'places/united-states/new-york/new-york/attractions/franklin-square/', true);
21
+		$this->waitForPageLoadAndCheckForErrors();
22
+		$this->prepareSession()->currentWindow()->maximize();
23
+		$this->ExecuteScript('jQuery(".geodir-tab-head").css("overflow", "hidden");');
24
+		try {
25
+			$this->byXPath("//a[text()='Reviews']")->click();
26
+		} catch (PHPUnit_Extensions_Selenium2TestCase_WebDriverException $e) {
27
+			if (PHPUnit_Extensions_Selenium2TestCase_WebDriverException::ElementNotVisible == $e->getCode()) {
28
+				$this->ExecuteScript('jQuery("#geodir-tab-mobile-menu").click();');
29
+				$this->byXPath("//a[text()='Reviews']")->click();
30
+			}
31
+		}
32
+		$this->ExecuteScript('jQuery("#geodir_overallrating").val("4");');
33
+		$this->byId('comment')->value('Cool xyz');
34
+		$this->byId('submit')->click();
35
+		$this->waitForPageLoadAndCheckForErrors();
36
+	}
37 37
 
38
-    public function tearDown()
39
-    {
40
-        if (!$this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
41
-            //write current file number to completed.txt
42
-            $CurrentFileNumber = $this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME));
43
-            $completed = fopen("tests/selenium/completed.txt", "w") or die("Unable to open file!");
44
-            fwrite($completed, $CurrentFileNumber);
45
-        }
46
-    }
38
+	public function tearDown()
39
+	{
40
+		if (!$this->skipTest($this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME)), $this->getCompletedFileNumber())) {
41
+			//write current file number to completed.txt
42
+			$CurrentFileNumber = $this->getCurrentFileNumber(pathinfo(__FILE__, PATHINFO_FILENAME));
43
+			$completed = fopen("tests/selenium/completed.txt", "w") or die("Unable to open file!");
44
+			fwrite($completed, $CurrentFileNumber);
45
+		}
46
+	}
47 47
 }
48 48
 ?>
49 49
\ No newline at end of file
Please login to merge, or discard this patch.