Passed
Pull Request — master (#229)
by Kiran
12:59
created
geodirectory-functions/shortcode_functions.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -559,11 +559,11 @@  discard block
 block discarded – undo
559 559
 	$post_number		 = !empty($args['post_number']) ? $args['post_number'] : 10;
560 560
 	$add_location_filter = !empty($args['add_location_filter']) ? true : false;
561 561
 	$list_sort 			 = !empty($args['list_sort']) ? $args['list_sort'] : 'latest';
562
-	$character_count	 = isset($args['character_count']) ? $args['character_count'] : '';
563
-	$layout 			 = !empty($args['layout']) ? $args['layout'] : 'gridview_onehalf';
564
-	$with_pagination 	 = !empty($args['with_pagination']) ? true : false;
565
-	$event_type 	 	 = !empty($args['event_type']) ? $args['event_type'] : '';
566
-    $shortcode_content   = !empty($args['shortcode_content']) ? trim($args['shortcode_content']) : '';
562
+	$character_count = isset($args['character_count']) ? $args['character_count'] : '';
563
+	$layout = !empty($args['layout']) ? $args['layout'] : 'gridview_onehalf';
564
+	$with_pagination = !empty($args['with_pagination']) ? true : false;
565
+	$event_type = !empty($args['event_type']) ? $args['event_type'] : '';
566
+    $shortcode_content = !empty($args['shortcode_content']) ? trim($args['shortcode_content']) : '';
567 567
     /**
568 568
      * Filter the content text displayed when no listings found.
569 569
      *
@@ -575,13 +575,13 @@  discard block
 block discarded – undo
575 575
     $shortcode_content = apply_filters('geodir_sc_gd_listings_not_found_content', $shortcode_content, $args);
576 576
 		
577 577
 	$top_pagination 	 = $with_pagination && !empty($args['top_pagination']) ? true : false;
578
-	$bottom_pagination 	 = $with_pagination && !empty($args['bottom_pagination']) ? true : false;
578
+	$bottom_pagination = $with_pagination && !empty($args['bottom_pagination']) ? true : false;
579 579
 	
580 580
 	$shortcode_atts		 = !empty($args['shortcode_atts']) ? $args['shortcode_atts'] : array();
581 581
 
582 582
 	// ajax mode
583
-	$geodir_ajax		 = !empty($args['geodir_ajax']) ? true : false;
584
-	$pageno 	 		 = $geodir_ajax && !empty($args['pageno']) ? $args['pageno'] : 1;
583
+	$geodir_ajax = !empty($args['geodir_ajax']) ? true : false;
584
+	$pageno = $geodir_ajax && !empty($args['pageno']) ? $args['pageno'] : 1;
585 585
 	
586 586
 	$query_args = array(
587 587
         'posts_per_page' => $post_number,
@@ -740,7 +740,7 @@  discard block
 block discarded – undo
740 740
 			if(!pid > 0 || !(container && typeof container != 'undefined')) {
741 741
 			  return false;
742 742
 			}
743
-			var scatts = "<?php echo addslashes(json_encode($shortcode_atts));?>";
743
+			var scatts = "<?php echo addslashes(json_encode($shortcode_atts)); ?>";
744 744
 			
745 745
 			var data = {
746 746
 			  'action': 'geodir_sclistings',
@@ -820,7 +820,7 @@  discard block
 block discarded – undo
820 820
 	if ($max_page > 1 || $always_show) {
821 821
 		// Extra pagination info
822 822
 		$geodir_pagination_more_info = get_option('geodir_pagination_advance_info');
823
-		$start_no = ( $pageno - 1 ) * $posts_per_page + 1;
823
+		$start_no = ($pageno - 1) * $posts_per_page + 1;
824 824
 		$end_no = min($pageno * $posts_per_page, $numposts);
825 825
 		
826 826
 		if ($geodir_pagination_more_info != '') {
@@ -839,7 +839,7 @@  discard block
 block discarded – undo
839 839
 		}
840 840
 		
841 841
 		if (($pageno - 1) > 0) {
842
-			echo '<a class="gd-page-sc-prev" href="javascript:void(0);" onclick="gd_sc_gopage(this, ' . (int)($pageno - 1) . ');">' . $prelabel . '</a>&nbsp;';
842
+			echo '<a class="gd-page-sc-prev" href="javascript:void(0);" onclick="gd_sc_gopage(this, ' . (int) ($pageno - 1) . ');">' . $prelabel . '</a>&nbsp;';
843 843
 		}
844 844
 		
845 845
 		for ($i = $pageno - $half_pages_to_show; $i <= $pageno + $half_pages_to_show; $i++) {
@@ -847,17 +847,17 @@  discard block
 block discarded – undo
847 847
 				if ($i == $pageno) {
848 848
 					echo "<strong class='on' class='gd-page-sc-act'>$i</strong>";
849 849
 				} else {
850
-					echo ' <a class="gd-page-sc-no" href="javascript:void(0);" onclick="gd_sc_gopage(this, ' . (int)$i . ');">' . $i . '</a> ';
850
+					echo ' <a class="gd-page-sc-no" href="javascript:void(0);" onclick="gd_sc_gopage(this, ' . (int) $i . ');">' . $i . '</a> ';
851 851
 				}
852 852
 			}
853 853
 		}
854 854
 		
855 855
 		if (($pageno + 1) <= $max_page) {
856
-			echo '&nbsp;<a class="gd-page-sc-nxt" href="javascript:void(0);" onclick="gd_sc_gopage(this, ' . (int)($pageno + 1) . ');">' . $nxtlabel . '</a>';
856
+			echo '&nbsp;<a class="gd-page-sc-nxt" href="javascript:void(0);" onclick="gd_sc_gopage(this, ' . (int) ($pageno + 1) . ');">' . $nxtlabel . '</a>';
857 857
 		}
858 858
 		
859 859
 		if ($pageno < $max_page) {
860
-			echo '&nbsp;<a class="gd-page-sc-lst" href="javascript:void(0);" onclick="gd_sc_gopage(this, ' . (int)$max_page . ');">&raquo;</a>';
860
+			echo '&nbsp;<a class="gd-page-sc-lst" href="javascript:void(0);" onclick="gd_sc_gopage(this, ' . (int) $max_page . ');">&raquo;</a>';
861 861
 		}
862 862
 		echo "</div> $after";
863 863
 	}
@@ -880,7 +880,7 @@  discard block
 block discarded – undo
880 880
     $scatts = isset($_POST['scatts']) ? $_POST['scatts'] : NULL;
881 881
     $pageno = isset($_POST['pageno']) ? absint($_POST['pageno']) : 1;
882 882
 	
883
-	$shortcode_atts = !empty($scatts) ? (array)json_decode(stripslashes_deep($scatts)) : NULL;
883
+	$shortcode_atts = !empty($scatts) ? (array) json_decode(stripslashes_deep($scatts)) : NULL;
884 884
 	
885 885
 	if (!empty($shortcode_atts) && is_array($shortcode_atts)) {
886 886
 		$shortcode_atts['pageno'] = $pageno;
Please login to merge, or discard this patch.
geodirectory_shortcodes.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -202,14 +202,14 @@  discard block
 block discarded – undo
202 202
 	// Add marker cluster
203 203
 	if (isset($params['marker_cluster']) && gdsc_to_bool_val($params['marker_cluster']) && defined('GDCLUSTER_VERSION')) {
204 204
         $map_args['enable_marker_cluster'] = true;
205
-        if(get_option('geodir_marker_cluster_type')) {
205
+        if (get_option('geodir_marker_cluster_type')) {
206 206
             if ($map_args['autozoom']) {
207 207
                 $map_args['enable_marker_cluster_no_reposition'] = false;
208 208
             } else {
209 209
                 $map_args['enable_marker_cluster_no_reposition'] = true;
210 210
             }
211 211
 
212
-            $map_args['enable_marker_cluster_server'] = true ;
212
+            $map_args['enable_marker_cluster_server'] = true;
213 213
 
214 214
         }
215 215
 	} else {
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
 	}
218 218
 
219 219
     // if lat and long set in shortcode, hack it so the map is not repositioned
220
-    if(!empty($params['latitude']) && !empty($params['longitude']) ){
220
+    if (!empty($params['latitude']) && !empty($params['longitude'])) {
221 221
         $map_args['enable_marker_cluster_no_reposition'] = true;
222 222
     }
223 223
 
@@ -890,7 +890,7 @@  discard block
 block discarded – undo
890 890
 	
891 891
 	$show_adv_search = isset($params['show_adv_search']) && in_array($params['show_adv_search'], array('default', 'always', 'searched')) ? $params['show_adv_search'] : '';
892 892
 	
893
-	if ($show_adv_search != '' ) {
893
+	if ($show_adv_search != '') {
894 894
 		$show_adv_class = 'geodir-advance-search-' . $show_adv_search . ' ';
895 895
 		if ($show_adv_search == 'searched' && geodir_is_page('search')) {
896 896
 			$show_adv_search = 'search';
@@ -903,7 +903,7 @@  discard block
 block discarded – undo
903 903
 	ob_start();
904 904
 	
905 905
 	//geodir_get_template_part('listing', 'filter-form');
906
-	the_widget('geodir_advance_search_widget', $params, $params );
906
+	the_widget('geodir_advance_search_widget', $params, $params);
907 907
 	
908 908
 	$output = ob_get_contents();
909 909
     ob_end_clean();
@@ -1101,7 +1101,7 @@  discard block
 block discarded – undo
1101 1101
 
1102 1102
     // Validate character_count
1103 1103
     //todo: is this necessary?
1104
-    $params['character_count']  = $params['character_count'];
1104
+    $params['character_count'] = $params['character_count'];
1105 1105
 
1106 1106
     // Validate our layout choice
1107 1107
     // Outside of the norm, I added some more simple terms to match the existing
@@ -1113,7 +1113,7 @@  discard block
 block discarded – undo
1113 1113
 
1114 1114
     // Validate Listing width, used in the template widget-listing-listview.php
1115 1115
     // The context is in width=$listing_width% - So we need a positive number between 0 & 100
1116
-    $params['listing_width']    = gdsc_validate_listing_width($params['listing_width']);
1116
+    $params['listing_width'] = gdsc_validate_listing_width($params['listing_width']);
1117 1117
 
1118 1118
     // Validate the checkboxes used on the widget
1119 1119
     $params['add_location_filter']  = gdsc_to_bool_val($params['add_location_filter']);
@@ -1137,13 +1137,13 @@  discard block
 block discarded – undo
1137 1137
         unset($atts['pageno']);
1138 1138
     }
1139 1139
 
1140
-    if ( !empty($atts['shortcode_content']) ) {
1140
+    if (!empty($atts['shortcode_content'])) {
1141 1141
         $content = $atts['shortcode_content'];
1142 1142
     }
1143 1143
     $params['shortcode_content'] = trim($content);
1144 1144
     $atts['shortcode_content'] = trim($content);
1145 1145
     
1146
-    $params['shortcode_atts']       = $atts;
1146
+    $params['shortcode_atts'] = $atts;
1147 1147
 
1148 1148
     $output = geodir_sc_gd_listings_output($params);
1149 1149
 
@@ -1210,8 +1210,8 @@  discard block
 block discarded – undo
1210 1210
 	// Validate the checkboxes used on the widget
1211 1211
     $params['hide_empty'] 	= gdsc_to_bool_val($params['hide_empty']);
1212 1212
     $params['show_count'] 	= gdsc_to_bool_val($params['show_count']);
1213
-    $params['hide_icon'] 	= gdsc_to_bool_val($params['hide_icon']);
1214
-    $params['cpt_left'] 	= gdsc_to_bool_val($params['cpt_left']);
1213
+    $params['hide_icon'] = gdsc_to_bool_val($params['hide_icon']);
1214
+    $params['cpt_left'] = gdsc_to_bool_val($params['cpt_left']);
1215 1215
 	
1216 1216
 	if ($params['max_count'] != 'all') {
1217 1217
 		$params['max_count'] = absint($params['max_count']);
Please login to merge, or discard this patch.