Passed
Pull Request — master (#205)
by Kiran
06:14
created
geodirectory-functions/map-functions/map_template_tags.php 3 patches
Braces   +8 added lines, -6 removed lines patch added patch discarded remove patch
@@ -223,10 +223,11 @@  discard block
 block discarded – undo
223 223
                     <input type="hidden" id="<?php echo $map_canvas_name;?>_jason_enabled" value="0"/>
224 224
                 <?php }
225 225
 
226
-                if (!$geodir_map_options['enable_text_search'] && !$geodir_map_options['enable_cat_filters'])
227
-                    $show_entire_cat_panel = "none";
228
-                else
229
-                    $show_entire_cat_panel = "''";
226
+                if (!$geodir_map_options['enable_text_search'] && !$geodir_map_options['enable_cat_filters']) {
227
+                                    $show_entire_cat_panel = "none";
228
+                } else {
229
+                                    $show_entire_cat_panel = "''";
230
+                }
230 231
                 ?>
231 232
 
232 233
                 <?php if ($geodir_map_options['enable_map_direction']) { ?>
@@ -288,8 +289,9 @@  discard block
 block discarded – undo
288 289
 				}
289 290
 				
290 291
 				$geodir_default_map_search_pt = get_option('geodir_default_map_search_pt');
291
-				if (empty($geodir_default_map_search_pt))
292
-					$geodir_default_map_search_pt = 'gd_place';
292
+				if (empty($geodir_default_map_search_pt)) {
293
+									$geodir_default_map_search_pt = 'gd_place';
294
+				}
293 295
 
294 296
 				/**
295 297
 				 * Filter the post type to retrive data for map
Please login to merge, or discard this patch.
Indentation   +58 added lines, -58 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * All map related templates used by the plugin
4
- *
5
- * @since 1.0.0
6
- * @package GeoDirectory
7
- */
3
+     * All map related templates used by the plugin
4
+     *
5
+     * @since 1.0.0
6
+     * @package GeoDirectory
7
+     */
8 8
  
9 9
 /**
10 10
  * Contains all map related functions.
@@ -138,33 +138,33 @@  discard block
 block discarded – undo
138 138
     }
139 139
 
140 140
     /**
141
-	 * Filter the options to use in google map.
142
-	 *
143
-	 * @since 1.0.0
144
-	 *
145
-	 * @param array $geodir_map_options {@see geodir_draw_map()} docblock.
146
-	 */
147
-	$geodir_map_options = apply_filters("geodir_map_options_{$map_canvas_name}", $geodir_map_options);
141
+     * Filter the options to use in google map.
142
+     *
143
+     * @since 1.0.0
144
+     *
145
+     * @param array $geodir_map_options {@see geodir_draw_map()} docblock.
146
+     */
147
+    $geodir_map_options = apply_filters("geodir_map_options_{$map_canvas_name}", $geodir_map_options);
148 148
 
149 149
     $map_canvas_arr[$map_canvas_name] = array();
150 150
 
151 151
     /**
152
-	 * Filter the post types to display data on map.
153
-	 *
154
-	 * @since 1.0.0
155
-	 *
156
-	 * @param object $object Objects of post types.
157
-	 */
158
-	$post_types = apply_filters("geodir_map_post_type_list_{$map_canvas_name}", geodir_get_posttypes('object'));
152
+     * Filter the post types to display data on map.
153
+     *
154
+     * @since 1.0.0
155
+     *
156
+     * @param object $object Objects of post types.
157
+     */
158
+    $post_types = apply_filters("geodir_map_post_type_list_{$map_canvas_name}", geodir_get_posttypes('object'));
159 159
     
160
-	/**
161
-	 * Filter the post types to exclude to display data on map.
162
-	 *
163
-	 * @since 1.0.0
164
-	 *
165
-	 * @param array Array of post types to exclude to display data on map.
166
-	 */
167
-	$exclude_post_types = apply_filters("geodir_exclude_post_type_on_map_{$map_canvas_name}", get_option('geodir_exclude_post_type_on_map'));
160
+    /**
161
+     * Filter the post types to exclude to display data on map.
162
+     *
163
+     * @since 1.0.0
164
+     *
165
+     * @param array Array of post types to exclude to display data on map.
166
+     */
167
+    $exclude_post_types = apply_filters("geodir_exclude_post_type_on_map_{$map_canvas_name}", get_option('geodir_exclude_post_type_on_map'));
168 168
 
169 169
     if (count((array)$post_types) != count($exclude_post_types) || ($enable_jason_on_load)):
170 170
         // Set default map options
@@ -180,13 +180,13 @@  discard block
 block discarded – undo
180 180
         }
181 181
 
182 182
         /**
183
-		 * Filter the width of map.
184
-		 *
185
-		 * @since 1.0.0
186
-		 *
187
-		 * @param int $map_width Width of map box, eg: gd_place.
188
-		 */
189
-		$map_width = apply_filters('geodir_change_map_width', $map_width);
183
+         * Filter the width of map.
184
+         *
185
+         * @since 1.0.0
186
+         *
187
+         * @param int $map_width Width of map box, eg: gd_place.
188
+         */
189
+        $map_width = apply_filters('geodir_change_map_width', $map_width);
190 190
         ?>
191 191
         <div id="catcher_<?php echo $map_canvas_name;?>"></div>
192 192
         <div class="stick_trigger_container">
@@ -285,29 +285,29 @@  discard block
 block discarded – undo
285 285
 
286 286
                     <div id="<?php echo $map_canvas_name; ?>_directionsPanel" style="width:auto;"></div>
287 287
                 <?php 
288
-				}
288
+                }
289 289
 				
290
-				$geodir_default_map_search_pt = get_option('geodir_default_map_search_pt');
291
-				if (empty($geodir_default_map_search_pt))
292
-					$geodir_default_map_search_pt = 'gd_place';
293
-
294
-				/**
295
-				 * Filter the post type to retrive data for map
296
-				 *
297
-				 * @since 1.0.0
298
-				 *
299
-				 * @param string $geodir_default_map_search_pt Post type, eg: gd_place.
300
-				 */
301
-				$map_search_pt = apply_filters('geodir_default_map_search_pt', $geodir_default_map_search_pt);
302
-				?>
290
+                $geodir_default_map_search_pt = get_option('geodir_default_map_search_pt');
291
+                if (empty($geodir_default_map_search_pt))
292
+                    $geodir_default_map_search_pt = 'gd_place';
293
+
294
+                /**
295
+                 * Filter the post type to retrive data for map
296
+                 *
297
+                 * @since 1.0.0
298
+                 *
299
+                 * @param string $geodir_default_map_search_pt Post type, eg: gd_place.
300
+                 */
301
+                $map_search_pt = apply_filters('geodir_default_map_search_pt', $geodir_default_map_search_pt);
302
+                ?>
303 303
                 <div class="map-category-listing-main" style="display:<?php echo $show_entire_cat_panel;?>">
304 304
                     <?php
305 305
                     $exclude_post_types = get_option('geodir_exclude_post_type_on_map');
306 306
                     $geodir_available_pt_on_map = count(geodir_get_posttypes('array')) - count($exclude_post_types);
307
-					$map_cat_class = '';
308
-					if ($geodir_map_options['enable_post_type_filters']) {
309
-						$map_cat_class = $geodir_available_pt_on_map > 1 ? ' map-cat-ptypes' : ' map-cat-floor';
310
-					}
307
+                    $map_cat_class = '';
308
+                    if ($geodir_map_options['enable_post_type_filters']) {
309
+                        $map_cat_class = $geodir_available_pt_on_map > 1 ? ' map-cat-ptypes' : ' map-cat-floor';
310
+                    }
311 311
                     ?>
312 312
                     <div
313 313
                         class="map-category-listing<?php echo $map_cat_class;?>">
@@ -350,14 +350,14 @@  discard block
 block discarded – undo
350 350
 
351 351
                 <?php
352 352
                 if ($geodir_map_options['enable_location_filters']) {
353
-					$country = get_query_var('gd_country');
354
-					$region = get_query_var('gd_region');
355
-					$city = get_query_var('gd_city');
353
+                    $country = get_query_var('gd_country');
354
+                    $region = get_query_var('gd_region');
355
+                    $city = get_query_var('gd_city');
356 356
                     
357 357
                     //fix for location/me page
358 358
                     $country = $country != 'me' ? $country : '';
359
-					$region = $region != 'me' ? $region : '';
360
-					$city = $country != 'me' ? $city : '';
359
+                    $region = $region != 'me' ? $region : '';
360
+                    $city = $country != 'me' ? $city : '';
361 361
                     $gd_neighbourhood = isset($_REQUEST['gd_neighbourhood']) ? sanitize_text_field($_REQUEST['gd_neighbourhood']) : '';
362 362
                     ?>
363 363
                     <input type="hidden" id="<?php echo $map_canvas_name;?>_location_enabled" value="1"/>
@@ -396,7 +396,7 @@  discard block
 block discarded – undo
396 396
                                     foreach ($post_types as $post_type => $args) {
397 397
                                         if (!in_array($post_type, $exclude_post_types)) {
398 398
                                             $class = $map_search_pt == $post_type ? 'class="gd-map-search-pt"' : '';
399
-											echo '<li id="' . $post_type . '" ' . $class . '><a href="javascript:void(0);" onclick="jQuery(\'#' . $map_canvas_name . '_posttype\').val(\'' . $post_type . '\');build_map_ajax_search_param(\'' . $map_canvas_name . '\', true)">' . __(ucfirst($args->labels->name), 'geodirectory') . '</a></li>';
399
+                                            echo '<li id="' . $post_type . '" ' . $class . '><a href="javascript:void(0);" onclick="jQuery(\'#' . $map_canvas_name . '_posttype\').val(\'' . $post_type . '\');build_map_ajax_search_param(\'' . $map_canvas_name . '\', true)">' . __(ucfirst($args->labels->name), 'geodirectory') . '</a></li>';
400 400
                                         }
401 401
                                     }
402 402
                                     ?>
Please login to merge, or discard this patch.
Spacing   +58 added lines, -58 removed lines patch added patch discarded remove patch
@@ -166,10 +166,10 @@  discard block
 block discarded – undo
166 166
 	 */
167 167
 	$exclude_post_types = apply_filters("geodir_exclude_post_type_on_map_{$map_canvas_name}", get_option('geodir_exclude_post_type_on_map'));
168 168
 
169
-    if (count((array)$post_types) != count($exclude_post_types) || ($enable_jason_on_load)):
169
+    if (count((array) $post_types) != count($exclude_post_types) || ($enable_jason_on_load)):
170 170
         // Set default map options
171 171
 
172
-        wp_enqueue_script('geodir-map-widget', geodir_plugin_url() . '/geodirectory-functions/map-functions/js/map.min.js',array(),false,true);
172
+        wp_enqueue_script('geodir-map-widget', geodir_plugin_url() . '/geodirectory-functions/map-functions/js/map.min.js', array(), false, true);
173 173
 
174 174
         wp_localize_script('geodir-map-widget', $map_canvas_name, $geodir_map_options);
175 175
 
@@ -188,39 +188,39 @@  discard block
 block discarded – undo
188 188
 		 */
189 189
 		$map_width = apply_filters('geodir_change_map_width', $map_width);
190 190
         ?>
191
-        <div id="catcher_<?php echo $map_canvas_name;?>"></div>
191
+        <div id="catcher_<?php echo $map_canvas_name; ?>"></div>
192 192
         <div class="stick_trigger_container">
193 193
             <div class="trigger_sticky triggeroff_sticky"></div>
194
-            <div class="top_banner_section geodir_map_container <?php echo $map_class_name;?>"
195
-                 id="sticky_map_<?php echo $map_canvas_name;?>"
196
-                 style="min-height:<?php echo $geodir_map_options['height'];?>;width:<?php echo $map_width;?>;">
194
+            <div class="top_banner_section geodir_map_container <?php echo $map_class_name; ?>"
195
+                 id="sticky_map_<?php echo $map_canvas_name; ?>"
196
+                 style="min-height:<?php echo $geodir_map_options['height']; ?>;width:<?php echo $map_width; ?>;">
197 197
 
198 198
                 <div class="map_background">
199 199
                     <div class="top_banner_section_in clearfix">
200
-                        <div class="<?php echo $map_canvas_name;?>_TopLeft TopLeft"><span class="triggermap" id="<?php echo $map_canvas_name;?>_triggermap" <?php if (!$geodir_map_options['enable_map_resize_button']) { ?> <?php }?>><i class="fa fa-arrows-alt"></i></span></div>
201
-                        <div class="<?php echo $map_canvas_name;?>_TopRight TopRight"></div>
202
-                        <div id="<?php echo $map_canvas_name;?>_wrapper" class="main_map_wrapper"
203
-                             style="height:<?php echo $geodir_map_options['height'];?>;width:<?php echo $map_width;?>;">
200
+                        <div class="<?php echo $map_canvas_name; ?>_TopLeft TopLeft"><span class="triggermap" id="<?php echo $map_canvas_name; ?>_triggermap" <?php if (!$geodir_map_options['enable_map_resize_button']) { ?> <?php }?>><i class="fa fa-arrows-alt"></i></span></div>
201
+                        <div class="<?php echo $map_canvas_name; ?>_TopRight TopRight"></div>
202
+                        <div id="<?php echo $map_canvas_name; ?>_wrapper" class="main_map_wrapper"
203
+                             style="height:<?php echo $geodir_map_options['height']; ?>;width:<?php echo $map_width; ?>;">
204 204
                             <!-- new map start -->
205 205
                             <div class="iprelative">
206
-                                <div class="geodir_marker_cluster" id="<?php echo $map_canvas_name;?>"
207
-                                     style="height:<?php echo $geodir_map_options['height'];?>;width:<?php echo $map_width;?>;"></div>
208
-                                <div id="<?php echo $map_canvas_name;?>_loading_div" class="loading_div"
209
-                                     style=" height:<?php echo $geodir_map_options['height'];?>;width:<?php echo $map_width;?>;"></div>
206
+                                <div class="geodir_marker_cluster" id="<?php echo $map_canvas_name; ?>"
207
+                                     style="height:<?php echo $geodir_map_options['height']; ?>;width:<?php echo $map_width; ?>;"></div>
208
+                                <div id="<?php echo $map_canvas_name; ?>_loading_div" class="loading_div"
209
+                                     style=" height:<?php echo $geodir_map_options['height']; ?>;width:<?php echo $map_width; ?>;"></div>
210 210
                                 <!--<div id="home_map_counter"></div>        -->
211
-                                <div id="<?php echo $map_canvas_name;?>_map_nofound"
211
+                                <div id="<?php echo $map_canvas_name; ?>_map_nofound"
212 212
                                      class="advmap_nofound"><?php echo MAP_NO_RESULTS; ?></div>
213 213
                             </div>
214 214
                             <!-- new map end -->
215 215
                         </div>
216
-                        <div class="<?php echo $map_canvas_name;?>_BottomLeft BottomLeft"></div>
216
+                        <div class="<?php echo $map_canvas_name; ?>_BottomLeft BottomLeft"></div>
217 217
                     </div>
218 218
                 </div>
219 219
                 <?php if ($geodir_map_options['enable_jason_on_load']) { ?>
220
-                    <input type="hidden" id="<?php echo $map_canvas_name;?>_jason_enabled" value="1"/>
220
+                    <input type="hidden" id="<?php echo $map_canvas_name; ?>_jason_enabled" value="1"/>
221 221
                 <?php } else {
222 222
                     ?>
223
-                    <input type="hidden" id="<?php echo $map_canvas_name;?>_jason_enabled" value="0"/>
223
+                    <input type="hidden" id="<?php echo $map_canvas_name; ?>_jason_enabled" value="0"/>
224 224
                 <?php }
225 225
 
226 226
                 if (!$geodir_map_options['enable_text_search'] && !$geodir_map_options['enable_cat_filters'])
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
                            onclick="calcRoute('<?php echo $map_canvas_name; ?>')"/>
241 241
 
242 242
                     <script>
243
-                        <?php if(geodir_is_page('detail')){?>
243
+                        <?php if (geodir_is_page('detail')) {?>
244 244
                         jQuery(function () {
245 245
                             gd_initialize_ac();
246 246
                         });
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
                             // Create the autocomplete object, restricting the search
251 251
                             // to geographical location types.
252 252
                             autocomplete = new google.maps.places.Autocomplete(
253
-                                /** @type {HTMLInputElement} */(document.getElementById('<?php echo $map_canvas_name;?>_fromAddress')),
253
+                                /** @type {HTMLInputElement} */(document.getElementById('<?php echo $map_canvas_name; ?>_fromAddress')),
254 254
                                 {types: ['geocode']});
255 255
                             // When the user selects an address from the dropdown,
256 256
                             // populate the address fields in the form.
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
 				 */
301 301
 				$map_search_pt = apply_filters('geodir_default_map_search_pt', $geodir_default_map_search_pt);
302 302
 				?>
303
-                <div class="map-category-listing-main" style="display:<?php echo $show_entire_cat_panel;?>">
303
+                <div class="map-category-listing-main" style="display:<?php echo $show_entire_cat_panel; ?>">
304 304
                     <?php
305 305
                     $exclude_post_types = get_option('geodir_exclude_post_type_on_map');
306 306
                     $geodir_available_pt_on_map = count(geodir_get_posttypes('array')) - count($exclude_post_types);
@@ -310,12 +310,12 @@  discard block
 block discarded – undo
310 310
 					}
311 311
                     ?>
312 312
                     <div
313
-                        class="map-category-listing<?php echo $map_cat_class;?>">
313
+                        class="map-category-listing<?php echo $map_cat_class; ?>">
314 314
                         <div class="trigger triggeroff"><i class="fa fa-compress"></i><i class="fa fa-expand"></i></div>
315
-                        <div id="<?php echo $map_canvas_name;?>_cat"
316
-                             class="<?php echo $map_canvas_name;?>_map_category  map_category"
317
-                             <?php if ($child_collapse){ ?>checked="checked" <?php }?>
318
-                             style="max-height:<?php echo $geodir_map_options['height'];?>;">
315
+                        <div id="<?php echo $map_canvas_name; ?>_cat"
316
+                             class="<?php echo $map_canvas_name; ?>_map_category  map_category"
317
+                             <?php if ($child_collapse) { ?>checked="checked" <?php }?>
318
+                             style="max-height:<?php echo $geodir_map_options['height']; ?>;">
319 319
                             <input
320 320
                                 onkeydown="if(event.keyCode == 13){build_map_ajax_search_param('<?php echo $map_canvas_name; ?>', false)}"
321 321
                                 type="text"
@@ -327,11 +327,11 @@  discard block
 block discarded – undo
327 327
                                     <input type="hidden" id="<?php echo $map_canvas_name; ?>_child_collapse" value="1"/>
328 328
                                 <?php } else {$child_collapse = "0";
329 329
                                     ?>
330
-                                    <input type="hidden" id="<?php echo $map_canvas_name;?>_child_collapse" value="0"/>
330
+                                    <input type="hidden" id="<?php echo $map_canvas_name; ?>_child_collapse" value="0"/>
331 331
                                 <?php } ?>
332 332
                                 <input type="hidden" id="<?php echo $map_canvas_name; ?>_cat_enabled" value="1"/>
333 333
                                 <div class="toggle">
334
-                                    <?php echo home_map_taxonomy_walker(array($map_search_pt.'category'),0,true,0,$map_canvas_name,$child_collapse,true); ?>
334
+                                    <?php echo home_map_taxonomy_walker(array($map_search_pt . 'category'), 0, true, 0, $map_canvas_name, $child_collapse, true); ?>
335 335
                                     <script>jQuery( document ).ready(function() {
336 336
                                             geodir_show_sub_cat_collapse_button();
337 337
                                         });</script>
@@ -360,21 +360,21 @@  discard block
 block discarded – undo
360 360
 					$city = $country != 'me' ? $city : '';
361 361
                     $gd_neighbourhood = isset($_REQUEST['gd_neighbourhood']) ? sanitize_text_field($_REQUEST['gd_neighbourhood']) : '';
362 362
                     ?>
363
-                    <input type="hidden" id="<?php echo $map_canvas_name;?>_location_enabled" value="1"/>
364
-                    <input type="hidden" id="<?php echo $map_canvas_name;?>_country" name="gd_country"
365
-                           value="<?php echo $country;?>"/>
366
-                    <input type="hidden" id="<?php echo $map_canvas_name;?>_region" name="gd_region"
367
-                           value="<?php echo $region;?>"/>
368
-                    <input type="hidden" id="<?php echo $map_canvas_name;?>_city" name="gd_city"
369
-                           value="<?php echo $city;?>"/>
370
-                    <input type="hidden" id="<?php echo $map_canvas_name;?>_neighbourhood" name="gd_neighbourhood"
371
-                           value="<?php echo $gd_neighbourhood;?>"/>
363
+                    <input type="hidden" id="<?php echo $map_canvas_name; ?>_location_enabled" value="1"/>
364
+                    <input type="hidden" id="<?php echo $map_canvas_name; ?>_country" name="gd_country"
365
+                           value="<?php echo $country; ?>"/>
366
+                    <input type="hidden" id="<?php echo $map_canvas_name; ?>_region" name="gd_region"
367
+                           value="<?php echo $region; ?>"/>
368
+                    <input type="hidden" id="<?php echo $map_canvas_name; ?>_city" name="gd_city"
369
+                           value="<?php echo $city; ?>"/>
370
+                    <input type="hidden" id="<?php echo $map_canvas_name; ?>_neighbourhood" name="gd_neighbourhood"
371
+                           value="<?php echo $gd_neighbourhood; ?>"/>
372 372
                 <?php } else { //end of location filter
373 373
                     ?>
374
-                    <input type="hidden" id="<?php echo $map_canvas_name;?>_location_enabled" value="0"/>
374
+                    <input type="hidden" id="<?php echo $map_canvas_name; ?>_location_enabled" value="0"/>
375 375
                 <?php }?>
376 376
 
377
-                <input type="hidden" id="<?php echo $map_canvas_name;?>_posttype" name="gd_posttype" value="<?php echo $map_search_pt;?>"/>
377
+                <input type="hidden" id="<?php echo $map_canvas_name; ?>_posttype" name="gd_posttype" value="<?php echo $map_search_pt; ?>"/>
378 378
 
379 379
                 <input type="hidden" name="limitstart" value=""/>
380 380
 
@@ -382,10 +382,10 @@  discard block
 block discarded – undo
382 382
 
383 383
                 <?php if ($geodir_map_options['enable_post_type_filters']) {
384 384
                     $post_types = geodir_get_posttypes('object');
385
-                    if (count((array)($post_types)) > 1) {
385
+                    if (count((array) ($post_types)) > 1) {
386 386
                         ?>
387
-                        <div class="map-places-listing" id="<?php echo $map_canvas_name;?>_posttype_menu"
388
-                             style="max-width:<?php echo $map_width;?>!important;">
387
+                        <div class="map-places-listing" id="<?php echo $map_canvas_name; ?>_posttype_menu"
388
+                             style="max-width:<?php echo $map_width; ?>!important;">
389 389
 
390 390
                             <?php if (isset($geodir_map_options['is_geodir_home_map_widget']) && $map_args['is_geodir_home_map_widget']) { ?>
391 391
                             <div class="geodir-map-posttype-list"><?php } ?>
@@ -421,9 +421,9 @@  discard block
 block discarded – undo
421 421
         <script type="text/javascript">
422 422
 
423 423
             jQuery(document).ready(function () {
424
-                //initMap('<?php echo $map_canvas_name;?>'); // depreciated, no need to load this twice
425
-                build_map_ajax_search_param('<?php echo $map_canvas_name;?>', false);
426
-                map_sticky('<?php echo $map_canvas_name;?>');
424
+                //initMap('<?php echo $map_canvas_name; ?>'); // depreciated, no need to load this twice
425
+                build_map_ajax_search_param('<?php echo $map_canvas_name; ?>', false);
426
+                map_sticky('<?php echo $map_canvas_name; ?>');
427 427
             });
428 428
 
429 429
         </script>
@@ -434,18 +434,18 @@  discard block
 block discarded – undo
434 434
             <script>
435 435
                 (function () {
436 436
                     var screenH = jQuery(window).height();
437
-                    var heightVH = "<?php echo str_replace("vh", "", $geodir_map_options['height']);?>";
437
+                    var heightVH = "<?php echo str_replace("vh", "", $geodir_map_options['height']); ?>";
438 438
 
439 439
                     var ptypeH = '';
440
-                    if (jQuery("#<?php echo $map_canvas_name;?>_posttype_menu").length) {
441
-                        ptypeH = jQuery("#<?php echo $map_canvas_name;?>_posttype_menu").outerHeight();
440
+                    if (jQuery("#<?php echo $map_canvas_name; ?>_posttype_menu").length) {
441
+                        ptypeH = jQuery("#<?php echo $map_canvas_name; ?>_posttype_menu").outerHeight();
442 442
                     }
443 443
 
444
-                    jQuery("#sticky_map_<?php echo $map_canvas_name;?>").css("min-height", screenH * (heightVH / 100) + 'px');
445
-                    jQuery("#<?php echo $map_canvas_name;?>_wrapper").height(screenH * (heightVH / 100) + 'px');
446
-                    jQuery("#<?php echo $map_canvas_name;?>").height(screenH * (heightVH / 100) + 'px');
447
-                    jQuery("#<?php echo $map_canvas_name;?>_loading_div").height(screenH * (heightVH / 100) + 'px');
448
-                    jQuery("#<?php echo $map_canvas_name;?>_cat").css("max-height", (screenH * (heightVH / 100)) - ptypeH + 'px');
444
+                    jQuery("#sticky_map_<?php echo $map_canvas_name; ?>").css("min-height", screenH * (heightVH / 100) + 'px');
445
+                    jQuery("#<?php echo $map_canvas_name; ?>_wrapper").height(screenH * (heightVH / 100) + 'px');
446
+                    jQuery("#<?php echo $map_canvas_name; ?>").height(screenH * (heightVH / 100) + 'px');
447
+                    jQuery("#<?php echo $map_canvas_name; ?>_loading_div").height(screenH * (heightVH / 100) + 'px');
448
+                    jQuery("#<?php echo $map_canvas_name; ?>_cat").css("max-height", (screenH * (heightVH / 100)) - ptypeH + 'px');
449 449
 
450 450
                 }());
451 451
             </script>
@@ -457,13 +457,13 @@  discard block
 block discarded – undo
457 457
             <script>
458 458
                 (function () {
459 459
                     var screenH = jQuery(window).height();
460
-                    var heightVH = "<?php echo str_replace("px", "", $geodir_map_options['height']);?>";
460
+                    var heightVH = "<?php echo str_replace("px", "", $geodir_map_options['height']); ?>";
461 461
                     var ptypeH = '';
462
-                    if (jQuery("#<?php echo $map_canvas_name;?>_posttype_menu").length) {
463
-                        ptypeH = jQuery("#<?php echo $map_canvas_name;?>_posttype_menu").outerHeight();
462
+                    if (jQuery("#<?php echo $map_canvas_name; ?>_posttype_menu").length) {
463
+                        ptypeH = jQuery("#<?php echo $map_canvas_name; ?>_posttype_menu").outerHeight();
464 464
                     }
465 465
 
466
-                    jQuery("#<?php echo $map_canvas_name;?>_cat").css("max-height", heightVH - ptypeH + 'px');
466
+                    jQuery("#<?php echo $map_canvas_name; ?>_cat").css("max-height", heightVH - ptypeH + 'px');
467 467
 
468 468
                 }());
469 469
             </script>
@@ -478,7 +478,7 @@  discard block
 block discarded – undo
478 478
          * @param array $geodir_map_options Array of map settings.
479 479
          * @param string $map_canvas_name The canvas name and ID for the map.
480 480
          */
481
-        do_action('geodir_map_after_render',$geodir_map_options,$map_canvas_name);
481
+        do_action('geodir_map_after_render', $geodir_map_options, $map_canvas_name);
482 482
 
483 483
 
484 484
     endif; // Exclude posttypes if end
Please login to merge, or discard this patch.
geodirectory-functions/post_functions.php 4 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
      * @global object $wpdb WordPress Database object.
80 80
      * @global object $post The current post object.
81 81
      * @global object $current_user Current user object.
82
-	 * @global object $gd_session GeoDirectory Session object.
82
+     * @global object $gd_session GeoDirectory Session object.
83 83
      * @param array $request_info {
84 84
      *    Array of request info arguments.
85 85
      *
@@ -2554,9 +2554,9 @@  discard block
 block discarded – undo
2554 2554
 function geodir_excerpt_length($length)
2555 2555
 {
2556 2556
     global $wp_query, $geodir_is_widget_listing;
2557
-	if ($geodir_is_widget_listing) {
2558
-		return $length;
2559
-	}
2557
+    if ($geodir_is_widget_listing) {
2558
+        return $length;
2559
+    }
2560 2560
 	
2561 2561
     if (isset($wp_query->query_vars['is_geodir_loop']) && $wp_query->query_vars['is_geodir_loop'] && get_option('geodir_desc_word_limit'))
2562 2562
         $length = get_option('geodir_desc_word_limit');
Please login to merge, or discard this patch.
Braces   +176 added lines, -125 removed lines patch added patch discarded remove patch
@@ -21,12 +21,13 @@  discard block
 block discarded – undo
21 21
 {
22 22
 
23 23
     $post_cat_ids = geodir_get_post_meta($post_id, $taxonomy);
24
-    if (!empty($post_cat_ids))
25
-        $post_cat_array = explode(",", trim($post_cat_ids, ","));
24
+    if (!empty($post_cat_ids)) {
25
+            $post_cat_array = explode(",", trim($post_cat_ids, ","));
26
+    }
26 27
 
27 28
     if (!isset($default_cat) || empty($default_cat)) {
28 29
         $default_cat = isset($post_cat_array[0]) ? $post_cat_array[0] : '';
29
-    }else{
30
+    } else{
30 31
         if(!is_int($default_cat)){
31 32
             $category = get_term_by('name', $default_cat, $taxonomy);
32 33
             if(isset($category->term_id)){
@@ -372,8 +373,9 @@  discard block
 block discarded – undo
372 373
             } elseif (trim($type) == 'file') {
373 374
                 if (isset($request_info[$name])) {
374 375
                     $request_files = array();
375
-                    if ($request_info[$name] != '')
376
-                        $request_files = explode(",", $request_info[$name]);
376
+                    if ($request_info[$name] != '') {
377
+                                            $request_files = explode(",", $request_info[$name]);
378
+                    }
377 379
 
378 380
                     $extrafields = $extrafields != '' ? maybe_unserialize($extrafields) : NULL;
379 381
                     geodir_save_post_file_fields($last_post_id, $name, $request_files, $extrafields);
@@ -428,15 +430,17 @@  discard block
 block discarded – undo
428 430
 
429 431
             foreach ($request_info['post_category'] as $taxonomy => $cat) {
430 432
 
431
-                if ($dummy)
432
-                    $post_category = $cat;
433
-                else {
433
+                if ($dummy) {
434
+                                    $post_category = $cat;
435
+                } else {
434 436
 
435
-                    if (!is_array($cat) && strstr($cat, ','))
436
-                        $cat = explode(',', $cat);
437
+                    if (!is_array($cat) && strstr($cat, ',')) {
438
+                                            $cat = explode(',', $cat);
439
+                    }
437 440
 
438
-                    if (!empty($cat) && is_array($cat))
439
-                        $post_category = array_map('intval', $cat);
441
+                    if (!empty($cat) && is_array($cat)) {
442
+                                            $post_category = array_map('intval', $cat);
443
+                    }
440 444
                 }
441 445
 
442 446
                 wp_set_object_terms($last_post_id, $post_category, $taxonomy);
@@ -454,11 +458,13 @@  discard block
 block discarded – undo
454 458
         if (isset($request_info['post_tags']) && !is_array($request_info['post_tags']) && !empty($request_info['post_tags'])) {
455 459
             $post_tags = explode(",", $request_info['post_tags']);
456 460
         } elseif (isset($request_info['post_tags']) && is_array($request_info['post_tags'])) {
457
-            if ($dummy)
458
-                $post_tags = $request_info['post_tags'];
461
+            if ($dummy) {
462
+                            $post_tags = $request_info['post_tags'];
463
+            }
459 464
         } else {
460
-            if ($dummy)
461
-                $post_tags = array($request_info['post_title']);
465
+            if ($dummy) {
466
+                            $post_tags = array($request_info['post_title']);
467
+            }
462 468
         }
463 469
 
464 470
         if (is_array($post_tags)) {
@@ -545,15 +551,17 @@  discard block
 block discarded – undo
545 551
 
546 552
     global $wpdb, $plugin_prefix, $post, $post_info;
547 553
 
548
-    if ($post_id == '' && !empty($post))
549
-        $post_id = $post->ID;
554
+    if ($post_id == '' && !empty($post)) {
555
+            $post_id = $post->ID;
556
+    }
550 557
 
551 558
     $post_type = get_post_type($post_id);
552 559
 
553 560
     $all_postypes = geodir_get_posttypes();
554 561
 
555
-    if (!in_array($post_type, $all_postypes))
556
-        return false;
562
+    if (!in_array($post_type, $all_postypes)) {
563
+            return false;
564
+    }
557 565
 
558 566
     $table = $plugin_prefix . $post_type . '_detail';
559 567
 
@@ -703,8 +711,9 @@  discard block
 block discarded – undo
703 711
             do_action('geodir_after_save_listinginfo', $postinfo_array, $post_id);
704 712
 
705 713
             return true;
706
-        } else
707
-            return false;
714
+        } else {
715
+                    return false;
716
+        }
708 717
 
709 718
     }
710 719
 }
@@ -758,8 +767,9 @@  discard block
 block discarded – undo
758 767
             }
759 768
 
760 769
 
761
-        } else
762
-            return false;
770
+        } else {
771
+                    return false;
772
+        }
763 773
     }
764 774
 }
765 775
 
@@ -790,8 +800,9 @@  discard block
 block discarded – undo
790 800
             $post_meta_set_query = '';
791 801
 
792 802
             foreach ($postmeta as $mkey) {
793
-                if ($mval != '')
794
-                    $post_meta_set_query .= $mkey . " = '', ";
803
+                if ($mval != '') {
804
+                                    $post_meta_set_query .= $mkey . " = '', ";
805
+                }
795 806
             }
796 807
 
797 808
             $post_meta_set_query = trim($post_meta_set_query, ", ");
@@ -821,8 +832,9 @@  discard block
 block discarded – undo
821 832
                 return true;
822 833
             }
823 834
 
824
-        } else
825
-            return false;
835
+        } else {
836
+                    return false;
837
+        }
826 838
     }
827 839
 }
828 840
 
@@ -852,8 +864,9 @@  discard block
 block discarded – undo
852 864
 
853 865
         $post_type = get_post_type($post_id);
854 866
 
855
-        if (!in_array($post_type, $all_postypes))
856
-            return false;
867
+        if (!in_array($post_type, $all_postypes)) {
868
+                    return false;
869
+        }
857 870
 
858 871
         $table = $plugin_prefix . $post_type . '_detail';
859 872
 
@@ -862,11 +875,13 @@  discard block
 block discarded – undo
862 875
             if ($meta_value = $wpdb->get_var($wpdb->prepare("SELECT " . $meta_key . " from " . $table . " where post_id = %d", array($post_id)))) {
863 876
                 $meta_value = maybe_serialize($meta_value);
864 877
                 return $meta_value;
865
-            } else
866
-                return false;
878
+            } else {
879
+                            return false;
880
+            }
867 881
 
868
-        } else
869
-            return false;
882
+        } else {
883
+                    return false;
884
+        }
870 885
     }
871 886
 }
872 887
 
@@ -997,7 +1012,7 @@  discard block
 block discarded – undo
997 1012
                             if (isset($uploaded['error']) && empty($uploaded['error'])) {
998 1013
                                 $new_name = basename($uploaded['file']);
999 1014
                                 $uploaded_file = $uploaded;
1000
-                            }else{
1015
+                            } else{
1001 1016
                                 print_r($uploaded);exit;
1002 1017
                             }
1003 1018
                             $external_img = false;
@@ -1022,8 +1037,9 @@  discard block
 block discarded – undo
1022 1037
                                 $file_path = $curr_img_dir . '/' . $filename;
1023 1038
                             }
1024 1039
 
1025
-                            if ($curr_img_dir != $geodir_uploaddir && file_exists($img_path))
1026
-                                unlink($img_path);
1040
+                            if ($curr_img_dir != $geodir_uploaddir && file_exists($img_path)) {
1041
+                                                            unlink($img_path);
1042
+                            }
1027 1043
                         }
1028 1044
 
1029 1045
                         if (!empty($uploaded_file)) {
@@ -1052,8 +1068,9 @@  discard block
 block discarded – undo
1052 1068
                             $attachment_set = '';
1053 1069
 
1054 1070
                             foreach ($attachment as $key => $val) {
1055
-                                if ($val != '')
1056
-                                    $attachment_set .= $key . " = '" . $val . "', ";
1071
+                                if ($val != '') {
1072
+                                                                    $attachment_set .= $key . " = '" . $val . "', ";
1073
+                                }
1057 1074
                             }
1058 1075
 
1059 1076
                             $attachment_set = trim($attachment_set, ", ");
@@ -1078,8 +1095,9 @@  discard block
 block discarded – undo
1078 1095
                         )
1079 1096
                     );
1080 1097
 
1081
-                    if ($menu_order == 1)
1082
-                        $wpdb->query($wpdb->prepare("UPDATE " . $table . " SET featured_image = %s where post_id =%d", array($split_img_path[1], $post_id)));
1098
+                    if ($menu_order == 1) {
1099
+                                            $wpdb->query($wpdb->prepare("UPDATE " . $table . " SET featured_image = %s where post_id =%d", array($split_img_path[1], $post_id)));
1100
+                    }
1083 1101
 
1084 1102
                 }
1085 1103
 
@@ -1120,8 +1138,9 @@  discard block
 block discarded – undo
1120 1138
 
1121 1139
         $wpdb->query($wpdb->prepare("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE " . $valid_files_condition . " post_id = %d", $remove_files));
1122 1140
 
1123
-        if (!empty($invalid_files))
1124
-            geodir_remove_attachments($invalid_files);
1141
+        if (!empty($invalid_files)) {
1142
+                    geodir_remove_attachments($invalid_files);
1143
+        }
1125 1144
     }
1126 1145
 
1127 1146
 }
@@ -1174,16 +1193,19 @@  discard block
 block discarded – undo
1174 1193
 function geodir_delete_directory($dirname)
1175 1194
 {
1176 1195
     $dir_handle = '';
1177
-    if (is_dir($dirname))
1178
-        $dir_handle = opendir($dirname);
1179
-    if (!$dir_handle)
1180
-        return false;
1196
+    if (is_dir($dirname)) {
1197
+            $dir_handle = opendir($dirname);
1198
+    }
1199
+    if (!$dir_handle) {
1200
+            return false;
1201
+    }
1181 1202
     while ($file = readdir($dir_handle)) {
1182 1203
         if ($file != "." && $file != "..") {
1183
-            if (!is_dir($dirname . "/" . $file))
1184
-                unlink($dirname . "/" . $file);
1185
-            else
1186
-                geodir_delete_directory($dirname . '/' . $file);
1204
+            if (!is_dir($dirname . "/" . $file)) {
1205
+                            unlink($dirname . "/" . $file);
1206
+            } else {
1207
+                            geodir_delete_directory($dirname . '/' . $file);
1208
+            }
1187 1209
         }
1188 1210
     }
1189 1211
     closedir($dir_handle);
@@ -1212,8 +1234,9 @@  discard block
 block discarded – undo
1212 1234
             foreach ($postcurr_images as $postimg) {
1213 1235
                 $image_name_arr = explode('/', $postimg->src);
1214 1236
                 $filename = end($image_name_arr);
1215
-                if (file_exists($uploads_dir . '/' . $filename))
1216
-                    unlink($uploads_dir . '/' . $filename);
1237
+                if (file_exists($uploads_dir . '/' . $filename)) {
1238
+                                    unlink($uploads_dir . '/' . $filename);
1239
+                }
1217 1240
             }
1218 1241
 
1219 1242
         } // endif
@@ -1267,8 +1290,9 @@  discard block
 block discarded – undo
1267 1290
 
1268 1291
             $file_info = pathinfo($file);
1269 1292
             $sub_dir = '';
1270
-            if ($file_info['dirname'] != '.' && $file_info['dirname'] != '..')
1271
-                $sub_dir = stripslashes_deep($file_info['dirname']);
1293
+            if ($file_info['dirname'] != '.' && $file_info['dirname'] != '..') {
1294
+                            $sub_dir = stripslashes_deep($file_info['dirname']);
1295
+            }
1272 1296
 
1273 1297
             $uploads = wp_upload_dir(trim($sub_dir, '/')); // Array of key => value pairs
1274 1298
             $uploads_baseurl = $uploads['baseurl'];
@@ -1312,9 +1336,9 @@  discard block
 block discarded – undo
1312 1336
                 $default_cat = geodir_get_post_meta($post_id, 'default_category', true);
1313 1337
             }
1314 1338
 
1315
-            if ($default_catimg = geodir_get_default_catimage($default_cat, $post_type))
1316
-                $default_img = $default_catimg['src'];
1317
-            elseif ($no_image) {
1339
+            if ($default_catimg = geodir_get_default_catimage($default_cat, $post_type)) {
1340
+                            $default_img = $default_catimg['src'];
1341
+            } elseif ($no_image) {
1318 1342
                 $default_img = get_option('geodir_listing_no_img');
1319 1343
             }
1320 1344
 
@@ -1343,10 +1367,13 @@  discard block
 block discarded – undo
1343 1367
 
1344 1368
         }
1345 1369
 
1346
-        if (!empty($img_arr))
1347
-            return (object)$img_arr;//return (object)array( 'src' => $file_url, 'path' => $file_path );
1348
-        else
1349
-            return false;
1370
+        if (!empty($img_arr)) {
1371
+                    return (object)$img_arr;
1372
+        }
1373
+        //return (object)array( 'src' => $file_url, 'path' => $file_path );
1374
+        else {
1375
+                    return false;
1376
+        }
1350 1377
 
1351 1378
     }
1352 1379
 }
@@ -1376,8 +1403,9 @@  discard block
 block discarded – undo
1376 1403
             echo $html;
1377 1404
         } elseif (!empty($html)) {
1378 1405
             return $html;
1379
-        } else
1380
-            return false;
1406
+        } else {
1407
+                    return false;
1408
+        }
1381 1409
 
1382 1410
     }
1383 1411
 }
@@ -1407,8 +1435,9 @@  discard block
 block discarded – undo
1407 1435
         }
1408 1436
         $not_featured = '';
1409 1437
         $sub_dir = '';
1410
-        if (!$add_featured)
1411
-            $not_featured = " AND is_featured = 0 ";
1438
+        if (!$add_featured) {
1439
+                    $not_featured = " AND is_featured = 0 ";
1440
+        }
1412 1441
 
1413 1442
         $arrImages = $wpdb->get_results(
1414 1443
             $wpdb->prepare(
@@ -1430,8 +1459,9 @@  discard block
 block discarded – undo
1430 1459
 
1431 1460
                 $file_info = pathinfo($attechment->file);
1432 1461
 
1433
-                if ($file_info['dirname'] != '.' && $file_info['dirname'] != '..')
1434
-                    $sub_dir = stripslashes_deep($file_info['dirname']);
1462
+                if ($file_info['dirname'] != '.' && $file_info['dirname'] != '..') {
1463
+                                    $sub_dir = stripslashes_deep($file_info['dirname']);
1464
+                }
1435 1465
 
1436 1466
                 $uploads = wp_upload_dir(trim($sub_dir, '/')); // Array of key => value pairs
1437 1467
                 $uploads_baseurl = $uploads['baseurl'];
@@ -1473,9 +1503,9 @@  discard block
 block discarded – undo
1473 1503
             $default_img = '';
1474 1504
             $default_cat = geodir_get_post_meta($post_id, 'default_category', true);
1475 1505
             $post_type = get_post_type($post_id);
1476
-            if ($default_catimg = geodir_get_default_catimage($default_cat, $post_type))
1477
-                $default_img = $default_catimg['src'];
1478
-            elseif ($no_images) {
1506
+            if ($default_catimg = geodir_get_default_catimage($default_cat, $post_type)) {
1507
+                            $default_img = $default_catimg['src'];
1508
+            } elseif ($no_images) {
1479 1509
                 $default_img = get_option('geodir_listing_no_img');
1480 1510
             }
1481 1511
 
@@ -1506,8 +1536,9 @@  discard block
 block discarded – undo
1506 1536
 
1507 1537
                 return $return_arr;
1508 1538
 
1509
-            } else
1510
-                return false;
1539
+            } else {
1540
+                            return false;
1541
+            }
1511 1542
 
1512 1543
         }
1513 1544
 
@@ -1567,14 +1598,14 @@  discard block
 block discarded – undo
1567 1598
                         $width_per = round(((($image->width * ($max_size->h / $image->height)) / $max_size->w) * 100), 2);
1568 1599
                     } elseif ($image->width < ($max_size->h)) {
1569 1600
                         $width_per = round((($image->width / $max_size->w) * 100), 2);
1570
-                    } else
1571
-                        $width_per = 100;
1601
+                    } else {
1602
+                                            $width_per = 100;
1603
+                    }
1572 1604
                 }
1573 1605
 
1574 1606
                 if (is_admin() && !isset($_REQUEST['geodir_ajax'])){
1575 1607
                     $html = '<div class="geodir_thumbnail"><img style="max-height:' . $max_size->h . 'px;" alt="place image" src="' . $image->src . '"  /></div>';
1576
-                }
1577
-                else{
1608
+                } else{
1578 1609
                     $html = '<div class="geodir_thumbnail" style="background-image:url(\'' . $image->src . '\');"></div>';
1579 1610
                 }
1580 1611
 
@@ -1586,8 +1617,9 @@  discard block
 block discarded – undo
1586 1617
             echo $html;
1587 1618
         } elseif (!empty($html)) {
1588 1619
             return $html;
1589
-        } else
1590
-            return false;
1620
+        } else {
1621
+                    return false;
1622
+        }
1591 1623
 
1592 1624
     }
1593 1625
 }
@@ -1626,8 +1658,9 @@  discard block
 block discarded – undo
1626 1658
                 $post_obj = get_post($post_id);
1627 1659
 
1628 1660
                 $cat_ids = array('0');
1629
-                if (is_array($tt_ids))
1630
-                    $cat_ids = $tt_ids;
1661
+                if (is_array($tt_ids)) {
1662
+                                    $cat_ids = $tt_ids;
1663
+                }
1631 1664
 
1632 1665
 
1633 1666
                 if (!empty($cat_ids)) {
@@ -1684,8 +1717,9 @@  discard block
 block discarded – undo
1684 1717
                         $json .= '}';
1685 1718
 
1686 1719
 
1687
-                        if ($cat_id == geodir_get_post_meta($post_id, 'default_category', true))
1688
-                            $post_marker_json = $json;
1720
+                        if ($cat_id == geodir_get_post_meta($post_id, 'default_category', true)) {
1721
+                                                    $post_marker_json = $json;
1722
+                        }
1689 1723
 
1690 1724
 
1691 1725
                         if ($wpdb->get_var($wpdb->prepare("SELECT post_id from " . GEODIR_ICON_TABLE . " WHERE post_id = %d AND cat_id = %d", array($post_id, $cat_id)))) {
@@ -1716,10 +1750,13 @@  discard block
 block discarded – undo
1716 1750
                 if (!empty($post_term) && is_array($post_term)) {
1717 1751
                     $categories = implode(',', $post_term);
1718 1752
 
1719
-                    if ($categories != '' && $categories != 0) $categories = ',' . $categories . ',';
1753
+                    if ($categories != '' && $categories != 0) {
1754
+                        $categories = ',' . $categories . ',';
1755
+                    }
1720 1756
 
1721
-                    if (empty($post_marker_json))
1722
-                        $post_marker_json = isset($json) ? $json : '';
1757
+                    if (empty($post_marker_json)) {
1758
+                                            $post_marker_json = isset($json) ? $json : '';
1759
+                    }
1723 1760
 
1724 1761
                     if ($wpdb->get_var($wpdb->prepare("SELECT post_id from " . $table . " where post_id = %d", array($post_id)))) {
1725 1762
 
@@ -1758,8 +1795,9 @@  discard block
 block discarded – undo
1758 1795
 
1759 1796
                                 }
1760 1797
 
1761
-                                if ($default_category == '')
1762
-                                    $default_category = $categories[0];
1798
+                                if ($default_category == '') {
1799
+                                                                    $default_category = $categories[0];
1800
+                                }
1763 1801
 
1764 1802
                                 geodir_set_postcat_structure($post_id, $taxonomy, $default_category, '');
1765 1803
 
@@ -1903,7 +1941,7 @@  discard block
 block discarded – undo
1903 1941
                                     } ?>"><img alt="bubble image" style="max-height:50px;"
1904 1942
                                                src="<?php echo $post_images[0]; ?>"/></a></div>
1905 1943
                             <?php
1906
-                            }else{
1944
+                            } else{
1907 1945
                                 echo '<div class="geodir-bubble_image"></div>';
1908 1946
                             }
1909 1947
                         } else {
@@ -1911,7 +1949,7 @@  discard block
 block discarded – undo
1911 1949
                                 ?>
1912 1950
                                 <div class="geodir-bubble_image"><a href="<?php echo $plink; ?>"><?php echo $image; ?></a></div>
1913 1951
                             <?php
1914
-                            }else{
1952
+                            } else{
1915 1953
                                 echo '<div class="geodir-bubble_image"></div>';
1916 1954
                             }
1917 1955
                         }
@@ -2002,10 +2040,11 @@  discard block
 block discarded – undo
2002 2040
      */
2003 2041
     function geodir_new_post_default_status()
2004 2042
     {
2005
-        if (get_option('geodir_new_post_default_status'))
2006
-            return get_option('geodir_new_post_default_status');
2007
-        else
2008
-            return 'publish';
2043
+        if (get_option('geodir_new_post_default_status')) {
2044
+                    return get_option('geodir_new_post_default_status');
2045
+        } else {
2046
+                    return 'publish';
2047
+        }
2009 2048
 
2010 2049
     }
2011 2050
 }
@@ -2156,8 +2195,9 @@  discard block
 block discarded – undo
2156 2195
 
2157 2196
         $all_postypes = geodir_get_posttypes();
2158 2197
 
2159
-        if (!in_array($post_type, $all_postypes))
2160
-            return false;
2198
+        if (!in_array($post_type, $all_postypes)) {
2199
+                    return false;
2200
+        }
2161 2201
 
2162 2202
         $table = $plugin_prefix . $post_type . '_detail';
2163 2203
 
@@ -2426,8 +2466,9 @@  discard block
 block discarded – undo
2426 2466
         $unfavourite_icon = apply_filters('geodir_unfavourite_icon', 'fa fa-heart');
2427 2467
 
2428 2468
         $user_meta_data = '';
2429
-        if (isset($current_user->data->ID))
2430
-            $user_meta_data = get_user_meta($current_user->data->ID, 'gd_user_favourite_post', true);
2469
+        if (isset($current_user->data->ID)) {
2470
+                    $user_meta_data = get_user_meta($current_user->data->ID, 'gd_user_favourite_post', true);
2471
+        }
2431 2472
 
2432 2473
         if (!empty($user_meta_data) && in_array($post_id, $user_meta_data)) {
2433 2474
             ?><span class="geodir-addtofav favorite_property_<?php echo $post_id;?>"  ><a
@@ -2440,8 +2481,9 @@  discard block
 block discarded – undo
2440 2481
 
2441 2482
             if (!isset($current_user->data->ID) || $current_user->data->ID == '') {
2442 2483
                 $script_text = 'javascript:window.location.href=\'' . geodir_login_url() . '\'';
2443
-            } else
2444
-                $script_text = 'javascript:addToFavourite(' . $post_id . ',\'add\')';
2484
+            } else {
2485
+                            $script_text = 'javascript:addToFavourite(' . $post_id . ',\'add\')';
2486
+            }
2445 2487
 
2446 2488
             ?><span class="geodir-addtofav favorite_property_<?php echo $post_id;?>"><a class="geodir-addtofav-icon"
2447 2489
                                                                                         href="javascript:void(0);"
@@ -2504,14 +2546,16 @@  discard block
 block discarded – undo
2504 2546
 							WHERE pd.post_status='publish' AND FIND_IN_SET('" . $term->term_id . "'," . $term->taxonomy . ") " . $where;
2505 2547
 
2506 2548
             $cat_post_count = $wpdb->get_var($count_query);
2507
-            if (empty($cat_post_count) || is_wp_error($cat_post_count))
2508
-                $cat_post_count = 0;
2549
+            if (empty($cat_post_count) || is_wp_error($cat_post_count)) {
2550
+                            $cat_post_count = 0;
2551
+            }
2509 2552
 
2510 2553
             return $cat_post_count;
2511 2554
 
2512
-        } else
2513
-
2514
-            return $term->count;
2555
+        } else {
2556
+        
2557
+            return $term->count;
2558
+        }
2515 2559
     }
2516 2560
     return false;
2517 2561
 
@@ -2558,13 +2602,15 @@  discard block
 block discarded – undo
2558 2602
 		return $length;
2559 2603
 	}
2560 2604
 	
2561
-    if (isset($wp_query->query_vars['is_geodir_loop']) && $wp_query->query_vars['is_geodir_loop'] && get_option('geodir_desc_word_limit'))
2562
-        $length = get_option('geodir_desc_word_limit');
2563
-    elseif (get_query_var('excerpt_length'))
2564
-        $length = get_query_var('excerpt_length');
2605
+    if (isset($wp_query->query_vars['is_geodir_loop']) && $wp_query->query_vars['is_geodir_loop'] && get_option('geodir_desc_word_limit')) {
2606
+            $length = get_option('geodir_desc_word_limit');
2607
+    } elseif (get_query_var('excerpt_length')) {
2608
+            $length = get_query_var('excerpt_length');
2609
+    }
2565 2610
 
2566
-    if (geodir_is_page('author') && get_option('geodir_author_desc_word_limit'))
2567
-        $length = get_option('geodir_author_desc_word_limit');
2611
+    if (geodir_is_page('author') && get_option('geodir_author_desc_word_limit')) {
2612
+            $length = get_option('geodir_author_desc_word_limit');
2613
+    }
2568 2614
 
2569 2615
     return $length;
2570 2616
 }
@@ -2697,10 +2743,11 @@  discard block
 block discarded – undo
2697 2743
 function geodir_lisiting_belong_to_user($listing_id, $user_id)
2698 2744
 {
2699 2745
     $listing_author_id = geodir_get_listing_author($listing_id);
2700
-    if ($listing_author_id == $user_id)
2701
-        return true;
2702
-    else
2703
-        return false;
2746
+    if ($listing_author_id == $user_id) {
2747
+            return true;
2748
+    } else {
2749
+            return false;
2750
+    }
2704 2751
 
2705 2752
 }
2706 2753
 
@@ -2749,10 +2796,11 @@  discard block
 block discarded – undo
2749 2796
     $pattern = '/-\d+x\d+\./';
2750 2797
     preg_match($pattern, $file, $matches, PREG_OFFSET_CAPTURE);
2751 2798
 
2752
-    if (empty($matches))
2753
-        return '';
2754
-    else
2755
-        return $file;
2799
+    if (empty($matches)) {
2800
+            return '';
2801
+    } else {
2802
+            return $file;
2803
+    }
2756 2804
 
2757 2805
 }
2758 2806
 
@@ -2837,8 +2885,9 @@  discard block
 block discarded – undo
2837 2885
     } else {
2838 2886
         //set_post_thumbnail($post_id,-1);
2839 2887
 
2840
-        if (has_post_thumbnail($post_id) && $post_thumbnail_id != '' && (!isset($_REQUEST['action']) || $_REQUEST['action'] != 'delete'))
2841
-            wp_delete_attachment($post_thumbnail_id);
2888
+        if (has_post_thumbnail($post_id) && $post_thumbnail_id != '' && (!isset($_REQUEST['action']) || $_REQUEST['action'] != 'delete')) {
2889
+                    wp_delete_attachment($post_thumbnail_id);
2890
+        }
2842 2891
 
2843 2892
     }
2844 2893
 }
@@ -2923,8 +2972,9 @@  discard block
 block discarded – undo
2923 2972
 
2924 2973
     global $wpdb;
2925 2974
 
2926
-    if ($listing_type == '')
2927
-        $listing_type = 'gd_place';
2975
+    if ($listing_type == '') {
2976
+            $listing_type = 'gd_place';
2977
+    }
2928 2978
 
2929 2979
     $fields_info = array();
2930 2980
 
@@ -2947,8 +2997,9 @@  discard block
 block discarded – undo
2947 2997
 
2948 2998
                 $fields_info[$prefix . 'address'] = $data->field_type;
2949 2999
 
2950
-                if (isset($extra_fields['show_zip']) && $extra_fields['show_zip'])
2951
-                    $fields_info[$prefix . 'zip'] = $data->field_type;
3000
+                if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) {
3001
+                                    $fields_info[$prefix . 'zip'] = $data->field_type;
3002
+                }
2952 3003
 
2953 3004
             } else {
2954 3005
 
Please login to merge, or discard this patch.
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -721,7 +721,7 @@  discard block
 block discarded – undo
721 721
      * @param int $post_id The post ID.
722 722
      * @param string $postmeta Detail table column name.
723 723
      * @param string $meta_value Detail table column value.
724
-     * @return void|bool
724
+     * @return null|false
725 725
      */
726 726
     function geodir_save_post_meta($post_id, $postmeta = '', $meta_value = '')
727 727
     {
@@ -775,7 +775,7 @@  discard block
 block discarded – undo
775 775
      * @param string $postmeta Detail table column name.
776 776
      * @todo check if this is depreciated
777 777
      * @todo Fix unknown variable mval
778
-     * @return bool
778
+     * @return boolean|null
779 779
      */
780 780
     function geodir_delete_post_meta($post_id, $postmeta)
781 781
     {
@@ -2124,7 +2124,7 @@  discard block
 block discarded – undo
2124 2124
      * @global string $plugin_prefix Geodirectory plugin table prefix.
2125 2125
      * @param int $deleted_postid The post ID.
2126 2126
      * @param bool $force Optional. Do you want to force delete it? Default: false.
2127
-     * @return bool|void
2127
+     * @return null|false
2128 2128
      */
2129 2129
     function geodir_delete_listing_info($deleted_postid, $force = false)
2130 2130
     {
@@ -2693,7 +2693,7 @@  discard block
 block discarded – undo
2693 2693
  * @since 1.0.0
2694 2694
  * @package GeoDirectory
2695 2695
  * @global object $current_user Current user object.
2696
- * @param int|string $listing_id The post ID.
2696
+ * @param integer $listing_id The post ID.
2697 2697
  * @param bool $exclude_admin Optional. Do you want to exclude admin from the check?. Default true.
2698 2698
  * @return bool
2699 2699
  */
Please login to merge, or discard this patch.
Spacing   +53 added lines, -53 removed lines patch added patch discarded remove patch
@@ -26,11 +26,11 @@  discard block
 block discarded – undo
26 26
 
27 27
     if (!isset($default_cat) || empty($default_cat)) {
28 28
         $default_cat = isset($post_cat_array[0]) ? $post_cat_array[0] : '';
29
-    }else{
30
-        if(!is_int($default_cat)){
29
+    } else {
30
+        if (!is_int($default_cat)) {
31 31
             $category = get_term_by('name', $default_cat, $taxonomy);
32
-            if(isset($category->term_id)){
33
-                $default_cat =  $category->term_id;
32
+            if (isset($category->term_id)) {
33
+                $default_cat = $category->term_id;
34 34
             }
35 35
         }
36 36
 
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
         $send_post_submit_mail = false;
228 228
 
229 229
         // unhook this function so it doesn't loop infinitely
230
-        remove_action('save_post', 'geodir_post_information_save',10,2);
230
+        remove_action('save_post', 'geodir_post_information_save', 10, 2);
231 231
 
232 232
         if (isset($request_info['pid']) && $request_info['pid'] != '') {
233 233
             $post['ID'] = $request_info['pid'];
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
         }
252 252
 
253 253
         // re-hook this function
254
-        add_action('save_post', 'geodir_post_information_save',10,2);
254
+        add_action('save_post', 'geodir_post_information_save', 10, 2);
255 255
 
256 256
         $post_tags = '';
257 257
         if (!isset($request_info['post_tags'])) {
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
         $payment_info = array();
276 276
         $package_info = array();
277 277
 
278
-        $package_info = (array)geodir_post_package_info($package_info, $post);
278
+        $package_info = (array) geodir_post_package_info($package_info, $post);
279 279
 
280 280
         $post_package_id = geodir_get_post_meta($last_post_id, 'package_id');
281 281
 
@@ -474,7 +474,7 @@  discard block
 block discarded – undo
474 474
                 $tmpimgArr = trim($request_info['post_images'], ",");
475 475
                 $tmpimgArr = explode(",", $tmpimgArr);
476 476
                 geodir_save_post_images($last_post_id, $tmpimgArr, $dummy);
477
-            } else{
477
+            } else {
478 478
                 geodir_save_post_images($last_post_id, $request_info['post_images'], $dummy);
479 479
             }
480 480
 
@@ -658,7 +658,7 @@  discard block
 block discarded – undo
658 658
 
659 659
             $post_meta_set_query = trim($post_meta_set_query, ", ");
660 660
 
661
-            $post_meta_set_query = str_replace('%', '%%', $post_meta_set_query);// escape %
661
+            $post_meta_set_query = str_replace('%', '%%', $post_meta_set_query); // escape %
662 662
 
663 663
             /**
664 664
              * Called before saving the listing info.
@@ -928,7 +928,7 @@  discard block
 block discarded – undo
928 928
                 $file_path = '';
929 929
                 /* --------- start ------- */
930 930
 
931
-                $split_img_path = explode(str_replace(array('http://','https://'),'',$uploads['baseurl']), str_replace(array('http://','https://'),'',$post_image[$m]));
931
+                $split_img_path = explode(str_replace(array('http://', 'https://'), '', $uploads['baseurl']), str_replace(array('http://', 'https://'), '', $post_image[$m]));
932 932
 
933 933
                 $split_img_file_path = isset($split_img_path[1]) ? $split_img_path[1] : '';
934 934
 
@@ -985,20 +985,20 @@  discard block
 block discarded – undo
985 985
                         }
986 986
 
987 987
                         $external_img = false;
988
-                        if (strpos(str_replace(array('http://','https://'),'',$curr_img_url), str_replace(array('http://','https://'),'',$uploads['baseurl'])) !== false) {
988
+                        if (strpos(str_replace(array('http://', 'https://'), '', $curr_img_url), str_replace(array('http://', 'https://'), '', $uploads['baseurl'])) !== false) {
989 989
                         } else {
990 990
                             $external_img = true;
991 991
                         }
992 992
 
993 993
                         if ($dummy || $external_img) {
994 994
                             $uploaded_file = array();
995
-                            $uploaded = (array)fetch_remote_file($curr_img_url);
995
+                            $uploaded = (array) fetch_remote_file($curr_img_url);
996 996
 
997 997
                             if (isset($uploaded['error']) && empty($uploaded['error'])) {
998 998
                                 $new_name = basename($uploaded['file']);
999 999
                                 $uploaded_file = $uploaded;
1000
-                            }else{
1001
-                                print_r($uploaded);exit;
1000
+                            } else {
1001
+                                print_r($uploaded); exit;
1002 1002
                             }
1003 1003
                             $external_img = false;
1004 1004
                         } else {
@@ -1031,7 +1031,7 @@  discard block
 block discarded – undo
1031 1031
                                 $file_path = $sub_dir . '/' . $new_name;
1032 1032
                             }
1033 1033
 
1034
-                            $postcurr_images[] = str_replace(array('http://','https://'),'',$uploads['baseurl'] . $file_path);
1034
+                            $postcurr_images[] = str_replace(array('http://', 'https://'), '', $uploads['baseurl'] . $file_path);
1035 1035
 
1036 1036
                             if ($menu_order == 1) {
1037 1037
 
@@ -1069,7 +1069,7 @@  discard block
 block discarded – undo
1069 1069
                 } else {
1070 1070
                     $valid_file_ids[] = $find_image;
1071 1071
 
1072
-                    $postcurr_images[] = str_replace(array('http://','https://'),'',$post_image[$m]);
1072
+                    $postcurr_images[] = str_replace(array('http://', 'https://'), '', $post_image[$m]);
1073 1073
 
1074 1074
                     $wpdb->query(
1075 1075
                         $wpdb->prepare(
@@ -1103,9 +1103,9 @@  discard block
 block discarded – undo
1103 1103
 
1104 1104
                 foreach ($post_images as $img) {
1105 1105
 
1106
-                    if (!in_array(str_replace(array('http://','https://'),'',$img->src), $postcurr_images)) {
1106
+                    if (!in_array(str_replace(array('http://', 'https://'), '', $img->src), $postcurr_images)) {
1107 1107
 
1108
-                        $invalid_files[] = (object)array('src' => $img->src);
1108
+                        $invalid_files[] = (object) array('src' => $img->src);
1109 1109
 
1110 1110
                     }
1111 1111
 
@@ -1113,7 +1113,7 @@  discard block
 block discarded – undo
1113 1113
 
1114 1114
             }
1115 1115
 
1116
-            $invalid_files = (object)$invalid_files;
1116
+            $invalid_files = (object) $invalid_files;
1117 1117
         }
1118 1118
 
1119 1119
         $remove_files[] = $post_id;
@@ -1247,7 +1247,7 @@  discard block
 block discarded – undo
1247 1247
         }
1248 1248
 
1249 1249
         if (!in_array($post_type, geodir_get_posttypes())) {
1250
-            return false;// if not a GD CPT return;
1250
+            return false; // if not a GD CPT return;
1251 1251
         }
1252 1252
 
1253 1253
         $table = $plugin_prefix . $post_type . '_detail';
@@ -1284,7 +1284,7 @@  discard block
 block discarded – undo
1284 1284
              * @param string $uploads_url The server upload directory url.
1285 1285
              * @param string $uploads_baseurl The uploads dir base url.
1286 1286
              */
1287
-            $img_arr['src'] = apply_filters('geodir_get_featured_image_src',$uploads_url . '/' . $file_name,$file_name,$uploads_url,$uploads_baseurl);
1287
+            $img_arr['src'] = apply_filters('geodir_get_featured_image_src', $uploads_url . '/' . $file_name, $file_name, $uploads_url, $uploads_baseurl);
1288 1288
             $img_arr['path'] = $uploads_path . '/' . $file_name;
1289 1289
             $imagesize = getimagesize($img_arr['path']);
1290 1290
             $width = !empty($imagesize) && isset($imagesize[0]) ? $imagesize[0] : 0;
@@ -1337,7 +1337,7 @@  discard block
 block discarded – undo
1337 1337
         }
1338 1338
 
1339 1339
         if (!empty($img_arr))
1340
-            return (object)$img_arr;//return (object)array( 'src' => $file_url, 'path' => $file_path );
1340
+            return (object) $img_arr; //return (object)array( 'src' => $file_url, 'path' => $file_path );
1341 1341
         else
1342 1342
             return false;
1343 1343
     }
@@ -1436,7 +1436,7 @@  discard block
 block discarded – undo
1436 1436
                 * @param string $uploads_url The server upload directory url.
1437 1437
                 * @param string $uploads_baseurl The uploads dir base url.
1438 1438
                 */
1439
-                $img_arr['src'] = apply_filters('geodir_get_images_src',$uploads_url . '/' . $file_name,$file_name,$uploads_url,$uploads_baseurl);
1439
+                $img_arr['src'] = apply_filters('geodir_get_images_src', $uploads_url . '/' . $file_name, $file_name, $uploads_url, $uploads_baseurl);
1440 1440
                 $img_arr['path'] = $uploads_path . '/' . $file_name;
1441 1441
                 $imagesize = getimagesize($img_arr['path']);
1442 1442
                 $width = !empty($imagesize) && isset($imagesize[0]) ? $imagesize[0] : 0;
@@ -1450,11 +1450,11 @@  discard block
 block discarded – undo
1450 1450
                 $img_arr['content'] = $attechment->content; // add the description to the array
1451 1451
                 $img_arr['is_approved'] = isset($attechment->is_approved) ? $attechment->is_approved : ''; // used for user image moderation. For backward compatibility Default value is 1.
1452 1452
 
1453
-                $return_arr[] = (object)$img_arr;
1453
+                $return_arr[] = (object) $img_arr;
1454 1454
 
1455 1455
                 $counter++;
1456 1456
             }
1457
-            return (object)$return_arr;
1457
+            return (object) $return_arr;
1458 1458
         } else if ($no_images) {
1459 1459
             $default_img = '';
1460 1460
             $default_cat = geodir_get_post_meta($post_id, 'default_category', true);
@@ -1489,7 +1489,7 @@  discard block
 block discarded – undo
1489 1489
                 $img_arr['title'] = $file_name; // add the title to the array
1490 1490
                 $img_arr['content'] = $file_name; // add the description to the array
1491 1491
 
1492
-                $return_arr[] = (object)$img_arr;
1492
+                $return_arr[] = (object) $img_arr;
1493 1493
 
1494 1494
                 return $return_arr;
1495 1495
             } else
@@ -1516,8 +1516,8 @@  discard block
 block discarded – undo
1516 1516
 
1517 1517
         $html = '';
1518 1518
         if (!empty($request)) {
1519
-            if (!is_object($request)){
1520
-                $request = (object)$request;
1519
+            if (!is_object($request)) {
1520
+                $request = (object) $request;
1521 1521
             }
1522 1522
 
1523 1523
             if (isset($request->src) && !isset($request->path)) {
@@ -1528,10 +1528,10 @@  discard block
 block discarded – undo
1528 1528
              * getimagesize() works faster from path than url so we try and get path if we can.
1529 1529
              */
1530 1530
             $upload_dir = wp_upload_dir();
1531
-            $img_no_http = str_replace(array("http://","https://"),"",$request->path);
1532
-            $upload_no_http = str_replace(array("http://","https://"),"",$upload_dir['baseurl']);
1533
-            if (strpos($img_no_http ,$upload_no_http ) !== false) {
1534
-                $request->path = str_replace( $img_no_http,$upload_dir['basedir'],$request->path);
1531
+            $img_no_http = str_replace(array("http://", "https://"), "", $request->path);
1532
+            $upload_no_http = str_replace(array("http://", "https://"), "", $upload_dir['baseurl']);
1533
+            if (strpos($img_no_http, $upload_no_http) !== false) {
1534
+                $request->path = str_replace($img_no_http, $upload_dir['basedir'], $request->path);
1535 1535
             }
1536 1536
 
1537 1537
             $imagesize = getimagesize($request->path);
@@ -1541,7 +1541,7 @@  discard block
 block discarded – undo
1541 1541
             $image->width = $width;
1542 1542
             $image->height = $height;
1543 1543
 
1544
-            $max_size = (object)geodir_get_imagesize($size);
1544
+            $max_size = (object) geodir_get_imagesize($size);
1545 1545
 
1546 1546
             if (!is_wp_error($max_size)) {
1547 1547
 
@@ -1555,10 +1555,10 @@  discard block
 block discarded – undo
1555 1555
                         $width_per = 100;
1556 1556
                 }
1557 1557
 
1558
-                if (is_admin() && !isset($_REQUEST['geodir_ajax'])){
1558
+                if (is_admin() && !isset($_REQUEST['geodir_ajax'])) {
1559 1559
                     $html = '<div class="geodir_thumbnail"><img style="max-height:' . $max_size->h . 'px;" alt="place image" src="' . $image->src . '"  /></div>';
1560 1560
                 }
1561
-                else{
1561
+                else {
1562 1562
                     $html = '<div class="geodir_thumbnail" style="background-image:url(\'' . $image->src . '\');"></div>';
1563 1563
                 }
1564 1564
 
@@ -1887,7 +1887,7 @@  discard block
 block discarded – undo
1887 1887
                                     } ?>"><img alt="bubble image" style="max-height:50px;"
1888 1888
                                                src="<?php echo $post_images[0]; ?>"/></a></div>
1889 1889
                             <?php
1890
-                            }else{
1890
+                            } else {
1891 1891
                                 echo '<div class="geodir-bubble_image"></div>';
1892 1892
                             }
1893 1893
                         } else {
@@ -1895,7 +1895,7 @@  discard block
 block discarded – undo
1895 1895
                                 ?>
1896 1896
                                 <div class="geodir-bubble_image"><a href="<?php echo $plink; ?>"><?php echo $image; ?></a></div>
1897 1897
                             <?php
1898
-                            }else{
1898
+                            } else {
1899 1899
                                 echo '<div class="geodir-bubble_image"></div>';
1900 1900
                             }
1901 1901
                         }
@@ -1929,7 +1929,7 @@  discard block
 block discarded – undo
1929 1929
                              * @param object $postinfo_obj The posts info as an object.
1930 1930
                              * @param bool|string $post_preview True if currently in post preview page. Empty string if not.                           *
1931 1931
                              */
1932
-                            do_action('geodir_infowindow_meta_after',$postinfo_obj,$post_preview );
1932
+                            do_action('geodir_infowindow_meta_after', $postinfo_obj, $post_preview);
1933 1933
                             ?>
1934 1934
                         </div>
1935 1935
                         <?php
@@ -1941,10 +1941,10 @@  discard block
 block discarded – undo
1941 1941
                             <div class="geodir-bubble-meta-fade"></div>
1942 1942
 
1943 1943
                             <div class="geodir-bubble-meta-bottom">
1944
-                                <span class="geodir-bubble-rating"><?php echo $rating_star;?></span>
1944
+                                <span class="geodir-bubble-rating"><?php echo $rating_star; ?></span>
1945 1945
 
1946 1946
                                 <span
1947
-                                    class="geodir-bubble-fav"><?php echo geodir_favourite_html($post_author, $ID);?></span>
1947
+                                    class="geodir-bubble-fav"><?php echo geodir_favourite_html($post_author, $ID); ?></span>
1948 1948
                   <span class="geodir-bubble-reviews"><a href="<?php echo get_comments_link($ID); ?>"
1949 1949
                                                          class="geodir-pcomments"><i class="fa fa-comments"></i>
1950 1950
                           <?php echo get_comments_number($ID); ?>
@@ -2239,7 +2239,7 @@  discard block
 block discarded – undo
2239 2239
          */
2240 2240
         do_action('geodir_before_add_from_favorite', $post_id);
2241 2241
 
2242
-        echo '<a href="javascript:void(0);" title="' . $remove_favourite_text . '" class="geodir-addtofav geodir-removetofav-icon" onclick="javascript:addToFavourite(\'' . $post_id . '\',\'remove\');"><i class="'. $favourite_icon .'"></i> ' . $unfavourite_text . '</a>';
2242
+        echo '<a href="javascript:void(0);" title="' . $remove_favourite_text . '" class="geodir-addtofav geodir-removetofav-icon" onclick="javascript:addToFavourite(\'' . $post_id . '\',\'remove\');"><i class="' . $favourite_icon . '"></i> ' . $unfavourite_text . '</a>';
2243 2243
 
2244 2244
         /**
2245 2245
          * Called after adding the post from favourites.
@@ -2318,7 +2318,7 @@  discard block
 block discarded – undo
2318 2318
          */
2319 2319
         do_action('geodir_before_remove_from_favorite', $post_id);
2320 2320
 
2321
-        echo '<a href="javascript:void(0);"  title="' . $add_favourite_text . '" class="geodir-addtofav geodir-addtofav-icon" onclick="javascript:addToFavourite(\'' . $post_id . '\',\'add\');"><i class="'. $favourite_icon .'"></i> ' . $favourite_text . '</a>';
2321
+        echo '<a href="javascript:void(0);"  title="' . $add_favourite_text . '" class="geodir-addtofav geodir-addtofav-icon" onclick="javascript:addToFavourite(\'' . $post_id . '\',\'add\');"><i class="' . $favourite_icon . '"></i> ' . $favourite_text . '</a>';
2322 2322
 
2323 2323
         /**
2324 2324
          * Called after removing the post from favourites.
@@ -2413,10 +2413,10 @@  discard block
 block discarded – undo
2413 2413
             $user_meta_data = get_user_meta($current_user->data->ID, 'gd_user_favourite_post', true);
2414 2414
 
2415 2415
         if (!empty($user_meta_data) && in_array($post_id, $user_meta_data)) {
2416
-            ?><span class="geodir-addtofav favorite_property_<?php echo $post_id;?>"  ><a
2416
+            ?><span class="geodir-addtofav favorite_property_<?php echo $post_id; ?>"  ><a
2417 2417
                 class="geodir-removetofav-icon" href="javascript:void(0);"
2418
-                onclick="javascript:addToFavourite(<?php echo $post_id;?>,'remove');"
2419
-                title="<?php echo $remove_favourite_text;?>"><i class="<?php echo $unfavourite_icon; ?>"></i> <?php echo $unfavourite_text;?>
2418
+                onclick="javascript:addToFavourite(<?php echo $post_id; ?>,'remove');"
2419
+                title="<?php echo $remove_favourite_text; ?>"><i class="<?php echo $unfavourite_icon; ?>"></i> <?php echo $unfavourite_text; ?>
2420 2420
             </a>   </span><?php
2421 2421
 
2422 2422
         } else {
@@ -2426,11 +2426,11 @@  discard block
 block discarded – undo
2426 2426
             } else
2427 2427
                 $script_text = 'javascript:addToFavourite(' . $post_id . ',\'add\')';
2428 2428
 
2429
-            ?><span class="geodir-addtofav favorite_property_<?php echo $post_id;?>"><a class="geodir-addtofav-icon"
2429
+            ?><span class="geodir-addtofav favorite_property_<?php echo $post_id; ?>"><a class="geodir-addtofav-icon"
2430 2430
                                                                                         href="javascript:void(0);"
2431
-                                                                                        onclick="<?php echo $script_text;?>"
2432
-                                                                                        title="<?php echo $add_favourite_text;?>"><i
2433
-                    class="<?php echo $favourite_icon; ?>"></i> <?php echo $favourite_text;?></a></span>
2431
+                                                                                        onclick="<?php echo $script_text; ?>"
2432
+                                                                                        title="<?php echo $add_favourite_text; ?>"><i
2433
+                    class="<?php echo $favourite_icon; ?>"></i> <?php echo $favourite_text; ?></a></span>
2434 2434
         <?php }
2435 2435
     }
2436 2436
 }
@@ -3029,15 +3029,15 @@  discard block
 block discarded – undo
3029 3029
  * @since 1.4.9
3030 3030
  * @package GeoDirectory
3031 3031
  */
3032
-function geodir_fb_like_thumbnail(){
3032
+function geodir_fb_like_thumbnail() {
3033 3033
 
3034 3034
     // return if not a single post
3035
-    if(!is_single()){return;}
3035
+    if (!is_single()) {return; }
3036 3036
 
3037 3037
     global $post;
3038
-    if(isset($post->featured_image) && $post->featured_image){
3038
+    if (isset($post->featured_image) && $post->featured_image) {
3039 3039
         $upload_dir = wp_upload_dir();
3040
-        $thumb = $upload_dir['baseurl'].$post->featured_image;
3040
+        $thumb = $upload_dir['baseurl'] . $post->featured_image;
3041 3041
         echo "\n\n<!-- GD Facebook Like Thumbnail -->\n<link rel=\"image_src\" href=\"$thumb\" />\n<!-- End GD Facebook Like Thumbnail -->\n\n";
3042 3042
 
3043 3043
     }
Please login to merge, or discard this patch.
geodirectory-functions/reviews.php 2 patches
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,15 +1,15 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * The template for displaying Comments.
4
- *
5
- * The area of the page that contains both current comments
6
- * and the comment form.
7
- *
8
- * @since 1.0.0
9
- * @since 1.5.4 Modified to fix review sorting.
10
- *
11
- * @package GeoDirectory
12
- */
3
+     * The template for displaying Comments.
4
+     *
5
+     * The area of the page that contains both current comments
6
+     * and the comment form.
7
+     *
8
+     * @since 1.0.0
9
+     * @since 1.5.4 Modified to fix review sorting.
10
+     *
11
+     * @package GeoDirectory
12
+     */
13 13
 
14 14
 /*
15 15
  * If the current post is protected by a password and
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,8 +16,9 @@
 block discarded – undo
16 16
  * the visitor has not yet entered the password we will
17 17
  * return early without loading the comments.
18 18
  */
19
-if (post_password_required())
20
-    return;
19
+if (post_password_required()) {
20
+    return;
21
+}
21 22
 ?>
22 23
 
23 24
 <div id="comments" class="comments-area">
Please login to merge, or discard this patch.
geodirectory-functions/wp-session/wp-session.php 3 patches
Indentation   +63 added lines, -63 removed lines patch added patch discarded remove patch
@@ -1,14 +1,14 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * WordPress session managment.
4
- *
5
- * Standardizes WordPress session data and uses either database transients or in-memory caching
6
- * for storing user session information.
7
- *
8
- * @package WordPress
9
- * @subpackage Session
10
- * @since   3.7.0
11
- */
3
+     * WordPress session managment.
4
+     *
5
+     * Standardizes WordPress session data and uses either database transients or in-memory caching
6
+     * for storing user session information.
7
+     *
8
+     * @package WordPress
9
+     * @subpackage Session
10
+     * @since   3.7.0
11
+     */
12 12
 
13 13
 // Exit if accessed directly
14 14
 if ( ! defined( 'ABSPATH' ) ) exit;
@@ -19,16 +19,16 @@  discard block
 block discarded – undo
19 19
  * @return int
20 20
  */
21 21
 function wp_session_cache_expire() {
22
-	$wp_session = WP_Session::get_instance();
22
+    $wp_session = WP_Session::get_instance();
23 23
 
24
-	return $wp_session->cache_expiration();
24
+    return $wp_session->cache_expiration();
25 25
 }
26 26
 
27 27
 /**
28 28
  * Alias of wp_session_write_close()
29 29
  */
30 30
 function wp_session_commit() {
31
-	wp_session_write_close();
31
+    wp_session_write_close();
32 32
 }
33 33
 
34 34
 /**
@@ -37,9 +37,9 @@  discard block
 block discarded – undo
37 37
  * @param string $data
38 38
  */
39 39
 function wp_session_decode( $data ) {
40
-	$wp_session = WP_Session::get_instance();
40
+    $wp_session = WP_Session::get_instance();
41 41
 
42
-	return $wp_session->json_in( $data );
42
+    return $wp_session->json_in( $data );
43 43
 }
44 44
 
45 45
 /**
@@ -48,9 +48,9 @@  discard block
 block discarded – undo
48 48
  * @return string
49 49
  */
50 50
 function wp_session_encode() {
51
-	$wp_session = WP_Session::get_instance();
51
+    $wp_session = WP_Session::get_instance();
52 52
 
53
-	return $wp_session->json_out();
53
+    return $wp_session->json_out();
54 54
 }
55 55
 
56 56
 /**
@@ -61,11 +61,11 @@  discard block
 block discarded – undo
61 61
  * @return bool
62 62
  */
63 63
 function wp_session_regenerate_id( $delete_old_session = false ) {
64
-	$wp_session = WP_Session::get_instance();
64
+    $wp_session = WP_Session::get_instance();
65 65
 
66
-	$wp_session->regenerate_id( $delete_old_session );
66
+    $wp_session->regenerate_id( $delete_old_session );
67 67
 
68
-	return true;
68
+    return true;
69 69
 }
70 70
 
71 71
 /**
@@ -76,10 +76,10 @@  discard block
 block discarded – undo
76 76
  * @return bool
77 77
  */
78 78
 function wp_session_start() {
79
-	$wp_session = WP_Session::get_instance();
80
-	do_action( 'wp_session_start' );
79
+    $wp_session = WP_Session::get_instance();
80
+    do_action( 'wp_session_start' );
81 81
 
82
-	return $wp_session->session_started();
82
+    return $wp_session->session_started();
83 83
 }
84 84
 add_action( 'plugins_loaded', 'wp_session_start' );
85 85
 
@@ -89,32 +89,32 @@  discard block
 block discarded – undo
89 89
  * @return int
90 90
  */
91 91
 function wp_session_status() {
92
-	$wp_session = WP_Session::get_instance();
92
+    $wp_session = WP_Session::get_instance();
93 93
 
94
-	if ( $wp_session->session_started() ) {
95
-		return PHP_SESSION_ACTIVE;
96
-	}
94
+    if ( $wp_session->session_started() ) {
95
+        return PHP_SESSION_ACTIVE;
96
+    }
97 97
 
98
-	return PHP_SESSION_NONE;
98
+    return PHP_SESSION_NONE;
99 99
 }
100 100
 
101 101
 /**
102 102
  * Unset all session variables.
103 103
  */
104 104
 function wp_session_unset() {
105
-	$wp_session = WP_Session::get_instance();
105
+    $wp_session = WP_Session::get_instance();
106 106
 
107
-	$wp_session->reset();
107
+    $wp_session->reset();
108 108
 }
109 109
 
110 110
 /**
111 111
  * Write session data and end session
112 112
  */
113 113
 function wp_session_write_close() {
114
-	$wp_session = WP_Session::get_instance();
114
+    $wp_session = WP_Session::get_instance();
115 115
 
116
-	$wp_session->write_data();
117
-	do_action( 'wp_session_commit' );
116
+    $wp_session->write_data();
117
+    do_action( 'wp_session_commit' );
118 118
 }
119 119
 add_action( 'shutdown', 'wp_session_write_close' );
120 120
 
@@ -126,44 +126,44 @@  discard block
 block discarded – undo
126 126
  * of a scheduled task or cron job.
127 127
  */
128 128
 function wp_session_cleanup() {
129
-	global $wpdb;
129
+    global $wpdb;
130 130
 
131
-	if ( defined( 'WP_SETUP_CONFIG' ) ) {
132
-		return;
133
-	}
131
+    if ( defined( 'WP_SETUP_CONFIG' ) ) {
132
+        return;
133
+    }
134 134
 
135
-	if ( ! defined( 'WP_INSTALLING' ) ) {
136
-		$expiration_keys = $wpdb->get_results( "SELECT option_name, option_value FROM $wpdb->options WHERE option_name LIKE '_wp_session_expires_%'" );
135
+    if ( ! defined( 'WP_INSTALLING' ) ) {
136
+        $expiration_keys = $wpdb->get_results( "SELECT option_name, option_value FROM $wpdb->options WHERE option_name LIKE '_wp_session_expires_%'" );
137 137
 
138
-		$now = current_time( 'timestamp' );
139
-		$expired_sessions = array();
138
+        $now = current_time( 'timestamp' );
139
+        $expired_sessions = array();
140 140
 
141
-		foreach( $expiration_keys as $expiration ) {
141
+        foreach( $expiration_keys as $expiration ) {
142 142
 
143
-			// If the session has expired
144
-			if ( $now > intval( $expiration->option_value ) ) {
143
+            // If the session has expired
144
+            if ( $now > intval( $expiration->option_value ) ) {
145 145
 
146
-				// Get the session ID by parsing the option_name
147
-				$session_id = substr( $expiration->option_name, 20 );
146
+                // Get the session ID by parsing the option_name
147
+                $session_id = substr( $expiration->option_name, 20 );
148 148
 
149
-				if( (int) -1 === (int) $session_id || ! preg_match( '/^[a-f0-9]{32}$/', $session_id ) ) {
150
-					continue;
151
-				}
149
+                if( (int) -1 === (int) $session_id || ! preg_match( '/^[a-f0-9]{32}$/', $session_id ) ) {
150
+                    continue;
151
+                }
152 152
 
153
-				$expired_sessions[] = $expiration->option_name;
154
-				$expired_sessions[] = esc_sql( "_wp_session_$session_id" );
155
-			}
156
-		}
153
+                $expired_sessions[] = $expiration->option_name;
154
+                $expired_sessions[] = esc_sql( "_wp_session_$session_id" );
155
+            }
156
+        }
157 157
 
158
-		// Delete all expired sessions in a single query
159
-		if ( ! empty( $expired_sessions ) ) {
160
-			$option_names = implode( "','", $expired_sessions );
161
-			$wpdb->query( "DELETE FROM $wpdb->options WHERE option_name IN ('$option_names')"  );
162
-		}
163
-	}
158
+        // Delete all expired sessions in a single query
159
+        if ( ! empty( $expired_sessions ) ) {
160
+            $option_names = implode( "','", $expired_sessions );
161
+            $wpdb->query( "DELETE FROM $wpdb->options WHERE option_name IN ('$option_names')"  );
162
+        }
163
+    }
164 164
 
165
-	// Allow other plugins to hook in to the garbage collection process.
166
-	do_action( 'wp_session_cleanup' );
165
+    // Allow other plugins to hook in to the garbage collection process.
166
+    do_action( 'wp_session_cleanup' );
167 167
 }
168 168
 add_action( 'wp_session_garbage_collection', 'wp_session_cleanup' );
169 169
 
@@ -171,8 +171,8 @@  discard block
 block discarded – undo
171 171
  * Register the garbage collector as a twice daily event.
172 172
  */
173 173
 function wp_session_register_garbage_collection() {
174
-	if ( ! wp_next_scheduled( 'wp_session_garbage_collection' ) ) {
175
-		wp_schedule_event( current_time( 'timestamp' ), 'twicedaily', 'wp_session_garbage_collection' );
176
-	}
174
+    if ( ! wp_next_scheduled( 'wp_session_garbage_collection' ) ) {
175
+        wp_schedule_event( current_time( 'timestamp' ), 'twicedaily', 'wp_session_garbage_collection' );
176
+    }
177 177
 }
178 178
 add_action( 'wp', 'wp_session_register_garbage_collection' );
Please login to merge, or discard this patch.
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
  */
12 12
 
13 13
 // Exit if accessed directly
14
-if ( ! defined( 'ABSPATH' ) ) exit;
14
+if (!defined('ABSPATH')) exit;
15 15
 
16 16
 /**
17 17
  * Return the current cache expire setting.
@@ -36,10 +36,10 @@  discard block
 block discarded – undo
36 36
  *
37 37
  * @param string $data
38 38
  */
39
-function wp_session_decode( $data ) {
39
+function wp_session_decode($data) {
40 40
 	$wp_session = WP_Session::get_instance();
41 41
 
42
-	return $wp_session->json_in( $data );
42
+	return $wp_session->json_in($data);
43 43
 }
44 44
 
45 45
 /**
@@ -60,10 +60,10 @@  discard block
 block discarded – undo
60 60
  *
61 61
  * @return bool
62 62
  */
63
-function wp_session_regenerate_id( $delete_old_session = false ) {
63
+function wp_session_regenerate_id($delete_old_session = false) {
64 64
 	$wp_session = WP_Session::get_instance();
65 65
 
66
-	$wp_session->regenerate_id( $delete_old_session );
66
+	$wp_session->regenerate_id($delete_old_session);
67 67
 
68 68
 	return true;
69 69
 }
@@ -77,11 +77,11 @@  discard block
 block discarded – undo
77 77
  */
78 78
 function wp_session_start() {
79 79
 	$wp_session = WP_Session::get_instance();
80
-	do_action( 'wp_session_start' );
80
+	do_action('wp_session_start');
81 81
 
82 82
 	return $wp_session->session_started();
83 83
 }
84
-add_action( 'plugins_loaded', 'wp_session_start' );
84
+add_action('plugins_loaded', 'wp_session_start');
85 85
 
86 86
 /**
87 87
  * Return the current session status.
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 function wp_session_status() {
92 92
 	$wp_session = WP_Session::get_instance();
93 93
 
94
-	if ( $wp_session->session_started() ) {
94
+	if ($wp_session->session_started()) {
95 95
 		return PHP_SESSION_ACTIVE;
96 96
 	}
97 97
 
@@ -114,9 +114,9 @@  discard block
 block discarded – undo
114 114
 	$wp_session = WP_Session::get_instance();
115 115
 
116 116
 	$wp_session->write_data();
117
-	do_action( 'wp_session_commit' );
117
+	do_action('wp_session_commit');
118 118
 }
119
-add_action( 'shutdown', 'wp_session_write_close' );
119
+add_action('shutdown', 'wp_session_write_close');
120 120
 
121 121
 /**
122 122
  * Clean up expired sessions by removing data and their expiration entries from
@@ -128,51 +128,51 @@  discard block
 block discarded – undo
128 128
 function wp_session_cleanup() {
129 129
 	global $wpdb;
130 130
 
131
-	if ( defined( 'WP_SETUP_CONFIG' ) ) {
131
+	if (defined('WP_SETUP_CONFIG')) {
132 132
 		return;
133 133
 	}
134 134
 
135
-	if ( ! defined( 'WP_INSTALLING' ) ) {
136
-		$expiration_keys = $wpdb->get_results( "SELECT option_name, option_value FROM $wpdb->options WHERE option_name LIKE '_wp_session_expires_%'" );
135
+	if (!defined('WP_INSTALLING')) {
136
+		$expiration_keys = $wpdb->get_results("SELECT option_name, option_value FROM $wpdb->options WHERE option_name LIKE '_wp_session_expires_%'");
137 137
 
138
-		$now = current_time( 'timestamp' );
138
+		$now = current_time('timestamp');
139 139
 		$expired_sessions = array();
140 140
 
141
-		foreach( $expiration_keys as $expiration ) {
141
+		foreach ($expiration_keys as $expiration) {
142 142
 
143 143
 			// If the session has expired
144
-			if ( $now > intval( $expiration->option_value ) ) {
144
+			if ($now > intval($expiration->option_value)) {
145 145
 
146 146
 				// Get the session ID by parsing the option_name
147
-				$session_id = substr( $expiration->option_name, 20 );
147
+				$session_id = substr($expiration->option_name, 20);
148 148
 
149
-				if( (int) -1 === (int) $session_id || ! preg_match( '/^[a-f0-9]{32}$/', $session_id ) ) {
149
+				if ((int) -1 === (int) $session_id || !preg_match('/^[a-f0-9]{32}$/', $session_id)) {
150 150
 					continue;
151 151
 				}
152 152
 
153 153
 				$expired_sessions[] = $expiration->option_name;
154
-				$expired_sessions[] = esc_sql( "_wp_session_$session_id" );
154
+				$expired_sessions[] = esc_sql("_wp_session_$session_id");
155 155
 			}
156 156
 		}
157 157
 
158 158
 		// Delete all expired sessions in a single query
159
-		if ( ! empty( $expired_sessions ) ) {
160
-			$option_names = implode( "','", $expired_sessions );
161
-			$wpdb->query( "DELETE FROM $wpdb->options WHERE option_name IN ('$option_names')"  );
159
+		if (!empty($expired_sessions)) {
160
+			$option_names = implode("','", $expired_sessions);
161
+			$wpdb->query("DELETE FROM $wpdb->options WHERE option_name IN ('$option_names')");
162 162
 		}
163 163
 	}
164 164
 
165 165
 	// Allow other plugins to hook in to the garbage collection process.
166
-	do_action( 'wp_session_cleanup' );
166
+	do_action('wp_session_cleanup');
167 167
 }
168
-add_action( 'wp_session_garbage_collection', 'wp_session_cleanup' );
168
+add_action('wp_session_garbage_collection', 'wp_session_cleanup');
169 169
 
170 170
 /**
171 171
  * Register the garbage collector as a twice daily event.
172 172
  */
173 173
 function wp_session_register_garbage_collection() {
174
-	if ( ! wp_next_scheduled( 'wp_session_garbage_collection' ) ) {
175
-		wp_schedule_event( current_time( 'timestamp' ), 'twicedaily', 'wp_session_garbage_collection' );
174
+	if (!wp_next_scheduled('wp_session_garbage_collection')) {
175
+		wp_schedule_event(current_time('timestamp'), 'twicedaily', 'wp_session_garbage_collection');
176 176
 	}
177 177
 }
178
-add_action( 'wp', 'wp_session_register_garbage_collection' );
178
+add_action('wp', 'wp_session_register_garbage_collection');
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,9 @@
 block discarded – undo
11 11
  */
12 12
 
13 13
 // Exit if accessed directly
14
-if ( ! defined( 'ABSPATH' ) ) exit;
14
+if ( ! defined( 'ABSPATH' ) ) {
15
+    exit;
16
+}
15 17
 
16 18
 /**
17 19
  * Return the current cache expire setting.
Please login to merge, or discard this patch.
geodirectory-templates/add-listing.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Template for add listings page
4
- *
5
- * You can make most changes via hooks or see the link below for info on how to replace the template in your theme.
6
- *
7
- * @link http://docs.wpgeodirectory.com/customizing-geodirectory-templates/
8
- * @since 1.0.0
9
- * @package GeoDirectory
10
- */
3
+     * Template for add listings page
4
+     *
5
+     * You can make most changes via hooks or see the link below for info on how to replace the template in your theme.
6
+     *
7
+     * @link http://docs.wpgeodirectory.com/customizing-geodirectory-templates/
8
+     * @since 1.0.0
9
+     * @package GeoDirectory
10
+     */
11 11
  
12 12
 global $gd_session;
13 13
 
Please login to merge, or discard this patch.
geodirectory-templates/geodir-listing.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Template for the listings (category) page
4
- *
5
- * You can make most changes via hooks or see the link below for info on how to replace the template in your theme.
6
- *
7
- * @link http://docs.wpgeodirectory.com/customizing-geodirectory-templates/
8
- * @since 1.0.0
9
- * @package GeoDirectory
10
- */
3
+                         * Template for the listings (category) page
4
+                         *
5
+                         * You can make most changes via hooks or see the link below for info on how to replace the template in your theme.
6
+                         *
7
+                         * @link http://docs.wpgeodirectory.com/customizing-geodirectory-templates/
8
+                         * @since 1.0.0
9
+                         * @package GeoDirectory
10
+                         */
11 11
 
12 12
 // call header
13 13
 get_header();
Please login to merge, or discard this patch.
geodirectory-templates/listing-filter-form.php 3 patches
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -25,11 +25,11 @@  discard block
 block discarded – undo
25 25
 
26 26
 <form class="<?php
27 27
 /**
28
- * Filters the GD search form class.
29
- *
30
- * @since 1.0.0
31
- * @param string $class The class for the search form, default: 'geodir-listing-search'.
32
- */
28
+     * Filters the GD search form class.
29
+     *
30
+     * @since 1.0.0
31
+     * @param string $class The class for the search form, default: 'geodir-listing-search'.
32
+     */
33 33
 echo apply_filters('geodir_search_form_class', 'geodir-listing-search'); ?>"
34 34
       name="geodir-listing-search" action="<?php echo $search_url ?>" method="get">
35 35
     <input type="hidden" name="geodir_search" value="1"/>
@@ -92,10 +92,10 @@  discard block
 block discarded – undo
92 92
 
93 93
                 <input class="search_text" name="s"
94 94
                        value="<?php if (isset($_REQUEST['s']) && trim($_REQUEST['s']) != '') {
95
-                           echo esc_attr($_REQUEST['s']);
96
-                       } else {
97
-                           echo $default_search_for_text;
98
-                       } ?>" type="text"
95
+                            echo esc_attr($_REQUEST['s']);
96
+                        } else {
97
+                            echo $default_search_for_text;
98
+                        } ?>" type="text"
99 99
                        onblur="if (this.value == '') {this.value = '<?php echo $default_search_for_text; ?>';}"
100 100
                        onfocus="if (this.value == '<?php echo $default_search_for_text; ?>') {this.value = '';}"
101 101
                        onkeydown="javascript: if(event.keyCode == 13) geodir_click_search(this);">
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 
64 64
                 $post_types = geodir_get_posttypes('object');
65 65
 
66
-                if (!empty($post_types) && count((array)$post_types) > 1):
66
+                if (!empty($post_types) && count((array) $post_types) > 1):
67 67
                     ?>
68 68
                     <select name="stype" class="search_by_post">
69 69
                         <?php foreach ($post_types as $post_type => $info):
@@ -75,14 +75,14 @@  discard block
 block discarded – undo
75 75
                             }
76 76
                             ?>
77 77
 
78
-                            <option data-label="<?php echo get_post_type_archive_link($post_type);?>"
79
-                                    value="<?php echo $post_type;?>" <?php if (isset($_REQUEST['stype'])) {
78
+                            <option data-label="<?php echo get_post_type_archive_link($post_type); ?>"
79
+                                    value="<?php echo $post_type; ?>" <?php if (isset($_REQUEST['stype'])) {
80 80
                                 if ($post_type == $_REQUEST['stype']) {
81 81
                                     echo 'selected="selected"';
82 82
                                 }
83 83
                             } elseif ($curr_post_type == $post_type) {
84 84
                                 echo 'selected="selected"';
85
-                            }?>><?php _e(ucfirst($info->labels->name), 'geodirectory');?></option>
85
+                            }?>><?php _e(ucfirst($info->labels->name), 'geodirectory'); ?></option>
86 86
 
87 87
                         <?php endforeach; ?>
88 88
                     </select>
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
                  * @since 1.5.5
158 158
                  * @param string $default_search_button_label The current search button text.
159 159
                  */
160
-                $default_search_button_label = apply_filters('geodir_search_default_search_button_text', $default_search_button_label);?>
160
+                $default_search_button_label = apply_filters('geodir_search_default_search_button_text', $default_search_button_label); ?>
161 161
 				<input type="button" value="<?php esc_attr_e($default_search_button_label); ?>" class="geodir_submit_search" />
162 162
                 <?php
163 163
                 /**
Please login to merge, or discard this patch.
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -50,16 +50,19 @@
 block discarded – undo
50 50
                 <?php
51 51
 
52 52
                 $default_search_for_text = SEARCH_FOR_TEXT;
53
-                if (get_option('geodir_search_field_default_text'))
54
-                    $default_search_for_text = __(get_option('geodir_search_field_default_text'), 'geodirectory');
53
+                if (get_option('geodir_search_field_default_text')) {
54
+                                    $default_search_for_text = __(get_option('geodir_search_field_default_text'), 'geodirectory');
55
+                }
55 56
 
56 57
                 $default_near_text = NEAR_TEXT;
57
-                if (get_option('geodir_near_field_default_text'))
58
-                    $default_near_text = __(get_option('geodir_near_field_default_text'), 'geodirectory');
58
+                if (get_option('geodir_near_field_default_text')) {
59
+                                    $default_near_text = __(get_option('geodir_near_field_default_text'), 'geodirectory');
60
+                }
59 61
 
60 62
                 $default_search_button_label = __('Search', 'geodirectory');
61
-                if (get_option('geodir_search_button_label'))
62
-                    $default_search_button_label = __(get_option('geodir_search_button_label'), 'geodirectory');
63
+                if (get_option('geodir_search_button_label')) {
64
+                                    $default_search_button_label = __(get_option('geodir_search_button_label'), 'geodirectory');
65
+                }
63 66
 
64 67
                 $post_types = geodir_get_posttypes('object');
65 68
 
Please login to merge, or discard this patch.
geodirectory-templates/listing-listview.php 3 patches
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -1,19 +1,19 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Template for the list of places
4
- *
5
- * This is used mostly on the listing (category) pages and outputs the actual grid or list of listings.
6
- * See the link below for info on how to replace the template in your theme.
7
- *
8
- * @link http://docs.wpgeodirectory.com/customizing-geodirectory-templates/
9
- * @since 1.0.0
10
- * @package GeoDirectory
11
- * @global object $wpdb WordPress Database object.
12
- * @global object $post The current post object.
13
- * @global object $wp_query WordPress Query object.
14
- * @global string $gridview_columns The girdview style of the listings.
15
- * @global object $gd_session GeoDirectory Session object.
16
- */
3
+         * Template for the list of places
4
+         *
5
+         * This is used mostly on the listing (category) pages and outputs the actual grid or list of listings.
6
+         * See the link below for info on how to replace the template in your theme.
7
+         *
8
+         * @link http://docs.wpgeodirectory.com/customizing-geodirectory-templates/
9
+         * @since 1.0.0
10
+         * @package GeoDirectory
11
+         * @global object $wpdb WordPress Database object.
12
+         * @global object $post The current post object.
13
+         * @global object $wp_query WordPress Query object.
14
+         * @global string $gridview_columns The girdview style of the listings.
15
+         * @global object $gd_session GeoDirectory Session object.
16
+         */
17 17
 
18 18
 /**
19 19
  * Called before the listing template used to list listing of places.
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
  */
37 37
 $grid_view_class = apply_filters('geodir_grid_view_widget_columns', $gridview_columns);
38 38
 if ($gd_session->get('gd_listing_view') && !isset($before_widget) && !isset($related_posts)) {
39
-	$grid_view_class = geodir_convert_listing_view_class($gd_session->get('gd_listing_view'));
39
+    $grid_view_class = geodir_convert_listing_view_class($gd_session->get('gd_listing_view'));
40 40
 }
41 41
 ?>
42 42
 
@@ -320,8 +320,8 @@  discard block
 block discarded – undo
320 320
                                     ?>
321 321
                                     <span class="geodir-pinpoint"
322 322
                                           style=" background:url('<?php if (isset($marker_icon)) {
323
-                                              echo $marker_icon;
324
-                                          } ?>') no-repeat scroll left top transparent; background-size:auto 100%; -webkit-background-size:auto 100%; -moz-background-size:auto 100%; height:9px; width:14px; ">
323
+                                                echo $marker_icon;
324
+                                            } ?>') no-repeat scroll left top transparent; background-size:auto 100%; -webkit-background-size:auto 100%; -moz-background-size:auto 100%; height:9px; width:14px; ">
325 325
                                         <?php echo apply_filters('geodir_listing_listview_pinpoint_inner_content', '', 'listing'); ?>
326 326
                                     </span>
327 327
                                     <a class="geodir-pinpoint-link" href="javascript:void(0)"
@@ -411,14 +411,14 @@  discard block
 block discarded – undo
411 411
             do_action('geodir_after_listing_post_listview');
412 412
 
413 413
         else:
414
-			$favorite = isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite' ? true : false;
414
+            $favorite = isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite' ? true : false;
415 415
             
416
-			/**
416
+            /**
417 417
              * Called inside the `ul` of the listings template, when no listing found.
418 418
              *
419 419
              * @since 1.5.5
420
-			 * @param string 'listing-listview' Listing listview template.
421
-			 * @param bool $favorite Are favorite listings results?
420
+             * @param string 'listing-listview' Listing listview template.
421
+             * @param bool $favorite Are favorite listings results?
422 422
              */
423 423
             do_action('geodir_message_not_found_on_listing', 'listing-listview', $favorite);
424 424
         endif;
@@ -429,8 +429,8 @@  discard block
 block discarded – undo
429 429
     <div class="clear"></div>
430 430
 <?php
431 431
 /**
432
- * Called after the listings list view template, after all the wrapper at the very end.
433
- *
434
- * @since 1.0.0
435
- */
432
+         * Called after the listings list view template, after all the wrapper at the very end.
433
+         *
434
+         * @since 1.0.0
435
+         */
436 436
 do_action('geodir_after_listing_listview');
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
                                     echo geodir_show_badges_on_image('featured', $post, get_permalink());
106 106
                                 }
107 107
 
108
-                                $geodir_days_new = (int)get_option('geodir_listing_new_days');
108
+                                $geodir_days_new = (int) get_option('geodir_listing_new_days');
109 109
 
110 110
                                 if (round(abs(strtotime($post->post_date) - strtotime(date('Y-m-d'))) / 86400) < $geodir_days_new) {
111 111
                                     echo geodir_show_badges_on_image('new', $post, get_permalink());
@@ -220,12 +220,12 @@  discard block
 block discarded – undo
220 220
                                  */
221 221
                                 $show_listing_excerpt = apply_filters('geodir_show_listing_post_excerpt', true, 'listview', $post);
222 222
                                 if ($show_listing_excerpt) {
223
-                                    if ( isset( $character_count ) && ( $character_count || $character_count == '0' ) ) {
224
-                                        $content_out = geodir_max_excerpt( $character_count );
223
+                                    if (isset($character_count) && ($character_count || $character_count == '0')) {
224
+                                        $content_out = geodir_max_excerpt($character_count);
225 225
                                     } else {
226 226
                                         $content_out = get_the_excerpt();
227 227
                                     }
228
-                                    if ( ! empty( $content_out ) ) {
228
+                                    if (!empty($content_out)) {
229 229
                                         echo "<p>" . $content_out . "</p>";
230 230
                                     }
231 231
                                 }
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
                          * @param object $post The post object.
251 251
                          * @param string $view The view type, default 'listing'.
252 252
                          */
253
-                        do_action( 'geodir_after_listing_content', $post, 'listing' ); ?>
253
+                        do_action('geodir_after_listing_content', $post, 'listing'); ?>
254 254
                         <footer class="geodir-entry-meta <?php echo apply_filters('geodir_listing_listview_meta_extra_class', '', 'listing'); ?>">
255 255
                             <div class="geodir-addinfo clearfix <?php echo apply_filters('geodir_listing_listview_addinfo_extra_class', '', 'listing'); ?>">
256 256
 
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
                                  * @param object $post The post object.
263 263
                                  * @param string $view The view type, default 'listing'.
264 264
                                  */
265
-                                do_action( 'geodir_before_review_html', $post, 'listing' );
265
+                                do_action('geodir_before_review_html', $post, 'listing');
266 266
 
267 267
                                 $review_show = geodir_is_reviews_show('listview');
268 268
 
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
                                  *
306 306
                                  * @since 1.0.0
307 307
                                  */
308
-                                do_action( 'geodir_after_favorite_html', $post->ID, 'listing' );
308
+                                do_action('geodir_after_favorite_html', $post->ID, 'listing');
309 309
 
310 310
                                 global $wp_query;
311 311
 
@@ -335,7 +335,7 @@  discard block
 block discarded – undo
335 335
                                  *
336 336
                                  * @since 1.0.0
337 337
                                  */
338
-                                do_action( 'geodir_listing_after_pinpoint', $post->ID );
338
+                                do_action('geodir_listing_after_pinpoint', $post->ID);
339 339
 
340 340
                                 if ($post->post_author == get_current_user_id()) { ?>
341 341
                                     <?php
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
                                                    title="<?php _e('Edit Listing', 'geodirectory'); ?>">
365 365
                                                     <?php
366 366
                                                     $geodir_listing_edit_icon = apply_filters('geodir_listing_edit_icon', 'fa fa-edit');
367
-                                                    echo '<i class="'. $geodir_listing_edit_icon .'"></i>';
367
+                                                    echo '<i class="' . $geodir_listing_edit_icon . '"></i>';
368 368
                                                     ?>
369 369
                                                     <?php _e('Edit', 'geodirectory'); ?>
370 370
                                                 </a>
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
                                                    title="<?php _e('Delete Listing', 'geodirectory'); ?>">
373 373
                                                     <?php
374 374
                                                     $geodir_listing_delete_icon = apply_filters('geodir_listing_delete_icon', 'fa fa-close');
375
-                                                    echo '<i class="'. $geodir_listing_delete_icon .'"></i>';
375
+                                                    echo '<i class="' . $geodir_listing_delete_icon . '"></i>';
376 376
                                                     ?>
377 377
                                                     <?php _e('Delete', 'geodirectory'); ?>
378 378
                                                 </a>
Please login to merge, or discard this patch.
Braces   +8 added lines, -3 removed lines patch added patch discarded remove patch
@@ -80,7 +80,10 @@  discard block
 block discarded – undo
80 80
                     echo ' geodir-listview ';
81 81
                 } ?> <?php if ($post_view_class) {
82 82
                     echo $post_view_class;
83
-                } ?>" <?php if (isset($listing_width) && $listing_width) echo "style='width:{$listing_width}%;'"; // Width for widget listing ?> >
83
+                } ?>" <?php if (isset($listing_width) && $listing_width) {
84
+                    echo "style='width:{$listing_width}%;'";
85
+                }
86
+                // Width for widget listing ?> >
84 87
                     <article class="geodir-category-listing <?php if ($post_view_article_class) {
85 88
                         echo $post_view_article_class;
86 89
                     } ?>">
@@ -410,8 +413,10 @@  discard block
 block discarded – undo
410 413
              */
411 414
             do_action('geodir_after_listing_post_listview');
412 415
 
413
-        else:
414
-			$favorite = isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite' ? true : false;
416
+        else {
417
+            :
418
+			$favorite = isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite' ? true : false;
419
+        }
415 420
             
416 421
 			/**
417 422
              * Called inside the `ul` of the listings template, when no listing found.
Please login to merge, or discard this patch.
geodirectory-templates/listing-success.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Template for the success page after submitting a listing
4
- *
5
- * You can make most changes via hooks or see the link below for info on how to replace the template in your theme.
6
- *
7
- * @link http://docs.wpgeodirectory.com/customizing-geodirectory-templates/
8
- * @since 1.0.0
9
- * @package GeoDirectory
10
- */
3
+         * Template for the success page after submitting a listing
4
+         *
5
+         * You can make most changes via hooks or see the link below for info on how to replace the template in your theme.
6
+         *
7
+         * @link http://docs.wpgeodirectory.com/customizing-geodirectory-templates/
8
+         * @since 1.0.0
9
+         * @package GeoDirectory
10
+         */
11 11
 
12 12
 // call header
13 13
 get_header();
Please login to merge, or discard this patch.