@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | $gd_session->set('homemap_catlist_ptype', $gd_post_type); |
13 | 13 | $post_taxonomy = geodir_get_taxonomies($gd_post_type); |
14 | 14 | $map_canvas_name = sanitize_text_field($_REQUEST['map_canvas']); |
15 | - $child_collapse = (bool)$_REQUEST['child_collapse']; |
|
15 | + $child_collapse = (bool) $_REQUEST['child_collapse']; |
|
16 | 16 | echo home_map_taxonomy_walker($post_taxonomy, 0, true, 0, $map_canvas_name, $child_collapse, true); |
17 | 17 | die; |
18 | 18 | } |
@@ -32,21 +32,21 @@ discard block |
||
32 | 32 | global $wpdb, $plugin_prefix, $gd_session; |
33 | 33 | |
34 | 34 | if ($_REQUEST['m_id'] != '') { |
35 | - $pid = (int)$_REQUEST['m_id']; |
|
35 | + $pid = (int) $_REQUEST['m_id']; |
|
36 | 36 | } else { |
37 | 37 | echo __('No marker data found', 'geodirectory'); |
38 | 38 | exit; |
39 | 39 | } |
40 | 40 | |
41 | 41 | if (isset($_REQUEST['post_preview']) && $_REQUEST['post_preview'] != '' && $gd_ses_listing = $gd_session->get('listing')) { |
42 | - $post = (object)$gd_ses_listing; |
|
42 | + $post = (object) $gd_ses_listing; |
|
43 | 43 | echo geodir_get_infowindow_html($post, $_REQUEST['post_preview']); |
44 | 44 | } else { |
45 | 45 | $geodir_post_type = get_post_type($pid); |
46 | 46 | |
47 | - $table = $plugin_prefix . $geodir_post_type . '_detail'; |
|
47 | + $table = $plugin_prefix.$geodir_post_type.'_detail'; |
|
48 | 48 | |
49 | - $sql = $wpdb->prepare("SELECT * FROM " . $table . " WHERE post_id = %d", array($pid)); |
|
49 | + $sql = $wpdb->prepare("SELECT * FROM ".$table." WHERE post_id = %d", array($pid)); |
|
50 | 50 | |
51 | 51 | $postinfo = $wpdb->get_results($sql); |
52 | 52 | |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | $post_type = isset($_REQUEST['gd_posttype']) ? $_REQUEST['gd_posttype'] : 'gd_place'; |
91 | 91 | |
92 | 92 | $map_cat_ids_array = array('0'); |
93 | - $cat_find_array = array(" FIND_IN_SET(%d, pd." . $post_type . "category)"); |
|
93 | + $cat_find_array = array(" FIND_IN_SET(%d, pd.".$post_type."category)"); |
|
94 | 94 | |
95 | 95 | |
96 | 96 | $field_default_cat = ''; |
@@ -98,13 +98,13 @@ discard block |
||
98 | 98 | $map_cat_arr = trim($_REQUEST['cat_id'], ','); |
99 | 99 | |
100 | 100 | if (!empty($map_cat_arr)) { |
101 | - $field_default_cat .= "WHEN (default_category IN (" . $map_cat_arr . ")) THEN default_category "; |
|
101 | + $field_default_cat .= "WHEN (default_category IN (".$map_cat_arr.")) THEN default_category "; |
|
102 | 102 | |
103 | 103 | $map_cat_ids_array = explode(',', $map_cat_arr); |
104 | 104 | $cat_find_array = array(); |
105 | 105 | foreach ($map_cat_ids_array as $cat_id) { |
106 | - $field_default_cat .= "WHEN (FIND_IN_SET($cat_id, `" . $post_type . "category`) > 0) THEN $cat_id "; |
|
107 | - $cat_find_array[] = " FIND_IN_SET(%d, pd." . $post_type . "category)"; |
|
106 | + $field_default_cat .= "WHEN (FIND_IN_SET($cat_id, `".$post_type."category`) > 0) THEN $cat_id "; |
|
107 | + $cat_find_array[] = " FIND_IN_SET(%d, pd.".$post_type."category)"; |
|
108 | 108 | $main_query_array[] = $cat_id; |
109 | 109 | } |
110 | 110 | |
@@ -115,13 +115,13 @@ discard block |
||
115 | 115 | $field_default_cat = ''; |
116 | 116 | |
117 | 117 | if (!empty($cat_find_array)) |
118 | - $search .= "AND (" . implode(' OR ', $cat_find_array) . ")"; |
|
118 | + $search .= "AND (".implode(' OR ', $cat_find_array).")"; |
|
119 | 119 | |
120 | 120 | $main_query_array = $map_cat_ids_array; |
121 | 121 | |
122 | 122 | if (isset($_REQUEST['search']) && !empty($_REQUEST['search']) && $_REQUEST['search'] != __('Title', 'geodirectory')) { |
123 | 123 | $search .= " AND p.post_title LIKE %s"; |
124 | - $main_query_array[] = "%" . $_REQUEST['search'] . "%"; |
|
124 | + $main_query_array[] = "%".$_REQUEST['search']."%"; |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | /** |
@@ -143,14 +143,14 @@ discard block |
||
143 | 143 | |
144 | 144 | $gd_posttype = ''; |
145 | 145 | if (isset($_REQUEST['gd_posttype']) && $_REQUEST['gd_posttype'] != '') { |
146 | - $table = $plugin_prefix . $_REQUEST['gd_posttype'] . '_detail'; |
|
146 | + $table = $plugin_prefix.$_REQUEST['gd_posttype'].'_detail'; |
|
147 | 147 | $gd_posttype = " AND p.post_type = %s"; |
148 | 148 | $main_query_array[] = $_REQUEST['gd_posttype']; |
149 | 149 | |
150 | 150 | } else |
151 | - $table = $plugin_prefix . 'gd_place_detail'; |
|
151 | + $table = $plugin_prefix.'gd_place_detail'; |
|
152 | 152 | |
153 | - $join = ", " . $table . " AS pd "; |
|
153 | + $join = ", ".$table." AS pd "; |
|
154 | 154 | |
155 | 155 | /** |
156 | 156 | * Filter the SQL JOIN clause for the markers data |
@@ -170,14 +170,14 @@ discard block |
||
170 | 170 | */ |
171 | 171 | $search = apply_filters('geodir_home_map_listing_where', $search); |
172 | 172 | $search = str_replace(array("'%", "%'"), array("'%%", "%%'"), $search); |
173 | - $cat_type = $post_type . 'category'; |
|
173 | + $cat_type = $post_type.'category'; |
|
174 | 174 | if ($post_type == 'gd_event') { |
175 | 175 | $event_select = ", pd.recurring_dates, pd.is_recurring"; |
176 | 176 | } else { |
177 | 177 | $event_select = ""; |
178 | 178 | } |
179 | 179 | |
180 | - $sql_select = 'SELECT pd.default_category, pd.' . $cat_type . ', pd.post_title, pd.post_id, pd.post_latitude, pd.post_longitude' . $event_select; |
|
180 | + $sql_select = 'SELECT pd.default_category, pd.'.$cat_type.', pd.post_title, pd.post_id, pd.post_latitude, pd.post_longitude'.$event_select; |
|
181 | 181 | /** |
182 | 182 | * Filter the SQL SELECT clause to retrive fields data |
183 | 183 | * |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | */ |
198 | 198 | $groupby = apply_filters('geodir_home_map_listing_groupby', $groupby); |
199 | 199 | |
200 | - $catsql = $wpdb->prepare("$select $field_default_cat FROM " . $wpdb->posts . " as p" . $join . " WHERE p.ID = pd.post_id AND p.post_status = 'publish' " . $search . $gd_posttype . $groupby , $main_query_array); |
|
200 | + $catsql = $wpdb->prepare("$select $field_default_cat FROM ".$wpdb->posts." as p".$join." WHERE p.ID = pd.post_id AND p.post_status = 'publish' ".$search.$gd_posttype.$groupby, $main_query_array); |
|
201 | 201 | |
202 | 202 | /** |
203 | 203 | * Filter the SQL query to retrive markers data |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | $e = 0; |
260 | 260 | foreach ($recurring_dates as $date) { |
261 | 261 | if (strtotime($date) >= $today) { |
262 | - $event_dates .= ' :: ' . date_i18n($geodir_date_format, strtotime($date)); |
|
262 | + $event_dates .= ' :: '.date_i18n($geodir_date_format, strtotime($date)); |
|
263 | 263 | |
264 | 264 | $e++; |
265 | 265 | if ($e == 3) { // only show 3 event dates |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | $end_date = !empty($recurring_data['event_end']) && $recurring_data['event_end'] != '0000-00-00 00:00:00' ? $recurring_data['event_end'] : $start_date; |
274 | 274 | |
275 | 275 | if ($end_date != '' && strtotime($end_date) >= $today) { |
276 | - $event_dates .= ' :: ' . date_i18n($geodir_date_format, strtotime($start_date)) .' -> ' . date_i18n($geodir_date_format, strtotime($end_date)); |
|
276 | + $event_dates .= ' :: '.date_i18n($geodir_date_format, strtotime($start_date)).' -> '.date_i18n($geodir_date_format, strtotime($end_date)); |
|
277 | 277 | } |
278 | 278 | } |
279 | 279 | |
@@ -288,8 +288,8 @@ discard block |
||
288 | 288 | $default_cat = isset($catinfo_obj->default_category) ? $catinfo_obj->default_category : ''; |
289 | 289 | |
290 | 290 | // if single cat lets just show that icon |
291 | - if(is_array($map_cat_ids_array) && count($map_cat_ids_array)==1){ |
|
292 | - $default_cat = (int)$map_cat_ids_array[0]; |
|
291 | + if (is_array($map_cat_ids_array) && count($map_cat_ids_array) == 1) { |
|
292 | + $default_cat = (int) $map_cat_ids_array[0]; |
|
293 | 293 | } |
294 | 294 | |
295 | 295 | $icon = !empty($geodir_cat_icons) && isset($geodir_cat_icons[$default_cat]) ? $geodir_cat_icons[$default_cat] : ''; |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | $icon_size = array('w' => 36, 'h' => 45); |
310 | 310 | } |
311 | 311 | |
312 | - $content_data[] = '{"id":"' . $catinfo_obj->post_id . '","t": "' . $title . '","lt": "' . $catinfo_obj->post_latitude . '","ln": "' . $catinfo_obj->post_longitude . '","mk_id":"' . $catinfo_obj->post_id . '_' . $default_cat . '","i":"' . $icon . '","w":"' . $icon_size['w'] . '","h":"' . $icon_size['h'] . '"'.$mark_extra.'}'; |
|
312 | + $content_data[] = '{"id":"'.$catinfo_obj->post_id.'","t": "'.$title.'","lt": "'.$catinfo_obj->post_latitude.'","ln": "'.$catinfo_obj->post_longitude.'","mk_id":"'.$catinfo_obj->post_id.'_'.$default_cat.'","i":"'.$icon.'","w":"'.$icon_size['w'].'","h":"'.$icon_size['h'].'"'.$mark_extra.'}'; |
|
313 | 313 | $post_ids[] = $catinfo_obj->post_id; |
314 | 314 | } |
315 | 315 | } |
@@ -333,7 +333,7 @@ discard block |
||
333 | 333 | $totalcount = count(array_unique($post_ids)); |
334 | 334 | |
335 | 335 | if (!empty($cat_content_info)) { |
336 | - return '[{"totalcount":"' . $totalcount . '",' . substr(implode(',', $cat_content_info), 1) . ']'; |
|
336 | + return '[{"totalcount":"'.$totalcount.'",'.substr(implode(',', $cat_content_info), 1).']'; |
|
337 | 337 | } |
338 | 338 | else { |
339 | 339 | return '[{"totalcount":"0"}]'; |