Passed
Pull Request — master (#204)
by Kiran
08:01
created
geodirectory-functions/comments_functions.php 3 patches
Braces   +60 added lines, -48 removed lines patch added patch discarded remove patch
@@ -248,8 +248,9 @@  discard block
 block discarded – undo
248 248
 
249 249
     $post_id = isset($comment_info->comment_post_ID) ? $comment_info->comment_post_ID : '';
250 250
 
251
-    if (!empty($comment_info))
252
-        $status = $comment_info->comment_approved;
251
+    if (!empty($comment_info)) {
252
+            $status = $comment_info->comment_approved;
253
+    }
253 254
 
254 255
     if ($status == 'approve' || $status == 1) {
255 256
         $status = 1;
@@ -381,12 +382,14 @@  discard block
 block discarded – undo
381 382
 function geodir_wrap_comment_text($content, $comment = '')
382 383
 {
383 384
     $rating = 0;
384
-    if (!empty($comment))
385
-        $rating = geodir_get_commentoverall($comment->comment_ID);
385
+    if (!empty($comment)) {
386
+            $rating = geodir_get_commentoverall($comment->comment_ID);
387
+    }
386 388
     if ($rating != 0 && !is_admin()) {
387 389
         return '<div><div class="gd-rating-text">' . __('Overall Rating', 'geodirectory') . ': <div class="rating">' . $rating . '</div></div>' . geodir_get_rating_stars($rating, $comment->comment_ID) . '</div><div class="description">' . $content . '</div>';
388
-    } else
389
-        return $content;
390
+    } else {
391
+            return $content;
392
+    }
390 393
 
391 394
 }
392 395
 
@@ -475,11 +478,12 @@  discard block
 block discarded – undo
475 478
         $post_ratings = get_post_meta($post_id, 'overall_rating');
476 479
     }
477 480
 
478
-    if ($post_ratings)
479
-        return $post_ratings;
480
-    else
481
-        return false;
482
-}
481
+    if ($post_ratings) {
482
+            return $post_ratings;
483
+    } else {
484
+            return false;
485
+    }
486
+    }
483 487
 
484 488
 
485 489
 /**
@@ -504,11 +508,12 @@  discard block
 block discarded – undo
504 508
         )
505 509
     );
506 510
 
507
-    if (!empty($reatings))
508
-        return $reatings;
509
-    else
510
-        return false;
511
-}
511
+    if (!empty($reatings)) {
512
+            return $reatings;
513
+    } else {
514
+            return false;
515
+    }
516
+    }
512 517
 
513 518
 /**
514 519
  * Get review total of a Post.
@@ -532,11 +537,12 @@  discard block
 block discarded – undo
532 537
         )
533 538
     );
534 539
 
535
-    if (!empty($results))
536
-        return $results;
537
-    else
538
-        return false;
539
-}
540
+    if (!empty($results)) {
541
+            return $results;
542
+    } else {
543
+            return false;
544
+    }
545
+    }
540 546
 
541 547
 /**
542 548
  * Get review count by user ID.
@@ -559,11 +565,12 @@  discard block
 block discarded – undo
559 565
         )
560 566
     );
561 567
 
562
-    if (!empty($results))
563
-        return $results;
564
-    else
565
-        return false;
566
-}
568
+    if (!empty($results)) {
569
+            return $results;
570
+    } else {
571
+            return false;
572
+    }
573
+    }
567 574
 
568 575
 /**
569 576
  * Get average overall rating of a Post.
@@ -597,11 +604,12 @@  discard block
 block discarded – undo
597 604
         )
598 605
     );
599 606
 
600
-    if (!empty($results))
601
-        return $results;
602
-    else
603
-        return false;
604
-}
607
+    if (!empty($results)) {
608
+            return $results;
609
+    } else {
610
+            return false;
611
+    }
612
+    }
605 613
 
606 614
 /**
607 615
  * Get review count of a Post.
@@ -625,11 +633,12 @@  discard block
 block discarded – undo
625 633
         )
626 634
     );
627 635
 
628
-    if (!empty($results))
629
-        return $results;
630
-    else
631
-        return false;
632
-}
636
+    if (!empty($results)) {
637
+            return $results;
638
+    } else {
639
+            return false;
640
+    }
641
+    }
633 642
 
634 643
 /**
635 644
  * Get comments count of a Post.
@@ -655,11 +664,12 @@  discard block
 block discarded – undo
655 664
     );
656 665
 
657 666
 
658
-    if (!empty($results))
659
-        return $results;
660
-    else
661
-        return false;
662
-}
667
+    if (!empty($results)) {
668
+            return $results;
669
+    } else {
670
+            return false;
671
+    }
672
+    }
663 673
 
664 674
 /**
665 675
  * Get overall rating of a comment.
@@ -683,11 +693,12 @@  discard block
 block discarded – undo
683 693
         )
684 694
     );
685 695
 
686
-    if ($reatings)
687
-        return $reatings;
688
-    else
689
-        return false;
690
-}
696
+    if ($reatings) {
697
+            return $reatings;
698
+    } else {
699
+            return false;
700
+    }
701
+    }
691 702
 
692 703
 /**
693 704
  * Returns average overall rating of a Post. Depreciated since ver 1.3.6.
@@ -930,8 +941,9 @@  discard block
 block discarded – undo
930 941
     $active_tabs = get_option('geodir_detail_page_tabs_excluded');
931 942
 
932 943
     $is_display = true;
933
-    if (!empty($active_tabs) && in_array('reviews', $active_tabs))
934
-        $is_display = false;
944
+    if (!empty($active_tabs) && in_array('reviews', $active_tabs)) {
945
+            $is_display = false;
946
+    }
935 947
 
936 948
     /**
937 949
      * Filter to change display value.
Please login to merge, or discard this patch.
Indentation   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Comment related functions.
4
- *
5
- * @since 1.0.0
6
- * @package GeoDirectory
7
- */
3
+     * Comment related functions.
4
+     *
5
+     * @since 1.0.0
6
+     * @package GeoDirectory
7
+     */
8 8
 
9 9
 add_filter('comment_row_actions', 'geodir_comment_meta_row_action', 11, 1);
10 10
 /**
@@ -68,28 +68,28 @@  discard block
 block discarded – undo
68 68
 function geodir_comment_rating_meta($comment)
69 69
 {
70 70
     $post_type = get_post_type($comment->comment_post_ID);
71
-	if (in_array($post_type, (array)geodir_get_posttypes()) && (int)$comment->comment_parent == 0) {
72
-		$rating = geodir_get_commentoverall($comment->comment_ID);
71
+    if (in_array($post_type, (array)geodir_get_posttypes()) && (int)$comment->comment_parent == 0) {
72
+        $rating = geodir_get_commentoverall($comment->comment_ID);
73 73
 		
74
-		if ((int)get_option('geodir_reviewrating_enable_font_awesome') == 1) {
75
-			$star_texts = array();
76
-			$star_texts[] = __('Terrible', 'geodirectory');
77
-			$star_texts[] = __('Poor', 'geodirectory');
78
-			$star_texts[] = __('Average', 'geodirectory');
79
-			$star_texts[] = __('Very Good', 'geodirectory');
80
-			$star_texts[] = __('Excellent', 'geodirectory');
74
+        if ((int)get_option('geodir_reviewrating_enable_font_awesome') == 1) {
75
+            $star_texts = array();
76
+            $star_texts[] = __('Terrible', 'geodirectory');
77
+            $star_texts[] = __('Poor', 'geodirectory');
78
+            $star_texts[] = __('Average', 'geodirectory');
79
+            $star_texts[] = __('Very Good', 'geodirectory');
80
+            $star_texts[] = __('Excellent', 'geodirectory');
81 81
 			
82
-			echo geodir_font_awesome_rating_form_html('', $star_texts, $rating);
83
-		} else {			
84
-			if ($rating) {
85
-				echo '<div class="gd_rating" data-average="' . $rating . '" data-id="5">';
86
-
87
-			} else {
88
-				echo '<div class="gd_rating" data-average="0" data-id="5"></div>';
89
-			}
90
-		}
91
-		echo '<input type="hidden" id="geodir_overallrating" name="geodir_overallrating" value="' . $rating . '"  />';
92
-	}
82
+            echo geodir_font_awesome_rating_form_html('', $star_texts, $rating);
83
+        } else {			
84
+            if ($rating) {
85
+                echo '<div class="gd_rating" data-average="' . $rating . '" data-id="5">';
86
+
87
+            } else {
88
+                echo '<div class="gd_rating" data-average="0" data-id="5"></div>';
89
+            }
90
+        }
91
+        echo '<input type="hidden" id="geodir_overallrating" name="geodir_overallrating" value="' . $rating . '"  />';
92
+    }
93 93
 }
94 94
 
95 95
 
@@ -113,13 +113,13 @@  discard block
 block discarded – undo
113 113
 
114 114
     if (in_array($post->post_type, $post_types)) {
115 115
         $star_texts = array();
116
-		$star_texts[] = __('Terrible', 'geodirectory');
117
-		$star_texts[] = __('Poor', 'geodirectory');
118
-		$star_texts[] = __('Average', 'geodirectory');
119
-		$star_texts[] = __('Very Good', 'geodirectory');
120
-		$star_texts[] = __('Excellent', 'geodirectory');
116
+        $star_texts[] = __('Terrible', 'geodirectory');
117
+        $star_texts[] = __('Poor', 'geodirectory');
118
+        $star_texts[] = __('Average', 'geodirectory');
119
+        $star_texts[] = __('Very Good', 'geodirectory');
120
+        $star_texts[] = __('Excellent', 'geodirectory');
121 121
 		
122
-		$gd_rating_html = apply_filters('gd_rating_form_html', '<div class="gd_rating" data-average="0" data-id="5"></div>', $star_texts);
122
+        $gd_rating_html = apply_filters('gd_rating_form_html', '<div class="gd_rating" data-average="0" data-id="5"></div>', $star_texts);
123 123
         echo $gd_rating_html;
124 124
         ?>
125 125
         <input type="hidden" id="geodir_overallrating" name="geodir_overallrating" value="0"/><?php
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
     if (isset($_REQUEST['geodir_overallrating'])) {
194 194
         $overall_rating = $_REQUEST['geodir_overallrating'];
195 195
         
196
-		if (isset($comment_info->comment_parent) && (int)$comment_info->comment_parent == 0) {
196
+        if (isset($comment_info->comment_parent) && (int)$comment_info->comment_parent == 0) {
197 197
             $overall_rating = $overall_rating > 0 ? $overall_rating : '0';
198 198
 
199 199
             $sqlqry = $wpdb->prepare("INSERT INTO " . GEODIR_REVIEW_TABLE . " SET
@@ -914,23 +914,23 @@  discard block
 block discarded – undo
914 914
     if ($small) {
915 915
         $r_html = '<div class="rating"><div class="gd_rating_map" data-average="' . $rating . '" data-id="' . $post_id . '"><div class="geodir_RatingColor" ></div><div class="geodir_RatingAverage_small" style="width: ' . $a_rating . '%;"></div><div class="geodir_Star_small"></div></div></div>';
916 916
     } else {
917
-		if (function_exists('geodir_reviewrating_draw_overall_rating')) {
918
-			// Show rating stars from review rating manager
919
-			$r_html = geodir_reviewrating_draw_overall_rating($rating);
920
-		} else {
921
-			$rating_img = '<img alt="rating icon" src="' . get_option('geodir_default_rating_star_icon') . '" />';
917
+        if (function_exists('geodir_reviewrating_draw_overall_rating')) {
918
+            // Show rating stars from review rating manager
919
+            $r_html = geodir_reviewrating_draw_overall_rating($rating);
920
+        } else {
921
+            $rating_img = '<img alt="rating icon" src="' . get_option('geodir_default_rating_star_icon') . '" />';
922 922
 			
923
-			/* fix rating star for safari */
924
-			$star_width = 23 * 5;
925
-			//global $is_safari, $is_iphone, $ios, $is_chrome;
926
-			//$attach_style = ( $is_safari || $is_iphone || $ios || $is_chrome ) && $star_width > 0 ? 'width:' . $star_width . 'px;max-width:none' : '';
927
-			if ($star_width > 0) {
928
-				$attach_style = 'max-width:' . $star_width . 'px';
929
-			} else {
930
-				$attach_style = '';
931
-			}
932
-			$r_html = '<div class="geodir-rating" style="' . $attach_style . '"><div class="gd_rating_show" data-average="' . $rating . '" data-id="' . $post_id . '"><div class="geodir_RatingAverage" style="width: ' . $a_rating . '%;"></div><div class="geodir_Star">' . $rating_img . $rating_img . $rating_img . $rating_img . $rating_img . '</div></div></div>';
933
-		}
923
+            /* fix rating star for safari */
924
+            $star_width = 23 * 5;
925
+            //global $is_safari, $is_iphone, $ios, $is_chrome;
926
+            //$attach_style = ( $is_safari || $is_iphone || $ios || $is_chrome ) && $star_width > 0 ? 'width:' . $star_width . 'px;max-width:none' : '';
927
+            if ($star_width > 0) {
928
+                $attach_style = 'max-width:' . $star_width . 'px';
929
+            } else {
930
+                $attach_style = '';
931
+            }
932
+            $r_html = '<div class="geodir-rating" style="' . $attach_style . '"><div class="gd_rating_show" data-average="' . $rating . '" data-id="' . $post_id . '"><div class="geodir_RatingAverage" style="width: ' . $a_rating . '%;"></div><div class="geodir_Star">' . $rating_img . $rating_img . $rating_img . $rating_img . $rating_img . '</div></div></div>';
933
+        }
934 934
     }
935 935
     return apply_filters('geodir_get_rating_stars_html', $r_html, $rating, 5);
936 936
 }
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -68,10 +68,10 @@  discard block
 block discarded – undo
68 68
 function geodir_comment_rating_meta($comment)
69 69
 {
70 70
     $post_type = get_post_type($comment->comment_post_ID);
71
-	if (in_array($post_type, (array)geodir_get_posttypes()) && (int)$comment->comment_parent == 0) {
71
+	if (in_array($post_type, (array) geodir_get_posttypes()) && (int) $comment->comment_parent == 0) {
72 72
 		$rating = geodir_get_commentoverall($comment->comment_ID);
73 73
 		
74
-		if ((int)get_option('geodir_reviewrating_enable_font_awesome') == 1) {
74
+		if ((int) get_option('geodir_reviewrating_enable_font_awesome') == 1) {
75 75
 			$star_texts = array();
76 76
 			$star_texts[] = __('Terrible', 'geodirectory');
77 77
 			$star_texts[] = __('Poor', 'geodirectory');
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
     if (isset($_REQUEST['geodir_overallrating'])) {
194 194
         $overall_rating = $_REQUEST['geodir_overallrating'];
195 195
         
196
-		if (isset($comment_info->comment_parent) && (int)$comment_info->comment_parent == 0) {
196
+		if (isset($comment_info->comment_parent) && (int) $comment_info->comment_parent == 0) {
197 197
             $overall_rating = $overall_rating > 0 ? $overall_rating : '0';
198 198
 
199 199
             $sqlqry = $wpdb->prepare("INSERT INTO " . GEODIR_REVIEW_TABLE . " SET
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
 
338 338
         $overall_rating = $_REQUEST['geodir_overallrating'];
339 339
 
340
-        if (isset($comment_info->comment_parent) && (int)$comment_info->comment_parent == 0) {
340
+        if (isset($comment_info->comment_parent) && (int) $comment_info->comment_parent == 0) {
341 341
             $overall_rating = $overall_rating > 0 ? $overall_rating : '0';
342 342
 
343 343
             if (isset($old_rating)) {
@@ -457,7 +457,7 @@  discard block
 block discarded – undo
457 457
      * @package GeoDirectory
458 458
      * @param int $post_id The post ID.
459 459
      */
460
-    do_action('geodir_update_postrating',$post_id);
460
+    do_action('geodir_update_postrating', $post_id);
461 461
 
462 462
 }
463 463
 
@@ -969,10 +969,10 @@  discard block
 block discarded – undo
969 969
 /*
970 970
  * If Disqus plugin is active, do some fixes to show on blogs but no on GD post types
971 971
  */
972
-if(function_exists('dsq_can_replace')) {
972
+if (function_exists('dsq_can_replace')) {
973 973
     remove_filter('comments_template', 'dsq_comments_template');
974 974
     add_filter('comments_template', 'dsq_comments_template', 100);
975
-    add_filter('pre_option_disqus_active', 'geodir_option_disqus_active',10,1);
975
+    add_filter('pre_option_disqus_active', 'geodir_option_disqus_active', 10, 1);
976 976
 }
977 977
 
978 978
 
@@ -985,11 +985,11 @@  discard block
 block discarded – undo
985 985
  * @param string $disqus_active Hook called before DB call for option so this is empty.
986 986
  * @return string `1` if active `0` if disabled.
987 987
  */
988
-function geodir_option_disqus_active($disqus_active){
988
+function geodir_option_disqus_active($disqus_active) {
989 989
     global $post;
990 990
     $all_postypes = geodir_get_posttypes();
991 991
 
992
-    if(isset($post->post_type) && is_array($all_postypes) && in_array($post->post_type,$all_postypes)){
992
+    if (isset($post->post_type) && is_array($all_postypes) && in_array($post->post_type, $all_postypes)) {
993 993
         $disqus_active = '0';
994 994
     }
995 995
 
Please login to merge, or discard this patch.
geodirectory-functions/compatibility/Avada.php 3 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
  */
19 19
 function gd_strip_breadcrumb_wrappers($breadcrumb)
20 20
 {
21
-    $breadcrumb = str_replace(array("<li>","</li>"), "", $breadcrumb);
21
+    $breadcrumb = str_replace(array("<li>", "</li>"), "", $breadcrumb);
22 22
     $breadcrumb = str_replace('<div class="geodir-breadcrumb clearfix"><ul id="breadcrumbs">', '<ul class="fusion-breadcrumbs"><li>', $breadcrumb);
23 23
     $breadcrumb = str_replace('</ul></div>', '</li></ul>', $breadcrumb);
24 24
     return $breadcrumb;
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
     return $separator;
40 40
 }
41 41
 
42
-add_action('avada_override_current_page_title_bar','gd_avada_current_page_title_bar_change');
42
+add_action('avada_override_current_page_title_bar', 'gd_avada_current_page_title_bar_change');
43 43
 /**
44 44
  * new title bar functions for gd pages.
45 45
  *
@@ -51,8 +51,8 @@  discard block
 block discarded – undo
51 51
 {
52 52
     if (geodir_is_geodir_page()) {
53 53
         gd_avada_current_page_title_bar();
54
-    }else{
55
-        avada_current_page_title_bar( $c_pageID );
54
+    } else {
55
+        avada_current_page_title_bar($c_pageID);
56 56
     }
57 57
 
58 58
 }
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@
 block discarded – undo
113 113
  * @since 1.0.0
114 114
  * @package GeoDirectory
115 115
  * @param array $classes Class array.
116
- * @return array Modified class array.
116
+ * @return string[] Modified class array.
117 117
  */
118 118
 function geodir_x_body_class($classes)
119 119
 {
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -353,7 +353,7 @@
 block discarded – undo
353 353
 
354 354
     if(!$cpt_left){
355 355
         $cpt_left = "gd-cpt-flat";
356
-    }else{
356
+    } else{
357 357
         $cpt_left = '';
358 358
     }
359 359
 
Please login to merge, or discard this patch.
geodirectory-functions/compatibility/Enfold.php 2 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,19 +1,19 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Enfold theme compatibility functions.
4
- *
5
- * This file lets the GeoDirectory Plugin use the Enfold theme HTML wrappers to fit and work perfectly.
6
- *
7
- * @since 1.0.0
8
- * @package GeoDirectory
9
- */
3
+     * Enfold theme compatibility functions.
4
+     *
5
+     * This file lets the GeoDirectory Plugin use the Enfold theme HTML wrappers to fit and work perfectly.
6
+     *
7
+     * @since 1.0.0
8
+     * @package GeoDirectory
9
+     */
10 10
 add_action('after_setup_theme', 'enfold_action_calls', 11);
11 11
 /**
12
- * Action calls for enfold theme compatibility.
13
- *
14
- * @since 1.0.0
15
- * @package GeoDirectory
16
- */
12
+     * Action calls for enfold theme compatibility.
13
+     *
14
+     * @since 1.0.0
15
+     * @package GeoDirectory
16
+     */
17 17
 function enfold_action_calls()
18 18
 {
19 19
 
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@
 block discarded – undo
113 113
  * @since 1.0.0
114 114
  * @package GeoDirectory
115 115
  * @param array $classes Class array.
116
- * @return array Modified class array.
116
+ * @return string[] Modified class array.
117 117
  */
118 118
 function geodir_x_body_class($classes)
119 119
 {
Please login to merge, or discard this patch.
geodirectory-functions/compatibility/Jupiter.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,19 +1,19 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Jupiter theme compatibility functions.
4
- *
5
- * This file lets the GeoDirectory Plugin use the Jupiter theme HTML wrappers to fit and work perfectly.
6
- *
7
- * @since 1.0.0
8
- * @package GeoDirectory
9
- */
3
+     * Jupiter theme compatibility functions.
4
+     *
5
+     * This file lets the GeoDirectory Plugin use the Jupiter theme HTML wrappers to fit and work perfectly.
6
+     *
7
+     * @since 1.0.0
8
+     * @package GeoDirectory
9
+     */
10 10
 add_action('after_setup_theme', 'jupiter_action_calls', 11);
11 11
 /**
12
- * Action calls for jupiter theme compatibility.
13
- *
14
- * @since 1.0.0
15
- * @package GeoDirectory
16
- */
12
+     * Action calls for jupiter theme compatibility.
13
+     *
14
+     * @since 1.0.0
15
+     * @package GeoDirectory
16
+     */
17 17
 function jupiter_action_calls()
18 18
 {
19 19
     // REMOVE BREADCRUMB
Please login to merge, or discard this patch.
geodirectory-functions/compatibility/Multi_News.php 1 patch
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -126,8 +126,10 @@
 block discarded – undo
126 126
     $regexp = "<a\s[^>]*href=(\"??)([^\" >]*?)\\1[^>]*>(.*)<\/a>";
127 127
     if (preg_match_all("/$regexp/siU", $crums, $matches)) {
128 128
         return $matches[0];
129
-    } else return '';
130
-}
129
+    } else {
130
+        return '';
131
+    }
132
+    }
131 133
 
132 134
 
133 135
 /**
Please login to merge, or discard this patch.
geodirectory-functions/custom_field_html.php 3 patches
Indentation   +73 added lines, -73 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Admin custom field form
4
- *
5
- * @since 1.0.0
6
- *
7
- * @package GeoDirectory
8
- */
3
+     * Admin custom field form
4
+     *
5
+     * @since 1.0.0
6
+     *
7
+     * @package GeoDirectory
8
+     */
9 9
  
10 10
 /**
11 11
  * Displays the custom field form content.
@@ -36,8 +36,8 @@  discard block
 block discarded – undo
36 36
 // Remove Send Enquiry | Send To Friend from listings page
37 37
 $htmlvar_name = isset($field_info->htmlvar_name) && $field_info->htmlvar_name != '' ? $field_info->htmlvar_name : '';
38 38
 if ($htmlvar_name == 'geodir_email') {
39
-	$field_info->show_on_listing = 0;
40
-	$display_on_listing = false;
39
+    $field_info->show_on_listing = 0;
40
+    $display_on_listing = false;
41 41
 }
42 42
 $field_data_type = isset($field_info->data_type) ? $field_info->data_type : '';
43 43
 ?>
@@ -74,10 +74,10 @@  discard block
 block discarded – undo
74 74
 
75 75
     <div id="field_frm<?php echo $result_str; ?>" class="field_frm"
76 76
          style="display:<?php if ($field_ins_upd == 'submit') {
77
-             echo 'block;';
78
-         } else {
79
-             echo 'none;';
80
-         } ?>">
77
+                echo 'block;';
78
+            } else {
79
+                echo 'none;';
80
+            } ?>">
81 81
         <input type="hidden" name="_wpnonce" value="<?php echo esc_attr($nonce); ?>"/>
82 82
         <input type="hidden" name="listing_type" id="listing_type" value="<?php echo $post_type; ?>"/>
83 83
         <input type="hidden" name="field_type" id="field_type" value="<?php echo $field_type; ?>"/>
@@ -143,8 +143,8 @@  discard block
 block discarded – undo
143 143
                 <td align="left">
144 144
                     <input type="text" name="admin_title" id="admin_title"
145 145
                            value="<?php if (isset($field_info->admin_title)) {
146
-                               echo esc_attr($field_info->admin_title);
147
-                           } ?>"/>
146
+                                echo esc_attr($field_info->admin_title);
147
+                            } ?>"/>
148 148
                     <br/><span><?php _e('Personal comment, it would not be displayed anywhere except in custom field settings', 'geodirectory'); ?></span>
149 149
                 </td>
150 150
             </tr>
@@ -153,8 +153,8 @@  discard block
 block discarded – undo
153 153
                 <td align="left">
154 154
                     <input type="text" name="site_title" id="site_title"
155 155
                            value="<?php if (isset($field_info->site_title)) {
156
-                               echo esc_attr($field_info->site_title);
157
-                           } ?>"/>
156
+                                echo esc_attr($field_info->site_title);
157
+                            } ?>"/>
158 158
                     <br/><span><?php _e('Section title which you wish to display in frontend', 'geodirectory'); ?></span>
159 159
                 </td>
160 160
             </tr>
@@ -163,8 +163,8 @@  discard block
 block discarded – undo
163 163
                 <td align="left">
164 164
                     <input type="text" name="admin_desc" id="admin_desc"
165 165
                            value="<?php if (isset($field_info->admin_desc)) {
166
-                               echo esc_attr($field_info->admin_desc);
167
-                           } ?>"/>
166
+                                echo esc_attr($field_info->admin_desc);
167
+                            } ?>"/>
168 168
                     <br/><span><?php _e('Section description which will appear in frontend', 'geodirectory'); ?></span>
169 169
                 </td>
170 170
             </tr>
@@ -176,8 +176,8 @@  discard block
 block discarded – undo
176 176
                     <td align="left">
177 177
                         <input type="text" name="htmlvar_name" id="htmlvar_name"
178 178
                                value="<?php if (isset($field_info->htmlvar_name)) {
179
-                                   echo preg_replace('/geodir_/', '', $field_info->htmlvar_name, 1);
180
-                               }?>" <?php if ($default) {
179
+                                    echo preg_replace('/geodir_/', '', $field_info->htmlvar_name, 1);
180
+                                }?>" <?php if ($default) {
181 181
                             echo 'readonly="readonly"';
182 182
                         }?> />
183 183
                         <br/> <span><?php _e('HTML variable name must not be blank', 'geodirectory');?></span>
@@ -198,9 +198,9 @@  discard block
 block discarded – undo
198 198
                 </td>
199 199
             </tr>
200 200
             <?php 
201
-			if ($field_type != 'textarea' && $field_type != 'html' && $field_type != 'file' && $field_type != 'fieldset' && $field_type != 'taxonomy' && $field_type != 'address') {
202
-				$default_value = isset($field_info->default_value) ? $field_info->default_value : '';
203
-			?>
201
+            if ($field_type != 'textarea' && $field_type != 'html' && $field_type != 'file' && $field_type != 'fieldset' && $field_type != 'taxonomy' && $field_type != 'address') {
202
+                $default_value = isset($field_info->default_value) ? $field_info->default_value : '';
203
+            ?>
204 204
 			<tr>
205 205
 				<td><strong><?php _e('Default value :', 'geodirectory');?></strong></td>
206 206
 				<td align="left">
@@ -299,18 +299,18 @@  discard block
 block discarded – undo
299 299
             <?php
300 300
             $html = ob_get_clean();
301 301
 
302
-			/**
303
-			 * Filter the price packages list.
304
-			 *
305
-			 * Filter the price packages list in custom field form in admin
302
+            /**
303
+             * Filter the price packages list.
304
+             *
305
+             * Filter the price packages list in custom field form in admin
306 306
              * custom fields settings.
307
-			 *
308
-			 * @since 1.0.0
309
-			 *
310
-			 * @param string $html The price packages content.
311
-			 * @param object $field_info Current field object.
312
-			 */
313
-			echo $html = apply_filters('geodir_packages_list_on_custom_fields', $html, $field_info);
307
+             *
308
+             * @since 1.0.0
309
+             *
310
+             * @param string $html The price packages content.
311
+             * @param object $field_info Current field object.
312
+             */
313
+            echo $html = apply_filters('geodir_packages_list_on_custom_fields', $html, $field_info);
314 314
 
315 315
             ?>
316 316
 
@@ -370,8 +370,8 @@  discard block
 block discarded – undo
370 370
                 <td align="left">
371 371
                     <input type="text" name="required_msg" id="required_msg"
372 372
                            value="<?php if (isset($field_info->required_msg)) {
373
-                               echo esc_attr($field_info->required_msg);
374
-                           } ?>"/>
373
+                                echo esc_attr($field_info->required_msg);
374
+                            } ?>"/>
375 375
                     <span>
376 376
                         <?php _e('Enter text for error message if field required and have not full fill requirement.', 'geodirectory'); ?>
377 377
                     </span>
@@ -385,8 +385,8 @@  discard block
 block discarded – undo
385 385
                 <td align="left">
386 386
                     <input type="text" name="validation_pattern" id="validation_pattern"
387 387
                            value="<?php if (isset($field_info->validation_pattern)) {
388
-                               echo esc_attr($field_info->validation_pattern);
389
-                           } ?>"/>
388
+                                echo esc_attr($field_info->validation_pattern);
389
+                            } ?>"/>
390 390
                     <span>
391 391
                         <?php _e('Enter regex expression for HTML5 pattern validation.', 'geodirectory'); ?>
392 392
                     </span>
@@ -399,8 +399,8 @@  discard block
 block discarded – undo
399 399
                 <td align="left">
400 400
                     <input type="text" name="validation_msg" id="validation_msg"
401 401
                            value="<?php if (isset($field_info->validation_msg)) {
402
-                               echo esc_attr($field_info->validation_msg);
403
-                           } ?>"/>
402
+                                echo esc_attr($field_info->validation_msg);
403
+                            } ?>"/>
404 404
                     <span>
405 405
                         <?php _e('Enter a extra validation message to show to the user if validation fails.', 'geodirectory'); ?>
406 406
                     </span>
@@ -547,8 +547,8 @@  discard block
 block discarded – undo
547 547
                         <td align="left">
548 548
                             <input type="text" name="extra[zip_lable]" id="zip_lable"
549 549
                                    value="<?php if (isset($address['zip_lable'])) {
550
-                                       echo esc_attr($address['zip_lable']);
551
-                                   }?>"/>
550
+                                        echo esc_attr($address['zip_lable']);
551
+                                    }?>"/>
552 552
                             <span><?php _e('Enter zip/post code field label in address section.', 'geodirectory');?></span>
553 553
                         </td>
554 554
                     </tr>
@@ -569,8 +569,8 @@  discard block
 block discarded – undo
569 569
                         <td align="left">
570 570
                             <input type="text" name="extra[map_lable]" id="map_lable"
571 571
                                    value="<?php if (isset($address['map_lable'])) {
572
-                                       echo esc_attr($address['map_lable']);
573
-                                   }?>"/>
572
+                                        echo esc_attr($address['map_lable']);
573
+                                    }?>"/>
574 574
                             <span><?php _e('Enter text for  `set address on map` button in address section.', 'geodirectory');?></span>
575 575
                         </td>
576 576
                     </tr>
@@ -603,8 +603,8 @@  discard block
 block discarded – undo
603 603
                         <td align="left">
604 604
                             <input type="text" name="extra[mapview_lable]" id="mapview_lable"
605 605
                                    value="<?php if (isset($address['mapview_lable'])) {
606
-                                       echo esc_attr($address['mapview_lable']);
607
-                                   }?>"/>
606
+                                        echo esc_attr($address['mapview_lable']);
607
+                                    }?>"/>
608 608
                             <span><?php _e('Enter mapview field label in address section.', 'geodirectory');?></span>
609 609
                         </td>
610 610
                     </tr>
@@ -656,8 +656,8 @@  discard block
 block discarded – undo
656 656
                         <td align="left">
657 657
                             <input type="text" name="option_values" id="option_values"
658 658
                                    value="<?php if (isset($field_info->option_values)) {
659
-                                       echo esc_attr($field_info->option_values);
660
-                                   }?>"/>
659
+                                        echo esc_attr($field_info->option_values);
660
+                                    }?>"/>
661 661
                             <br/>
662 662
                             <span><?php _e('Option Values should be separated by comma.', 'geodirectory');?></span>
663 663
                             <br/>
@@ -685,8 +685,8 @@  discard block
 block discarded – undo
685 685
                         <td align="left" style="overflow:inherit;">
686 686
                             <input type="text" name="extra[date_format]" id="date_format"
687 687
                                    value="<?php if (isset($extra['date_format'])) {
688
-                                       echo esc_attr($extra['date_format']);
689
-                                   }else{echo "mm/dd/yy";}?>"/>
688
+                                        echo esc_attr($extra['date_format']);
689
+                                    }else{echo "mm/dd/yy";}?>"/>
690 690
 
691 691
                             <div style="position:relative; cursor:pointer;">
692 692
                         <span onclick="jQuery('#show_dateformat').toggle();">
@@ -770,12 +770,12 @@  discard block
 block discarded – undo
770 770
                 <?php
771 771
                 }
772 772
                     break;
773
-				case 'file': {
774
-					$allowed_file_types = geodir_allowed_mime_types();
773
+                case 'file': {
774
+                    $allowed_file_types = geodir_allowed_mime_types();
775 775
 					
776
-					$extra_fields = isset($field_info->extra_fields) && $field_info->extra_fields != '' ? maybe_unserialize($field_info->extra_fields) : '';
777
-					$gd_file_types = !empty($extra_fields) && !empty($extra_fields['gd_file_types']) ? $extra_fields['gd_file_types'] : array('*');
778
-					?>
776
+                    $extra_fields = isset($field_info->extra_fields) && $field_info->extra_fields != '' ? maybe_unserialize($field_info->extra_fields) : '';
777
+                    $gd_file_types = !empty($extra_fields) && !empty($extra_fields['gd_file_types']) ? $extra_fields['gd_file_types'] : array('*');
778
+                    ?>
779 779
 					<tr>
780 780
 					  <td><strong><?php _e('Allowed file types:', 'geodirectory');?></strong></td>
781 781
 						<td align="left">
@@ -794,8 +794,8 @@  discard block
 block discarded – undo
794 794
 						</td>
795 795
 					</tr>
796 796
 					<?php 
797
-					}
798
-					break;
797
+                    }
798
+                    break;
799 799
 
800 800
             endswitch; ?>
801 801
             <?php if ($field_type != 'fieldset') {
@@ -809,8 +809,8 @@  discard block
 block discarded – undo
809 809
                     <td align="left">
810 810
                         <input type="text" name="field_icon" id="field_icon"
811 811
                                value="<?php if (isset($field_info->field_icon)) {
812
-                                   echo $field_info->field_icon;
813
-                               }?>"/>
812
+                                    echo $field_info->field_icon;
813
+                                }?>"/>
814 814
                     <span>
815 815
                         <?php _e('Upload icon using media and enter its url path, or enter <a href="http://fortawesome.github.io/Font-Awesome/icons/" target="_blank" >font awesome </a>class eg:"fa fa-home"', 'geodirectory');?>
816 816
                     </span>
@@ -823,8 +823,8 @@  discard block
 block discarded – undo
823 823
                     <td align="left">
824 824
                         <input type="text" name="css_class" id="css_class"
825 825
                                value="<?php if (isset($field_info->css_class)) {
826
-                                   echo esc_attr($field_info->css_class);
827
-                               }?>"/>
826
+                                    echo esc_attr($field_info->css_class);
827
+                                }?>"/>
828 828
                     <span>
829 829
                         <?php _e('Enter custom css class for field custom style.', 'geodirectory');?>
830 830
                     </span>
@@ -849,18 +849,18 @@  discard block
 block discarded – undo
849 849
                     <tr>
850 850
                         <td colspan="2" align="left">
851 851
                             <h3><?php
852
-								/**
853
-								 * Filter the section title.
854
-								 *
855
-								 * Filter the section title in custom field form in admin
856
-								 * custom fields settings.
857
-								 *
858
-								 * @since 1.0.0
859
-								 *
860
-								 * @param string $title Title of the section.
861
-								 * @param string $field_type Current field type.
862
-								 */
863
-								echo apply_filters('geodir_advance_custom_fields_heading', __('Posts sort options', 'geodirectory'), $field_type);
852
+                                /**
853
+                                 * Filter the section title.
854
+                                 *
855
+                                 * Filter the section title in custom field form in admin
856
+                                 * custom fields settings.
857
+                                 *
858
+                                 * @since 1.0.0
859
+                                 *
860
+                                 * @param string $title Title of the section.
861
+                                 * @param string $field_type Current field type.
862
+                                 */
863
+                                echo apply_filters('geodir_advance_custom_fields_heading', __('Posts sort options', 'geodirectory'), $field_type);
864 864
 
865 865
                                 ?></h3>
866 866
                         </td>
Please login to merge, or discard this patch.
Spacing   +66 added lines, -66 removed lines patch added patch discarded remove patch
@@ -61,12 +61,12 @@  discard block
 block discarded – undo
61 61
             ?>
62 62
 
63 63
             <b style="cursor:pointer;"
64
-               onclick="show_hide('field_frm<?php echo $result_str;?>')"><?php echo geodir_ucwords(__('Fieldset:', 'geodirectory') . ' ' . $field_admin_title);?></b>
64
+               onclick="show_hide('field_frm<?php echo $result_str; ?>')"><?php echo geodir_ucwords(__('Fieldset:', 'geodirectory') . ' ' . $field_admin_title); ?></b>
65 65
         <?php
66 66
         } else {
67 67
             ?>
68 68
             <b style="cursor:pointer;"
69
-               onclick="show_hide('field_frm<?php echo $result_str;?>')"><?php echo geodir_ucwords(__('Field:', 'geodirectory') . ' ' . $field_admin_title . ' (' . $field_type . ')');?></b>
69
+               onclick="show_hide('field_frm<?php echo $result_str; ?>')"><?php echo geodir_ucwords(__('Field:', 'geodirectory') . ' ' . $field_admin_title . ' (' . $field_type . ')'); ?></b>
70 70
         <?php
71 71
         }
72 72
         ?>
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
                 ?>
173 173
 
174 174
                 <tr>
175
-                    <td><strong><?php _e('HTML variable name :', 'geodirectory');?></strong></td>
175
+                    <td><strong><?php _e('HTML variable name :', 'geodirectory'); ?></strong></td>
176 176
                     <td align="left">
177 177
                         <input type="text" name="htmlvar_name" id="htmlvar_name"
178 178
                                value="<?php if (isset($field_info->htmlvar_name)) {
@@ -180,10 +180,10 @@  discard block
 block discarded – undo
180 180
                                }?>" <?php if ($default) {
181 181
                             echo 'readonly="readonly"';
182 182
                         }?> />
183
-                        <br/> <span><?php _e('HTML variable name must not be blank', 'geodirectory');?></span>
184
-                        <br/> <span><?php _e('This should be a unique name', 'geodirectory');?></span>
183
+                        <br/> <span><?php _e('HTML variable name must not be blank', 'geodirectory'); ?></span>
184
+                        <br/> <span><?php _e('This should be a unique name', 'geodirectory'); ?></span>
185 185
                         <br/>
186
-                        <span><?php _e('HTML variable name not use spaces, special characters', 'geodirectory');?></span>
186
+                        <span><?php _e('HTML variable name not use spaces, special characters', 'geodirectory'); ?></span>
187 187
                     </td>
188 188
                 </tr>
189 189
             <?php } ?>
@@ -202,19 +202,19 @@  discard block
 block discarded – undo
202 202
 				$default_value = isset($field_info->default_value) ? $field_info->default_value : '';
203 203
 			?>
204 204
 			<tr>
205
-				<td><strong><?php _e('Default value :', 'geodirectory');?></strong></td>
205
+				<td><strong><?php _e('Default value :', 'geodirectory'); ?></strong></td>
206 206
 				<td align="left">
207 207
 				<?php if ($field_type == 'checkbox') { ?>
208 208
 				<select name="default_value" id="default_value">
209 209
 					<option value=""><?php _e('Unchecked', 'geodirectory'); ?></option>
210
-					<option value="1" <?php selected(true, (int)$default_value === 1);?>><?php _e('Checked', 'geodirectory'); ?></option>
210
+					<option value="1" <?php selected(true, (int) $default_value === 1); ?>><?php _e('Checked', 'geodirectory'); ?></option>
211 211
 				</select>
212 212
 				<?php } else if ($field_type == 'email') { ?>
213
-				<input type="email" name="default_value" placeholder="<?php _e('[email protected]', 'geodirectory') ;?>" id="default_value" value="<?php echo esc_attr($default_value);?>" /><br/>
214
-				<span><?php _e('Enter the default value. Ex: [email protected]', 'geodirectory');?></span>
213
+				<input type="email" name="default_value" placeholder="<?php _e('[email protected]', 'geodirectory'); ?>" id="default_value" value="<?php echo esc_attr($default_value); ?>" /><br/>
214
+				<span><?php _e('Enter the default value. Ex: [email protected]', 'geodirectory'); ?></span>
215 215
 				<?php } else { ?>
216
-				<input type="text" name="default_value" id="default_value" value="<?php echo esc_attr($default_value);?>" /><br/>
217
-				<span><?php _e('Enter the default value (for "link" this will be used as the link text)', 'geodirectory');?></span>
216
+				<input type="text" name="default_value" id="default_value" value="<?php echo esc_attr($default_value); ?>" /><br/>
217
+				<span><?php _e('Enter the default value (for "link" this will be used as the link text)', 'geodirectory'); ?></span>
218 218
 				<?php } ?>
219 219
 				</td>
220 220
 			</tr>
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
                 </td>
380 380
             </tr>
381 381
 
382
-            <?php if ($field_type == 'text'){?>
382
+            <?php if ($field_type == 'text') {?>
383 383
             <tr>
384 384
                 <td><strong><?php _e('Validation Pattern:', 'geodirectory'); ?></strong></td>
385 385
                 <td align="left">
@@ -409,7 +409,7 @@  discard block
 block discarded – undo
409 409
             </tr>
410 410
             <?php } ?>
411 411
 
412
-            <tr <?php echo (!$display_on_listing ? 'style="display:none"' : '') ;?>>
412
+            <tr <?php echo (!$display_on_listing ? 'style="display:none"' : ''); ?>>
413 413
                 <td><strong><?php _e('Show on listing page ? :', 'geodirectory'); ?></strong></td>
414 414
                 <td align="left">
415 415
                     <select name="show_on_listing" id="show_on_listing">
@@ -468,7 +468,7 @@  discard block
 block discarded – undo
468 468
                 case 'taxonomy': {
469 469
                     ?>
470 470
                     <tr>
471
-                        <td><strong><?php _e('Select taxonomy:', 'geodirectory');?></strong></td>
471
+                        <td><strong><?php _e('Select taxonomy:', 'geodirectory'); ?></strong></td>
472 472
                         <td align="left">
473 473
                             <select name="htmlvar_name" id="htmlvar_name">
474 474
                                 <?php
@@ -478,40 +478,40 @@  discard block
 block discarded – undo
478 478
                                     ?>
479 479
                                     <option <?php if (isset($field_info->htmlvar_name) && $field_info->htmlvar_name == $gd_tax) {
480 480
                                         echo 'selected="selected"';
481
-                                    }?> id="<?php echo $gd_tax;?>"><?php echo $gd_tax;?></option><?php
481
+                                    }?> id="<?php echo $gd_tax; ?>"><?php echo $gd_tax; ?></option><?php
482 482
                                 }
483 483
                                 ?>
484 484
                             </select>
485 485
 
486 486
                             <br/>
487
-                            <span><?php _e('Selected taxonomy name use as field name index. ex:-( post_category[gd_placecategory] )', 'geodirectory');?></span>
487
+                            <span><?php _e('Selected taxonomy name use as field name index. ex:-( post_category[gd_placecategory] )', 'geodirectory'); ?></span>
488 488
                         </td>
489 489
                     </tr>
490 490
 
491 491
                     <tr>
492
-                        <td><strong><?php _e('Category display type :', 'geodirectory');?></strong></td>
492
+                        <td><strong><?php _e('Category display type :', 'geodirectory'); ?></strong></td>
493 493
                         <td align="left">
494 494
 
495 495
                             <select name="cat_display_type" id="cat_display_type">
496 496
                                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'ajax_chained') {
497 497
                                     echo 'selected="selected"';
498
-                                }?> value="ajax_chained"><?php _e('Ajax Chained', 'geodirectory');?></option>
498
+                                }?> value="ajax_chained"><?php _e('Ajax Chained', 'geodirectory'); ?></option>
499 499
                                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'select') {
500 500
                                     echo 'selected="selected"';
501
-                                }?> value="select"><?php _e('Select', 'geodirectory');?></option>
501
+                                }?> value="select"><?php _e('Select', 'geodirectory'); ?></option>
502 502
                                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'multiselect') {
503 503
                                     echo 'selected="selected"';
504
-                                }?> value="multiselect"><?php _e('Multiselect', 'geodirectory');?></option>
504
+                                }?> value="multiselect"><?php _e('Multiselect', 'geodirectory'); ?></option>
505 505
                                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'checkbox') {
506 506
                                     echo 'selected="selected"';
507
-                                }?> value="checkbox"><?php _e('Checkbox', 'geodirectory');?></option>
507
+                                }?> value="checkbox"><?php _e('Checkbox', 'geodirectory'); ?></option>
508 508
                                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'radio') {
509 509
                                     echo 'selected="selected"';
510
-                                }?> value="radio"><?php _e('Radio', 'geodirectory');?></option>
510
+                                }?> value="radio"><?php _e('Radio', 'geodirectory'); ?></option>
511 511
                             </select>
512 512
 
513 513
                             <br/>
514
-                            <span><?php _e('Show categories list as select,multiselect,checkbox or radio', 'geodirectory');?></span>
514
+                            <span><?php _e('Show categories list as select,multiselect,checkbox or radio', 'geodirectory'); ?></span>
515 515
                         </td>
516 516
                     </tr>
517 517
                 <?php } // end of additional field for taxonomy field type
@@ -532,92 +532,92 @@  discard block
 block discarded – undo
532 532
                     do_action('geodir_address_extra_admin_fields', $address, $field_info); ?>
533 533
 
534 534
                     <tr>
535
-                        <td><strong><?php _e('Display zip/post code :', 'geodirectory');?></strong></td>
535
+                        <td><strong><?php _e('Display zip/post code :', 'geodirectory'); ?></strong></td>
536 536
                         <td align="left">
537 537
                             <input type="checkbox" name="extra[show_zip]" id="show_zip"
538 538
                                    value="1" <?php if (isset($address['show_zip']) && $address['show_zip'] == '1') {
539 539
                                 echo 'checked="checked"';
540 540
                             }?>/>
541
-                            <span><?php _e('Select if you want to show zip/post code field in address section.', 'geodirectory');?></span>
541
+                            <span><?php _e('Select if you want to show zip/post code field in address section.', 'geodirectory'); ?></span>
542 542
                         </td>
543 543
                     </tr>
544 544
 
545 545
                     <tr>
546
-                        <td><strong><?php _e('Zip/Post code label :', 'geodirectory');?></strong></td>
546
+                        <td><strong><?php _e('Zip/Post code label :', 'geodirectory'); ?></strong></td>
547 547
                         <td align="left">
548 548
                             <input type="text" name="extra[zip_lable]" id="zip_lable"
549 549
                                    value="<?php if (isset($address['zip_lable'])) {
550 550
                                        echo esc_attr($address['zip_lable']);
551 551
                                    }?>"/>
552
-                            <span><?php _e('Enter zip/post code field label in address section.', 'geodirectory');?></span>
552
+                            <span><?php _e('Enter zip/post code field label in address section.', 'geodirectory'); ?></span>
553 553
                         </td>
554 554
                     </tr>
555 555
 
556 556
                     <tr style="display:none;">
557
-                        <td><strong><?php _e('Display map :', 'geodirectory');?></strong></td>
557
+                        <td><strong><?php _e('Display map :', 'geodirectory'); ?></strong></td>
558 558
                         <td align="left">
559 559
                             <input type="checkbox" name="extra[show_map]" id="show_map"
560 560
                                    value="1" <?php if (isset($address['show_map']) && $address['show_map'] == '1') {
561 561
                                 echo 'checked="checked"';
562 562
                             }?>/>
563
-                            <span><?php _e('Select if you want to `set address on map` field in address section.', 'geodirectory');?></span>
563
+                            <span><?php _e('Select if you want to `set address on map` field in address section.', 'geodirectory'); ?></span>
564 564
                         </td>
565 565
                     </tr>
566 566
 
567 567
                     <tr>
568
-                        <td><strong><?php _e('Map button label :', 'geodirectory');?></strong></td>
568
+                        <td><strong><?php _e('Map button label :', 'geodirectory'); ?></strong></td>
569 569
                         <td align="left">
570 570
                             <input type="text" name="extra[map_lable]" id="map_lable"
571 571
                                    value="<?php if (isset($address['map_lable'])) {
572 572
                                        echo esc_attr($address['map_lable']);
573 573
                                    }?>"/>
574
-                            <span><?php _e('Enter text for  `set address on map` button in address section.', 'geodirectory');?></span>
574
+                            <span><?php _e('Enter text for  `set address on map` button in address section.', 'geodirectory'); ?></span>
575 575
                         </td>
576 576
                     </tr>
577 577
 
578 578
                     <tr>
579
-                        <td><strong><?php _e('Use user zoom level:', 'geodirectory');?></strong></td>
579
+                        <td><strong><?php _e('Use user zoom level:', 'geodirectory'); ?></strong></td>
580 580
                         <td align="left">
581 581
                             <input type="checkbox" name="extra[show_mapzoom]" id="show_mapzoom"
582 582
                                    value="1" <?php if (isset($address['show_mapzoom']) && $address['show_mapzoom'] == '1') {
583 583
                                 echo 'checked="checked"';
584 584
                             }?>/>
585
-                            <span><?php _e('Select if you want to use the user defined map zoom level.', 'geodirectory');?></span>
585
+                            <span><?php _e('Select if you want to use the user defined map zoom level.', 'geodirectory'); ?></span>
586 586
                         </td>
587 587
                     </tr>
588 588
 
589 589
                     <tr>
590
-                        <td><strong><?php _e('Display map view:', 'geodirectory');?></strong></td>
590
+                        <td><strong><?php _e('Display map view:', 'geodirectory'); ?></strong></td>
591 591
                         <td align="left">
592 592
                             <input type="checkbox" name="extra[show_mapview]" id="show_mapview"
593 593
                                    value="1" <?php if (isset($address['show_mapview']) && $address['show_mapview'] == '1') {
594 594
                                 echo 'checked="checked"';
595 595
                             }?>/>
596
-                            <span><?php _e('Select if you want to `set default map` options in address section.', 'geodirectory');?></span>
596
+                            <span><?php _e('Select if you want to `set default map` options in address section.', 'geodirectory'); ?></span>
597 597
                         </td>
598 598
                     </tr>
599 599
 
600 600
 
601 601
                     <tr>
602
-                        <td><strong><?php _e('Map view label :', 'geodirectory');?></strong></td>
602
+                        <td><strong><?php _e('Map view label :', 'geodirectory'); ?></strong></td>
603 603
                         <td align="left">
604 604
                             <input type="text" name="extra[mapview_lable]" id="mapview_lable"
605 605
                                    value="<?php if (isset($address['mapview_lable'])) {
606 606
                                        echo esc_attr($address['mapview_lable']);
607 607
                                    }?>"/>
608
-                            <span><?php _e('Enter mapview field label in address section.', 'geodirectory');?></span>
608
+                            <span><?php _e('Enter mapview field label in address section.', 'geodirectory'); ?></span>
609 609
                         </td>
610 610
                     </tr>
611 611
                     <tr>
612 612
                         <td>
613
-                            <strong><?php _e('Show latitude and longitude from front-end :', 'geodirectory');?></strong>
613
+                            <strong><?php _e('Show latitude and longitude from front-end :', 'geodirectory'); ?></strong>
614 614
                         </td>
615 615
                         <td align="left">
616 616
                             <input type="checkbox" name="extra[show_latlng]" id="show_latlng"
617 617
                                    value="1" <?php if (isset($address['show_latlng']) && $address['show_latlng'] == '1') {
618 618
                                 echo 'checked="checked"';
619 619
                             }?>/>
620
-                            <span><?php _e('Select if you want to show latitude and logatude fields in address section from front-end.', 'geodirectory');?></span>
620
+                            <span><?php _e('Select if you want to show latitude and logatude fields in address section from front-end.', 'geodirectory'); ?></span>
621 621
                         </td>
622 622
                     </tr>
623 623
                 <?php } // end of extra fields for address field type
@@ -629,41 +629,41 @@  discard block
 block discarded – undo
629 629
 
630 630
                         ?>
631 631
                         <tr>
632
-                            <td><strong><?php _e('Multiselect display type :', 'geodirectory');?></strong></td>
632
+                            <td><strong><?php _e('Multiselect display type :', 'geodirectory'); ?></strong></td>
633 633
                             <td align="left">
634 634
 
635 635
                                 <select name="multi_display_type" id="multi_display_type">
636 636
                                     <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'select') {
637 637
                                         echo 'selected="selected"';
638
-                                    }?> value="select"><?php _e('Select', 'geodirectory');?></option>
638
+                                    }?> value="select"><?php _e('Select', 'geodirectory'); ?></option>
639 639
                                     <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'checkbox') {
640 640
                                         echo 'selected="selected"';
641
-                                    }?> value="checkbox"><?php _e('Checkbox', 'geodirectory');?></option>
641
+                                    }?> value="checkbox"><?php _e('Checkbox', 'geodirectory'); ?></option>
642 642
                                     <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'radio') {
643 643
                                         echo 'selected="selected"';
644
-                                    }?> value="radio"><?php _e('Radio', 'geodirectory');?></option>
644
+                                    }?> value="radio"><?php _e('Radio', 'geodirectory'); ?></option>
645 645
                                 </select>
646 646
 
647 647
                                 <br/>
648
-                                <span><?php _e('Show multiselect list as multiselect,checkbox or radio', 'geodirectory');?></span>
648
+                                <span><?php _e('Show multiselect list as multiselect,checkbox or radio', 'geodirectory'); ?></span>
649 649
                             </td>
650 650
                         </tr>
651 651
                     <?php
652 652
                     }
653 653
                     ?>
654 654
                     <tr>
655
-                        <td><strong><?php _e('Option Values :', 'geodirectory');?></strong></td>
655
+                        <td><strong><?php _e('Option Values :', 'geodirectory'); ?></strong></td>
656 656
                         <td align="left">
657 657
                             <input type="text" name="option_values" id="option_values"
658 658
                                    value="<?php if (isset($field_info->option_values)) {
659 659
                                        echo esc_attr($field_info->option_values);
660 660
                                    }?>"/>
661 661
                             <br/>
662
-                            <span><?php _e('Option Values should be separated by comma.', 'geodirectory');?></span>
662
+                            <span><?php _e('Option Values should be separated by comma.', 'geodirectory'); ?></span>
663 663
                             <br/>
664
-                            <span><?php _e('If using for a "tick filter" place a / and then either a 1 for true or 0 for false', 'geodirectory');?></span>
664
+                            <span><?php _e('If using for a "tick filter" place a / and then either a 1 for true or 0 for false', 'geodirectory'); ?></span>
665 665
                             <br/>
666
-                            <span><?php _e('eg: "No Dogs Allowed/0,Dogs Allowed/1" (Select only, not multiselect)', 'geodirectory');?></span>
666
+                            <span><?php _e('eg: "No Dogs Allowed/0,Dogs Allowed/1" (Select only, not multiselect)', 'geodirectory'); ?></span>
667 667
                             <?php if ($field_type == 'multiselect' || $field_type == 'select') { ?>
668 668
                                 <br/>
669 669
                                 <span><?php _e('- If using OPTGROUP tag to grouping options, use "{optgroup}OPTGROUP-LABEL|OPTION-1,OPTION-2{/optgroup}"', 'geodirectory'); ?></span>
@@ -681,12 +681,12 @@  discard block
 block discarded – undo
681 681
                     }
682 682
                     ?>
683 683
                     <tr>
684
-                        <td><strong><?php _e('Date Format :', 'geodirectory');?></strong></td>
684
+                        <td><strong><?php _e('Date Format :', 'geodirectory'); ?></strong></td>
685 685
                         <td align="left" style="overflow:inherit;">
686 686
                             <input type="text" name="extra[date_format]" id="date_format"
687 687
                                    value="<?php if (isset($extra['date_format'])) {
688 688
                                        echo esc_attr($extra['date_format']);
689
-                                   }else{echo "mm/dd/yy";}?>"/>
689
+                                   } else {echo "mm/dd/yy"; }?>"/>
690 690
 
691 691
                             <div style="position:relative; cursor:pointer;">
692 692
                         <span onclick="jQuery('#show_dateformat').toggle();">
@@ -764,7 +764,7 @@  discard block
 block discarded – undo
764 764
 
765 765
                             </div>
766 766
                             <br/>
767
-                            <span><?php _e('Enter the date format.', 'geodirectory');?></span>
767
+                            <span><?php _e('Enter the date format.', 'geodirectory'); ?></span>
768 768
                         </td>
769 769
                     </tr>
770 770
                 <?php
@@ -777,20 +777,20 @@  discard block
 block discarded – undo
777 777
 					$gd_file_types = !empty($extra_fields) && !empty($extra_fields['gd_file_types']) ? $extra_fields['gd_file_types'] : array('*');
778 778
 					?>
779 779
 					<tr>
780
-					  <td><strong><?php _e('Allowed file types:', 'geodirectory');?></strong></td>
780
+					  <td><strong><?php _e('Allowed file types:', 'geodirectory'); ?></strong></td>
781 781
 						<td align="left">
782 782
 							<select name="extra[gd_file_types][]" id="gd_file_types" multiple="multiple" style="height:100px;width:90%;">
783
-								<option value="*" <?php selected(true, in_array('*', $gd_file_types));?>><?php _e('All types', 'geodirectory') ;?></option>
784
-								<?php foreach ( $allowed_file_types as $format => $types ) { ?>
785
-								<optgroup label="<?php echo esc_attr( wp_sprintf(__('%s formats', 'geodirectory'), __($format, 'geodirectory') ) ) ;?>">
786
-									<?php foreach ( $types as $ext => $type ) { ?>
787
-									<option value="<?php echo esc_attr($ext) ;?>" <?php selected(true, in_array($ext, $gd_file_types));?>><?php echo '.' . $ext ;?></option>
783
+								<option value="*" <?php selected(true, in_array('*', $gd_file_types)); ?>><?php _e('All types', 'geodirectory'); ?></option>
784
+								<?php foreach ($allowed_file_types as $format => $types) { ?>
785
+								<optgroup label="<?php echo esc_attr(wp_sprintf(__('%s formats', 'geodirectory'), __($format, 'geodirectory'))); ?>">
786
+									<?php foreach ($types as $ext => $type) { ?>
787
+									<option value="<?php echo esc_attr($ext); ?>" <?php selected(true, in_array($ext, $gd_file_types)); ?>><?php echo '.' . $ext; ?></option>
788 788
 									<?php } ?>
789 789
 								</optgroup>
790 790
 								<?php } ?>
791 791
 							</select>			
792 792
 							<br />
793
-							<span><?php _e('Select file types to allowed for file uploading. (Select multiple file types by holding down "Ctrl" key.)', GEODIRPAYMENT_TEXTDOMAIN);?></span>				
793
+							<span><?php _e('Select file types to allowed for file uploading. (Select multiple file types by holding down "Ctrl" key.)', GEODIRPAYMENT_TEXTDOMAIN); ?></span>				
794 794
 						</td>
795 795
 					</tr>
796 796
 					<?php 
@@ -805,28 +805,28 @@  discard block
 block discarded – undo
805 805
                 </tr>
806 806
 
807 807
                 <tr>
808
-                    <td><strong><?php _e('Upload icon:', 'geodirectory');?></strong></td>
808
+                    <td><strong><?php _e('Upload icon:', 'geodirectory'); ?></strong></td>
809 809
                     <td align="left">
810 810
                         <input type="text" name="field_icon" id="field_icon"
811 811
                                value="<?php if (isset($field_info->field_icon)) {
812 812
                                    echo $field_info->field_icon;
813 813
                                }?>"/>
814 814
                     <span>
815
-                        <?php _e('Upload icon using media and enter its url path, or enter <a href="http://fortawesome.github.io/Font-Awesome/icons/" target="_blank" >font awesome </a>class eg:"fa fa-home"', 'geodirectory');?>
815
+                        <?php _e('Upload icon using media and enter its url path, or enter <a href="http://fortawesome.github.io/Font-Awesome/icons/" target="_blank" >font awesome </a>class eg:"fa fa-home"', 'geodirectory'); ?>
816 816
                     </span>
817 817
                     </td>
818 818
                     </td>
819 819
                 </tr>
820 820
 
821 821
                 <tr>
822
-                    <td><strong><?php _e('Css class:', 'geodirectory');?></strong></td>
822
+                    <td><strong><?php _e('Css class:', 'geodirectory'); ?></strong></td>
823 823
                     <td align="left">
824 824
                         <input type="text" name="css_class" id="css_class"
825 825
                                value="<?php if (isset($field_info->css_class)) {
826 826
                                    echo esc_attr($field_info->css_class);
827 827
                                }?>"/>
828 828
                     <span>
829
-                        <?php _e('Enter custom css class for field custom style.', 'geodirectory');?>
829
+                        <?php _e('Enter custom css class for field custom style.', 'geodirectory'); ?>
830 830
                     </span>
831 831
                     </td>
832 832
                     </td>
@@ -888,7 +888,7 @@  discard block
 block discarded – undo
888 888
                      * @since 1.0.0
889 889
                      * @param object $field_info The current fields info.
890 890
                      */
891
-                    do_action('geodir_advance_custom_fields', $field_info);?>
891
+                    do_action('geodir_advance_custom_fields', $field_info); ?>
892 892
 
893 893
                     <?php /*if(!in_array($field_type,array() )){?>
894 894
 				<tr>
@@ -907,10 +907,10 @@  discard block
 block discarded – undo
907 907
                 <td>&nbsp;</td>
908 908
                 <td align="left">
909 909
 
910
-                    <input type="button" class="button" name="save" id="save" value="<?php echo esc_attr(__('Save','geodirectory'));?>"
910
+                    <input type="button" class="button" name="save" id="save" value="<?php echo esc_attr(__('Save', 'geodirectory')); ?>"
911 911
                            onclick="save_field('<?php echo esc_attr($result_str); ?>')"/>
912 912
                     <?php if (!$default): ?>
913
-                        <a href="javascript:void(0)"><input type="button" name="delete" value="<?php echo esc_attr(__('Delete','geodirectory'));?>"
913
+                        <a href="javascript:void(0)"><input type="button" name="delete" value="<?php echo esc_attr(__('Delete', 'geodirectory')); ?>"
914 914
                                                             onclick="delete_field('<?php echo esc_attr($result_str); ?>', '<?php echo $nonce; ?>')"
915 915
                                                             class="button_n"/></a>
916 916
                     <?php endif; ?>
Please login to merge, or discard this patch.
Braces   +18 added lines, -11 removed lines patch added patch discarded remove patch
@@ -19,16 +19,18 @@  discard block
 block discarded – undo
19 19
 
20 20
 if (!isset($field_info->post_type)) {
21 21
     $post_type = $_REQUEST['listing_type'];
22
-} else
23
-    $post_type = $field_info->post_type;
22
+} else {
23
+    $post_type = $field_info->post_type;
24
+}
24 25
 
25 26
 $field_info = stripslashes_deep($field_info); // strip slashes from labels
26 27
 
27 28
 $nonce = wp_create_nonce('custom_fields_' . $result_str);
28 29
 
29 30
 $field_admin_title = '';
30
-if (isset($field_info->admin_title))
31
-    $field_admin_title = $field_info->admin_title;
31
+if (isset($field_info->admin_title)) {
32
+    $field_admin_title = $field_info->admin_title;
33
+}
32 34
 
33 35
 $default = isset($field_info->is_admin) ? $field_info->is_admin : '';
34 36
 
@@ -52,8 +54,11 @@  discard block
 block discarded – undo
52 54
 
53 55
         <?php if ($default): ?>
54 56
             <div title="<?php _e('Drag and drop to sort', 'geodirectory'); ?>" class="handlediv move"></div>
55
-        <?php else: ?>
56
-            <div title="<?php _e('Click to remove field', 'geodirectory'); ?>"
57
+        <?php else {
58
+    : ?>
59
+            <div title="<?php _e('Click to remove field', 'geodirectory');
60
+}
61
+?>"
57 62
                  onclick="delete_field('<?php echo $result_str; ?>', '<?php echo $nonce; ?>')"
58 63
                  class="handlediv close"></div>
59 64
         <?php endif;
@@ -255,11 +260,13 @@  discard block
 block discarded – undo
255 260
 
256 261
                     <?php
257 262
                     $selected = '';
258
-                    if (isset($field_info->extra_fields))
259
-                        $advanced_editor = unserialize($field_info->extra_fields);
263
+                    if (isset($field_info->extra_fields)) {
264
+                                            $advanced_editor = unserialize($field_info->extra_fields);
265
+                    }
260 266
 
261
-                    if (!empty($advanced_editor) && is_array($advanced_editor) && in_array('1', $advanced_editor))
262
-                        $selected = 'checked="checked"';
267
+                    if (!empty($advanced_editor) && is_array($advanced_editor) && in_array('1', $advanced_editor)) {
268
+                                            $selected = 'checked="checked"';
269
+                    }
263 270
                     ?>
264 271
 
265 272
                     <input type="checkbox" name="advanced_editor[]" id="advanced_editor"
@@ -686,7 +693,7 @@  discard block
 block discarded – undo
686 693
                             <input type="text" name="extra[date_format]" id="date_format"
687 694
                                    value="<?php if (isset($extra['date_format'])) {
688 695
                                        echo esc_attr($extra['date_format']);
689
-                                   }else{echo "mm/dd/yy";}?>"/>
696
+                                   } else{echo "mm/dd/yy";}?>"/>
690 697
 
691 698
                             <div style="position:relative; cursor:pointer;">
692 699
                         <span onclick="jQuery('#show_dateformat').toggle();">
Please login to merge, or discard this patch.
geodirectory-functions/google_analytics.php 2 patches
Spacing   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -72,58 +72,58 @@  discard block
 block discarded – undo
72 72
 
73 73
     $start_date = '';
74 74
     $end_date = '';
75
-    if(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='thisweek'){
76
-        if(!$ga_start){$ga_start = date('Y-m-d', strtotime("-6 day"));}
77
-        if(!$ga_end){$ga_end = date('Y-m-d');}
75
+    if (isset($_REQUEST['ga_type']) && $_REQUEST['ga_type'] == 'thisweek') {
76
+        if (!$ga_start) {$ga_start = date('Y-m-d', strtotime("-6 day")); }
77
+        if (!$ga_end) {$ga_end = date('Y-m-d'); }
78 78
         $dimensions = "&dimensions=ga:date,ga:nthDay";
79
-    }elseif(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='lastweek'){
80
-        if(!$ga_start){$ga_start = date('Y-m-d', strtotime("-13 day"));}
81
-        if(!$ga_end){$ga_end = date('Y-m-d', strtotime("-7 day"));}
79
+    }elseif (isset($_REQUEST['ga_type']) && $_REQUEST['ga_type'] == 'lastweek') {
80
+        if (!$ga_start) {$ga_start = date('Y-m-d', strtotime("-13 day")); }
81
+        if (!$ga_end) {$ga_end = date('Y-m-d', strtotime("-7 day")); }
82 82
         $dimensions = "&dimensions=ga:date,ga:nthDay";
83 83
     }
84
-    elseif(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='thisyear'){
85
-        if(!$ga_start){$ga_start = date('Y')."-01-01";}
86
-        if(!$ga_end){$ga_end = date('Y-m-d');}
84
+    elseif (isset($_REQUEST['ga_type']) && $_REQUEST['ga_type'] == 'thisyear') {
85
+        if (!$ga_start) {$ga_start = date('Y') . "-01-01"; }
86
+        if (!$ga_end) {$ga_end = date('Y-m-d'); }
87 87
         $dimensions = "&dimensions=ga:month,ga:nthMonth";
88 88
     }
89
-    elseif(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='lastyear'){
90
-        if(!$ga_start){$ga_start = date('Y', strtotime("-1 year"))."-01-01";}
91
-        if(!$ga_end){$ga_end = date('Y', strtotime("-1 year"))."-12-31";}
89
+    elseif (isset($_REQUEST['ga_type']) && $_REQUEST['ga_type'] == 'lastyear') {
90
+        if (!$ga_start) {$ga_start = date('Y', strtotime("-1 year")) . "-01-01"; }
91
+        if (!$ga_end) {$ga_end = date('Y', strtotime("-1 year")) . "-12-31"; }
92 92
         $dimensions = "&dimensions=ga:month,ga:nthMonth";
93 93
     }
94
-    elseif(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='country'){
95
-        if(!$ga_start){$ga_start = "14daysAgo";}
96
-        if(!$ga_end){$ga_end = "yesterday";}
94
+    elseif (isset($_REQUEST['ga_type']) && $_REQUEST['ga_type'] == 'country') {
95
+        if (!$ga_start) {$ga_start = "14daysAgo"; }
96
+        if (!$ga_end) {$ga_end = "yesterday"; }
97 97
         $dimensions = "&dimensions=ga:country&sort=-ga:pageviews&max-results=5";
98 98
     }
99 99
 
100 100
 
101 101
     $APIURL = "https://www.googleapis.com/analytics/v3/data/ga?";
102
-    $ids = "ids=".$id;
103
-    if(!$start_date){$start_date = "&start-date=".$ga_start;}
104
-    if(!$end_date){$end_date = "&end-date=".$ga_end;}
102
+    $ids = "ids=" . $id;
103
+    if (!$start_date) {$start_date = "&start-date=" . $ga_start; }
104
+    if (!$end_date) {$end_date = "&end-date=" . $ga_end; }
105 105
     $metrics = "&metrics=ga:pageviews";
106
-    $filters = "&filters=ga:pagePath==".$page;
107
-    $access_token = "&access_token=".$at;
106
+    $filters = "&filters=ga:pagePath==" . $page;
107
+    $access_token = "&access_token=" . $at;
108 108
 
109
-    $use_url = $APIURL.$ids.$start_date.$end_date.$dimensions.$metrics.$filters.$access_token;
109
+    $use_url = $APIURL . $ids . $start_date . $end_date . $dimensions . $metrics . $filters . $access_token;
110 110
 
111
-    if(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='realtime'){
111
+    if (isset($_REQUEST['ga_type']) && $_REQUEST['ga_type'] == 'realtime') {
112 112
         $metrics = "&metrics=rt:activeUsers";
113
-        $dimensions = "&filters=ga:pagePath==".$page;
113
+        $dimensions = "&filters=ga:pagePath==" . $page;
114 114
 
115
-        $use_url = "https://www.googleapis.com/analytics/v3/data/realtime?".$ids.$access_token.$metrics.$dimensions;
115
+        $use_url = "https://www.googleapis.com/analytics/v3/data/realtime?" . $ids . $access_token . $metrics . $dimensions;
116 116
     }
117 117
 
118
-    $response =  wp_remote_get($use_url,array('timeout' => 15));
118
+    $response = wp_remote_get($use_url, array('timeout' => 15));
119 119
 
120 120
     // Make countries translatable
121
-    if(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='country'){
121
+    if (isset($_REQUEST['ga_type']) && $_REQUEST['ga_type'] == 'country') {
122 122
         $c_arr = json_decode($response['body']);
123
-        if(is_array($c_arr->rows)){
123
+        if (is_array($c_arr->rows)) {
124 124
             $new_rows = array();
125
-            foreach($c_arr->rows as $wow){
126
-                $new_rows[] = array(__($wow[0],'geodirectory'),$wow[1]);
125
+            foreach ($c_arr->rows as $wow) {
126
+                $new_rows[] = array(__($wow[0], 'geodirectory'), $wow[1]);
127 127
             }
128 128
             $c_arr->rows = $new_rows;
129 129
         }
@@ -136,39 +136,39 @@  discard block
 block discarded – undo
136 136
 }// end GA function
137 137
 
138 138
 
139
-function geodir_ga_get_token(){
139
+function geodir_ga_get_token() {
140 140
     $at = get_option('gd_ga_access_token');
141
-    $use_url = "https://www.googleapis.com/oauth2/v1/tokeninfo?access_token=".$at;
142
-    $response =  wp_remote_get($use_url,array('timeout' => 15));
141
+    $use_url = "https://www.googleapis.com/oauth2/v1/tokeninfo?access_token=" . $at;
142
+    $response = wp_remote_get($use_url, array('timeout' => 15));
143 143
 
144
-    if(!empty($response['response']['code']) && $response['response']['code']==200) {//access token is valid
144
+    if (!empty($response['response']['code']) && $response['response']['code'] == 200) {//access token is valid
145 145
 
146 146
     return $at;
147
-    }else{//else get new access token
147
+    } else {//else get new access token
148 148
 
149 149
         $refresh_at = get_option('gd_ga_refresh_token');
150
-        if(!$refresh_at){
151
-            echo json_encode(array('error'=>__('Not authorized, please click authorized in GD > Google analytic settings.', 'geodirectory')));exit;
150
+        if (!$refresh_at) {
151
+            echo json_encode(array('error'=>__('Not authorized, please click authorized in GD > Google analytic settings.', 'geodirectory'))); exit;
152 152
         }
153 153
 
154 154
         $rat_url = "https://www.googleapis.com/oauth2/v3/token?";
155
-        $client_id = "client_id=".get_option('geodir_ga_client_id');
156
-        $client_secret = "&client_secret=".get_option('geodir_ga_client_secret');
157
-        $refresh_token = "&refresh_token=".$refresh_at;
155
+        $client_id = "client_id=" . get_option('geodir_ga_client_id');
156
+        $client_secret = "&client_secret=" . get_option('geodir_ga_client_secret');
157
+        $refresh_token = "&refresh_token=" . $refresh_at;
158 158
         $grant_type = "&grant_type=refresh_token";
159 159
 
160
-        $rat_url_use = $rat_url.$client_id.$client_secret.$refresh_token.$grant_type;
160
+        $rat_url_use = $rat_url . $client_id . $client_secret . $refresh_token . $grant_type;
161 161
 
162
-        $rat_response =  wp_remote_post($rat_url_use,array('timeout' => 15));
163
-        if(!empty($rat_response['response']['code']) && $rat_response['response']['code']==200) {
162
+        $rat_response = wp_remote_post($rat_url_use, array('timeout' => 15));
163
+        if (!empty($rat_response['response']['code']) && $rat_response['response']['code'] == 200) {
164 164
             $parts = json_decode($rat_response['body']);
165 165
 
166 166
 
167 167
             update_option('gd_ga_access_token', $parts->access_token);
168 168
             return $parts->access_token;
169 169
 
170
-        }else{
171
-            echo json_encode(array('error'=>__('Login failed', 'geodirectory')));exit;
170
+        } else {
171
+            echo json_encode(array('error'=>__('Login failed', 'geodirectory'))); exit;
172 172
         }
173 173
 
174 174
 
Please login to merge, or discard this patch.
Braces   +6 added lines, -9 removed lines patch added patch discarded remove patch
@@ -76,22 +76,19 @@  discard block
 block discarded – undo
76 76
         if(!$ga_start){$ga_start = date('Y-m-d', strtotime("-6 day"));}
77 77
         if(!$ga_end){$ga_end = date('Y-m-d');}
78 78
         $dimensions = "&dimensions=ga:date,ga:nthDay";
79
-    }elseif(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='lastweek'){
79
+    } elseif(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='lastweek'){
80 80
         if(!$ga_start){$ga_start = date('Y-m-d', strtotime("-13 day"));}
81 81
         if(!$ga_end){$ga_end = date('Y-m-d', strtotime("-7 day"));}
82 82
         $dimensions = "&dimensions=ga:date,ga:nthDay";
83
-    }
84
-    elseif(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='thisyear'){
83
+    } elseif(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='thisyear'){
85 84
         if(!$ga_start){$ga_start = date('Y')."-01-01";}
86 85
         if(!$ga_end){$ga_end = date('Y-m-d');}
87 86
         $dimensions = "&dimensions=ga:month,ga:nthMonth";
88
-    }
89
-    elseif(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='lastyear'){
87
+    } elseif(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='lastyear'){
90 88
         if(!$ga_start){$ga_start = date('Y', strtotime("-1 year"))."-01-01";}
91 89
         if(!$ga_end){$ga_end = date('Y', strtotime("-1 year"))."-12-31";}
92 90
         $dimensions = "&dimensions=ga:month,ga:nthMonth";
93
-    }
94
-    elseif(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='country'){
91
+    } elseif(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='country'){
95 92
         if(!$ga_start){$ga_start = "14daysAgo";}
96 93
         if(!$ga_end){$ga_end = "yesterday";}
97 94
         $dimensions = "&dimensions=ga:country&sort=-ga:pageviews&max-results=5";
@@ -144,7 +141,7 @@  discard block
 block discarded – undo
144 141
     if(!empty($response['response']['code']) && $response['response']['code']==200) {//access token is valid
145 142
 
146 143
     return $at;
147
-    }else{//else get new access token
144
+    } else{//else get new access token
148 145
 
149 146
         $refresh_at = get_option('gd_ga_refresh_token');
150 147
         if(!$refresh_at){
@@ -167,7 +164,7 @@  discard block
 block discarded – undo
167 164
             update_option('gd_ga_access_token', $parts->access_token);
168 165
             return $parts->access_token;
169 166
 
170
-        }else{
167
+        } else{
171 168
             echo json_encode(array('error'=>__('Login failed', 'geodirectory')));exit;
172 169
         }
173 170
 
Please login to merge, or discard this patch.
geodirectory-functions/helper_functions.php 3 patches
Indentation   +85 added lines, -85 removed lines patch added patch discarded remove patch
@@ -286,42 +286,42 @@  discard block
 block discarded – undo
286 286
  * @return array Parsed url and title.
287 287
  */
288 288
 function geodir_parse_custom_field_url($url, $formatted = true) {
289
-	if ($url == '' || !is_string($url)) {
290
-		return NULL;
291
-	}
292
-	$original_url = $url;
289
+    if ($url == '' || !is_string($url)) {
290
+        return NULL;
291
+    }
292
+    $original_url = $url;
293 293
 	
294
-	$url = stripcslashes($url);
295
-	$parts = explode('|', $url, 2);
294
+    $url = stripcslashes($url);
295
+    $parts = explode('|', $url, 2);
296 296
 	
297
-	$url = trim($parts[0]);
298
-	if ($formatted && $url != '') {
299
-		$url = str_replace( ' ', '%20', $url );
300
-		$url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%@$\|*\'()\[\]\\x80-\\xff]|i', '', $url);
297
+    $url = trim($parts[0]);
298
+    if ($formatted && $url != '') {
299
+        $url = str_replace( ' ', '%20', $url );
300
+        $url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%@$\|*\'()\[\]\\x80-\\xff]|i', '', $url);
301 301
 		
302
-		if (0 !== stripos($url, 'mailto:')) {
303
-			$strip = array('%0d', '%0a', '%0D', '%0A');
304
-			$url = _deep_replace($strip, $url);
305
-		}
302
+        if (0 !== stripos($url, 'mailto:')) {
303
+            $strip = array('%0d', '%0a', '%0D', '%0A');
304
+            $url = _deep_replace($strip, $url);
305
+        }
306 306
 		
307
-		$url = str_replace(';//', '://', $url);
307
+        $url = str_replace(';//', '://', $url);
308 308
 		
309
-		if (strpos($url, ':') === false && ! in_array($url[0], array('/', '#', '?')) && !preg_match('/^[a-z0-9-]+?\.php/i', $url)) {
310
-			$url = 'http://' . $url;
311
-		}
309
+        if (strpos($url, ':') === false && ! in_array($url[0], array('/', '#', '?')) && !preg_match('/^[a-z0-9-]+?\.php/i', $url)) {
310
+            $url = 'http://' . $url;
311
+        }
312 312
 		
313
-		$url = wp_kses_normalize_entities($url);
314
-		$url = str_replace('&amp;', '&#038;', $url);
315
-		$url = str_replace("'", '&#039;', $url);
316
-	}
313
+        $url = wp_kses_normalize_entities($url);
314
+        $url = str_replace('&amp;', '&#038;', $url);
315
+        $url = str_replace("'", '&#039;', $url);
316
+    }
317 317
 	
318
-	$return = array();
319
-	$return['url'] = $url;
320
-	if (!empty($parts[1]) && trim($parts[1]) != '') {
321
-		$return['label'] = trim($parts[1]);
322
-	}
318
+    $return = array();
319
+    $return['url'] = $url;
320
+    if (!empty($parts[1]) && trim($parts[1]) != '') {
321
+        $return['label'] = trim($parts[1]);
322
+    }
323 323
 
324
-	return $return;
324
+    return $return;
325 325
 }
326 326
 
327 327
 /**
@@ -334,24 +334,24 @@  discard block
 block discarded – undo
334 334
  * @return array Modified listing request info.
335 335
  */
336 336
 function geodir_attach_parent_categories($request_info) {
337
-	if (!empty($request_info['post_category']) && is_array($request_info['post_category'])) {
338
-		foreach ($request_info['post_category'] as $taxomony => $term_ids) {			
339
-			$attach_term_ids = array();
337
+    if (!empty($request_info['post_category']) && is_array($request_info['post_category'])) {
338
+        foreach ($request_info['post_category'] as $taxomony => $term_ids) {			
339
+            $attach_term_ids = array();
340 340
 			
341
-			if (!empty($term_ids) && is_array($term_ids) && taxonomy_exists($taxomony) && strpos($taxomony, 'category') !== false) {
342
-				$attach_term_ids = geodir_add_parent_terms($term_ids, $taxomony);
341
+            if (!empty($term_ids) && is_array($term_ids) && taxonomy_exists($taxomony) && strpos($taxomony, 'category') !== false) {
342
+                $attach_term_ids = geodir_add_parent_terms($term_ids, $taxomony);
343 343
 				
344
-				if (!empty($attach_term_ids)) {
345
-					if (!isset($request_info['post_default_category'])) {
346
-						$request_info['post_default_category'] = $attach_term_ids[0];
347
-					}
348
-					$request_info['post_category'][$taxomony] = $attach_term_ids;
349
-				}
350
-			}
351
-		}
352
-	}
344
+                if (!empty($attach_term_ids)) {
345
+                    if (!isset($request_info['post_default_category'])) {
346
+                        $request_info['post_default_category'] = $attach_term_ids[0];
347
+                    }
348
+                    $request_info['post_category'][$taxomony] = $attach_term_ids;
349
+                }
350
+            }
351
+        }
352
+    }
353 353
 	
354
-	return $request_info;
354
+    return $request_info;
355 355
 }
356 356
 
357 357
 /**
@@ -365,22 +365,22 @@  discard block
 block discarded – undo
365 365
  * @return array Modified term ids.
366 366
  */
367 367
 function geodir_add_parent_terms($term_ids, $taxomony) {	
368
-	if (is_int($term_ids)) {
369
-		$term_ids = array($term_ids);
370
-	}
368
+    if (is_int($term_ids)) {
369
+        $term_ids = array($term_ids);
370
+    }
371 371
 	
372
-	$parent_terms = array();
372
+    $parent_terms = array();
373 373
 	
374
-	foreach ($term_ids as $term_id) {
375
-		$parent_terms[] = $term_id;
376
-		$term_parents = geodir_get_category_parents($term_id, $taxomony, $parent_terms);
374
+    foreach ($term_ids as $term_id) {
375
+        $parent_terms[] = $term_id;
376
+        $term_parents = geodir_get_category_parents($term_id, $taxomony, $parent_terms);
377 377
 		
378
-		if (!empty($term_parents)) {
379
-			$parent_terms = array_merge($parent_terms, $term_parents);
380
-		}
381
-	}
378
+        if (!empty($term_parents)) {
379
+            $parent_terms = array_merge($parent_terms, $term_parents);
380
+        }
381
+    }
382 382
 
383
-	return $parent_terms;
383
+    return $parent_terms;
384 384
 }
385 385
 
386 386
 /**
@@ -396,18 +396,18 @@  discard block
 block discarded – undo
396 396
  * @return array Category ids.
397 397
  */
398 398
 function geodir_get_category_parents($id, $taxomony, $visited = array(), $parents = array()) {
399
-	$parent = get_term($id, $taxomony);
400
-	if (is_wp_error($parent)) {
401
-		return $parents;
402
-	}
403
-
404
-	if ($parent->parent && ($parent->parent != $parent->term_id) && !in_array($parent->parent, $visited)) {
405
-		$visited[] = $parent->parent;
406
-		$parents[] = $parent->parent;
407
-		$parents = geodir_get_category_parents($parent->parent, $taxomony, $visited, $parents);
408
-	}
409
-
410
-	return $parents;
399
+    $parent = get_term($id, $taxomony);
400
+    if (is_wp_error($parent)) {
401
+        return $parents;
402
+    }
403
+
404
+    if ($parent->parent && ($parent->parent != $parent->term_id) && !in_array($parent->parent, $visited)) {
405
+        $visited[] = $parent->parent;
406
+        $parents[] = $parent->parent;
407
+        $parents = geodir_get_category_parents($parent->parent, $taxomony, $visited, $parents);
408
+    }
409
+
410
+    return $parents;
411 411
 }
412 412
 
413 413
 if (!function_exists('geodir_get_ip')) {
@@ -420,24 +420,24 @@  discard block
 block discarded – undo
420 420
  * @return string The IP address.
421 421
  */
422 422
 function geodir_get_ip() {
423
-	if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
424
-		//check ip from share internet
425
-		$ip = $_SERVER['HTTP_CLIENT_IP'];
426
-	} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
427
-		//to check ip is pass from proxy
428
-		$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
429
-	} else {
430
-		$ip = $_SERVER['REMOTE_ADDR'];
431
-	}
423
+    if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
424
+        //check ip from share internet
425
+        $ip = $_SERVER['HTTP_CLIENT_IP'];
426
+    } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
427
+        //to check ip is pass from proxy
428
+        $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
429
+    } else {
430
+        $ip = $_SERVER['REMOTE_ADDR'];
431
+    }
432 432
 	
433
-	/**
434
-	 * Filter the the visitor's IP address.
435
-	 *
436
-	 * @since 1.5.7
437
-	 * @package GeoDirectory
438
-	 *
439
-	 * @param string $ip The IP address.
440
-	 */
441
-	return apply_filters('geodir_get_ip', $ip);
433
+    /**
434
+     * Filter the the visitor's IP address.
435
+     *
436
+     * @since 1.5.7
437
+     * @package GeoDirectory
438
+     *
439
+     * @param string $ip The IP address.
440
+     */
441
+    return apply_filters('geodir_get_ip', $ip);
442 442
 }
443 443
 }
444 444
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -13,11 +13,11 @@  discard block
 block discarded – undo
13 13
  * @since 1.4.6
14 14
  * @return int|null Return the page ID if present or null if not.
15 15
  */
16
-function geodir_add_listing_page_id(){
16
+function geodir_add_listing_page_id() {
17 17
     $gd_page_id = get_option('geodir_add_listing_page');
18 18
 
19 19
     if (function_exists('icl_object_id')) {
20
-        $gd_page_id =  icl_object_id($gd_page_id, 'page', true);
20
+        $gd_page_id = icl_object_id($gd_page_id, 'page', true);
21 21
     }
22 22
 
23 23
     return $gd_page_id;
@@ -30,11 +30,11 @@  discard block
 block discarded – undo
30 30
  * @since 1.4.6
31 31
  * @return int|null Return the page ID if present or null if not.
32 32
  */
33
-function geodir_preview_page_id(){
33
+function geodir_preview_page_id() {
34 34
     $gd_page_id = get_option('geodir_preview_page');
35 35
 
36 36
     if (function_exists('icl_object_id')) {
37
-        $gd_page_id =  icl_object_id($gd_page_id, 'page', true);
37
+        $gd_page_id = icl_object_id($gd_page_id, 'page', true);
38 38
     }
39 39
 
40 40
     return $gd_page_id;
@@ -47,11 +47,11 @@  discard block
 block discarded – undo
47 47
  * @since 1.4.6
48 48
  * @return int|null Return the page ID if present or null if not.
49 49
  */
50
-function geodir_success_page_id(){
50
+function geodir_success_page_id() {
51 51
     $gd_page_id = get_option('geodir_success_page');
52 52
 
53 53
     if (function_exists('icl_object_id')) {
54
-        $gd_page_id =  icl_object_id($gd_page_id, 'page', true);
54
+        $gd_page_id = icl_object_id($gd_page_id, 'page', true);
55 55
     }
56 56
 
57 57
     return $gd_page_id;
@@ -64,11 +64,11 @@  discard block
 block discarded – undo
64 64
  * @since 1.4.6
65 65
  * @return int|null Return the page ID if present or null if not.
66 66
  */
67
-function geodir_location_page_id(){
67
+function geodir_location_page_id() {
68 68
     $gd_page_id = get_option('geodir_location_page');
69 69
 
70 70
     if (function_exists('icl_object_id')) {
71
-        $gd_page_id =  icl_object_id($gd_page_id, 'page', true);
71
+        $gd_page_id = icl_object_id($gd_page_id, 'page', true);
72 72
     }
73 73
 
74 74
     return $gd_page_id;
@@ -81,11 +81,11 @@  discard block
 block discarded – undo
81 81
  * @since 1.5.4
82 82
  * @return int|null Return the page ID if present or null if not.
83 83
  */
84
-function geodir_home_page_id(){
84
+function geodir_home_page_id() {
85 85
     $gd_page_id = get_option('geodir_home_page');
86 86
 
87 87
     if (function_exists('icl_object_id')) {
88
-        $gd_page_id =  icl_object_id($gd_page_id, 'page', true);
88
+        $gd_page_id = icl_object_id($gd_page_id, 'page', true);
89 89
     }
90 90
 
91 91
     return $gd_page_id;
@@ -98,11 +98,11 @@  discard block
 block discarded – undo
98 98
  * @since 1.5.3
99 99
  * @return int|null Return the page ID if present or null if not.
100 100
  */
101
-function geodir_info_page_id(){
101
+function geodir_info_page_id() {
102 102
     $gd_page_id = get_option('geodir_info_page');
103 103
 
104 104
     if (function_exists('icl_object_id')) {
105
-        $gd_page_id =  icl_object_id($gd_page_id, 'page', true);
105
+        $gd_page_id = icl_object_id($gd_page_id, 'page', true);
106 106
     }
107 107
 
108 108
     return $gd_page_id;
@@ -115,11 +115,11 @@  discard block
 block discarded – undo
115 115
  * @since 1.5.3
116 116
  * @return int|null Return the page ID if present or null if not.
117 117
  */
118
-function geodir_login_page_id(){
118
+function geodir_login_page_id() {
119 119
     $gd_page_id = get_option('geodir_login_page');
120 120
 
121 121
     if (function_exists('icl_object_id')) {
122
-        $gd_page_id =  icl_object_id($gd_page_id, 'page', true);
122
+        $gd_page_id = icl_object_id($gd_page_id, 'page', true);
123 123
     }
124 124
 
125 125
     return $gd_page_id;
@@ -133,11 +133,11 @@  discard block
 block discarded – undo
133 133
  * @since 1.5.3
134 134
  * @return int|null Return the page ID if present or null if not.
135 135
  */
136
-function geodir_login_url($args=array()){
136
+function geodir_login_url($args = array()) {
137 137
     $gd_page_id = get_option('geodir_login_page');
138 138
 
139 139
     if (function_exists('icl_object_id')) {
140
-        $gd_page_id =  icl_object_id($gd_page_id, 'page', true);
140
+        $gd_page_id = icl_object_id($gd_page_id, 'page', true);
141 141
     }
142 142
 
143 143
     if (function_exists('geodir_location_geo_home_link')) {
@@ -148,17 +148,17 @@  discard block
 block discarded – undo
148 148
         add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2);
149 149
     }
150 150
 
151
-    if($gd_page_id){
151
+    if ($gd_page_id) {
152 152
         $post = get_post($gd_page_id);
153 153
         $slug = $post->post_name;
154 154
         //$login_url = get_permalink($gd_page_id );// get_permalink can only be user after theme-Setup hook, any earlier and it errors
155
-        $login_url = trailingslashit($home_url)."$slug/";
156
-    }else{
157
-        $login_url = trailingslashit($home_url)."?geodir_signup=true";
155
+        $login_url = trailingslashit($home_url) . "$slug/";
156
+    } else {
157
+        $login_url = trailingslashit($home_url) . "?geodir_signup=true";
158 158
     }
159 159
 
160
-    if($args){
161
-        $login_url = add_query_arg($args,$login_url );
160
+    if ($args) {
161
+        $login_url = add_query_arg($args, $login_url);
162 162
     }
163 163
 
164 164
     /**
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
      * @param array $args The array of query args used.
173 173
      * @param int $gd_page_id The page id of the GD login page.
174 174
      */
175
-    return apply_filters('geodir_login_url',$login_url,$args,$gd_page_id);
175
+    return apply_filters('geodir_login_url', $login_url, $args, $gd_page_id);
176 176
 }
177 177
 
178 178
 /**
@@ -182,11 +182,11 @@  discard block
 block discarded – undo
182 182
  * @since 1.5.4
183 183
  * @return string Info page url.
184 184
  */
185
-function geodir_info_url($args=array()){
185
+function geodir_info_url($args = array()) {
186 186
     $gd_page_id = get_option('geodir_info_page');
187 187
 
188 188
     if (function_exists('icl_object_id')) {
189
-        $gd_page_id =  icl_object_id($gd_page_id, 'page', true);
189
+        $gd_page_id = icl_object_id($gd_page_id, 'page', true);
190 190
     }
191 191
 
192 192
     if (function_exists('geodir_location_geo_home_link')) {
@@ -197,17 +197,17 @@  discard block
 block discarded – undo
197 197
         add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2);
198 198
     }
199 199
 
200
-    if($gd_page_id){
200
+    if ($gd_page_id) {
201 201
         $post = get_post($gd_page_id);
202 202
         $slug = $post->post_name;
203 203
         //$login_url = get_permalink($gd_page_id );// get_permalink can only be user after theme-Setup hook, any earlier and it errors
204
-        $info_url = trailingslashit($home_url)."$slug/";
205
-    }else{
204
+        $info_url = trailingslashit($home_url) . "$slug/";
205
+    } else {
206 206
         $info_url = trailingslashit($home_url);
207 207
     }
208 208
 
209
-    if($args){
210
-        $info_url = add_query_arg($args,$info_url );
209
+    if ($args) {
210
+        $info_url = add_query_arg($args, $info_url);
211 211
     }
212 212
 
213 213
     return $info_url;
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
  * @param string $charset Character set to use for conversion.
226 226
  * @return string Returns converted string.
227 227
  */
228
-function geodir_ucwords($string, $charset='UTF-8') {
228
+function geodir_ucwords($string, $charset = 'UTF-8') {
229 229
     if (function_exists('mb_convert_case')) {
230 230
         return mb_convert_case($string, MB_CASE_TITLE, $charset);
231 231
     } else {
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
  * @param string $charset Character set to use for conversion.
246 246
  * @return string Returns converted string.
247 247
  */
248
-function geodir_strtolower($string, $charset='UTF-8') {
248
+function geodir_strtolower($string, $charset = 'UTF-8') {
249 249
     if (function_exists('mb_convert_case')) {
250 250
         return mb_convert_case($string, MB_CASE_LOWER, $charset);
251 251
     } else {
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
  * @param string $charset Character set to use for conversion.
266 266
  * @return string Returns converted string.
267 267
  */
268
-function geodir_strtoupper($string, $charset='UTF-8') {
268
+function geodir_strtoupper($string, $charset = 'UTF-8') {
269 269
     if (function_exists('mb_convert_case')) {
270 270
         return mb_convert_case($string, MB_CASE_UPPER, $charset);
271 271
     } else {
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
 	
297 297
 	$url = trim($parts[0]);
298 298
 	if ($formatted && $url != '') {
299
-		$url = str_replace( ' ', '%20', $url );
299
+		$url = str_replace(' ', '%20', $url);
300 300
 		$url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%@$\|*\'()\[\]\\x80-\\xff]|i', '', $url);
301 301
 		
302 302
 		if (0 !== stripos($url, 'mailto:')) {
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
 		
307 307
 		$url = str_replace(';//', '://', $url);
308 308
 		
309
-		if (strpos($url, ':') === false && ! in_array($url[0], array('/', '#', '?')) && !preg_match('/^[a-z0-9-]+?\.php/i', $url)) {
309
+		if (strpos($url, ':') === false && !in_array($url[0], array('/', '#', '?')) && !preg_match('/^[a-z0-9-]+?\.php/i', $url)) {
310 310
 			$url = 'http://' . $url;
311 311
 		}
312 312
 		
Please login to merge, or discard this patch.
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
         $slug = $post->post_name;
154 154
         //$login_url = get_permalink($gd_page_id );// get_permalink can only be user after theme-Setup hook, any earlier and it errors
155 155
         $login_url = trailingslashit($home_url)."$slug/";
156
-    }else{
156
+    } else{
157 157
         $login_url = trailingslashit($home_url)."?geodir_signup=true";
158 158
     }
159 159
 
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
         $slug = $post->post_name;
203 203
         //$login_url = get_permalink($gd_page_id );// get_permalink can only be user after theme-Setup hook, any earlier and it errors
204 204
         $info_url = trailingslashit($home_url)."$slug/";
205
-    }else{
205
+    } else{
206 206
         $info_url = trailingslashit($home_url);
207 207
     }
208 208
 
Please login to merge, or discard this patch.
geodirectory-functions/listing_filters.php 3 patches
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -99,15 +99,15 @@  discard block
 block discarded – undo
99 99
         } //  Distance
100 100
 
101 101
         if (isset($_REQUEST['sgeo_lat'])) {
102
-            $mylat = (float)esc_attr($_REQUEST['sgeo_lat']);
102
+            $mylat = (float) esc_attr($_REQUEST['sgeo_lat']);
103 103
         } else {
104
-            $mylat = (float)geodir_get_current_city_lat();
104
+            $mylat = (float) geodir_get_current_city_lat();
105 105
         } //  Latatude
106 106
 
107 107
         if (isset($_REQUEST['sgeo_lon'])) {
108
-            $mylon = (float)esc_attr($_REQUEST['sgeo_lon']);
108
+            $mylon = (float) esc_attr($_REQUEST['sgeo_lon']);
109 109
         } else {
110
-            $mylon = (float)geodir_get_current_city_lng();
110
+            $mylon = (float) geodir_get_current_city_lng();
111 111
         } //  Distance
112 112
 
113 113
         if (isset($_REQUEST['snear'])) {
@@ -250,9 +250,9 @@  discard block
 block discarded – undo
250 250
     if (is_search() && isset($_REQUEST['geodir_search']) && $s && trim($s) != '') {
251 251
         $keywords = explode(" ", $s);
252 252
 
253
-        if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
254
-            foreach($keywords as $kkey=>$kword){
255
-                if(mb_strlen($kword, 'UTF-8')<=$klimit){
253
+        if (is_array($keywords) && $klimit = get_option('geodir_search_word_limit')) {
254
+            foreach ($keywords as $kkey=>$kword) {
255
+                if (mb_strlen($kword, 'UTF-8') <= $klimit) {
256 256
                     unset($keywords[$kkey]);
257 257
                 }
258 258
             }
@@ -438,9 +438,9 @@  discard block
 block discarded – undo
438 438
 
439 439
     if (is_search() && isset($_REQUEST['geodir_search']) && $s && trim($s) != '') {
440 440
         $keywords = explode(" ", $s);
441
-        if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
442
-            foreach($keywords as $kkey=>$kword){
443
-                if(mb_strlen($kword, 'UTF-8')<=$klimit){
441
+        if (is_array($keywords) && $klimit = get_option('geodir_search_word_limit')) {
442
+            foreach ($keywords as $kkey=>$kword) {
443
+                if (mb_strlen($kword, 'UTF-8') <= $klimit) {
444 444
                     unset($keywords[$kkey]);
445 445
                 }
446 446
             }
@@ -509,7 +509,7 @@  discard block
 block discarded – undo
509 509
                 case 'post_date':
510 510
                 case 'comment_count':
511 511
 
512
-                    $orderby = "$wpdb->posts." . $sort_by . " " . $order . ", ".$table . ".overall_rating " . $order . ", ";
512
+                    $orderby = "$wpdb->posts." . $sort_by . " " . $order . ", " . $table . ".overall_rating " . $order . ", ";
513 513
                     break;
514 514
 
515 515
                 case 'distance':
@@ -572,7 +572,7 @@  discard block
 block discarded – undo
572 572
         }
573 573
 
574 574
         //if (!geodir_is_page('detail'))
575
-            add_filter('posts_where', 'geodir_default_where', 1);/**/
575
+            add_filter('posts_where', 'geodir_default_where', 1); /**/
576 576
 
577 577
         //add_filter( 'user_has_cap', 'geodir_preview_post_cap', 10, 3 );// let subscribers edit their own posts
578 578
 
@@ -736,9 +736,9 @@  discard block
 block discarded – undo
736 736
 
737 737
     if ($s != '') {
738 738
         $keywords = explode(" ", $s);
739
-        if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
740
-            foreach($keywords as $kkey=>$kword){
741
-                if(mb_strlen($kword, 'UTF-8')<=$klimit){
739
+        if (is_array($keywords) && $klimit = get_option('geodir_search_word_limit')) {
740
+            foreach ($keywords as $kkey=>$kword) {
741
+                if (mb_strlen($kword, 'UTF-8') <= $klimit) {
742 742
                     unset($keywords[$kkey]);
743 743
                 }
744 744
             }
@@ -757,10 +757,10 @@  discard block
 block discarded – undo
757 757
 
758 758
     /* get taxonomy */
759 759
     $taxonomies = geodir_get_taxonomies($post_types, true);
760
-    if($taxonomies) {
760
+    if ($taxonomies) {
761 761
         $taxonomies = implode("','", $taxonomies);
762 762
         $taxonomies = "'" . $taxonomies . "'";
763
-    }else{$taxonomies='';}
763
+    } else {$taxonomies = ''; }
764 764
 
765 765
     $content_where = $terms_where = '';
766 766
 	if ($s != '') {
@@ -771,7 +771,7 @@  discard block
 block discarded – undo
771 771
          * @package GeoDirectory
772 772
          * @param string $content_where The query values, default: `" OR ($wpdb->posts.post_content LIKE \"$s\" OR $wpdb->posts.post_content LIKE \"$s%\" OR $wpdb->posts.post_content LIKE \"% $s%\" OR $wpdb->posts.post_content LIKE \"%>$s%\" OR $wpdb->posts.post_content LIKE \"%\n$s%\") ") "`.
773 773
          */
774
-		$content_where = apply_filters("geodir_search_content_where"," OR ($wpdb->posts.post_content LIKE \"$s\" OR $wpdb->posts.post_content LIKE \"$s%\" OR $wpdb->posts.post_content LIKE \"% $s%\" OR $wpdb->posts.post_content LIKE \"%>$s%\" OR $wpdb->posts.post_content LIKE \"%\n$s%\") ");
774
+		$content_where = apply_filters("geodir_search_content_where", " OR ($wpdb->posts.post_content LIKE \"$s\" OR $wpdb->posts.post_content LIKE \"$s%\" OR $wpdb->posts.post_content LIKE \"% $s%\" OR $wpdb->posts.post_content LIKE \"%>$s%\" OR $wpdb->posts.post_content LIKE \"%\n$s%\") ");
775 775
         /**
776 776
          * Filter the search query term values.
777 777
          *
@@ -779,7 +779,7 @@  discard block
 block discarded – undo
779 779
          * @package GeoDirectory
780 780
          * @param string $terms_where The separator, default: `" AND ($wpdb->terms.name LIKE \"$s\" OR $wpdb->terms.name LIKE \"$s%\" OR $wpdb->terms.name LIKE \"% $s%\" OR $wpdb->terms.name IN ($s_A)) "`.
781 781
          */
782
-        $terms_where = apply_filters("geodir_search_terms_where"," AND ($wpdb->terms.name LIKE \"$s\" OR $wpdb->terms.name LIKE \"$s%\" OR $wpdb->terms.name LIKE \"% $s%\" OR $wpdb->terms.name IN ($s_A)) ");
782
+        $terms_where = apply_filters("geodir_search_terms_where", " AND ($wpdb->terms.name LIKE \"$s\" OR $wpdb->terms.name LIKE \"$s%\" OR $wpdb->terms.name LIKE \"% $s%\" OR $wpdb->terms.name IN ($s_A)) ");
783 783
 	}
784 784
 		
785 785
     if ($snear != '') {
@@ -836,11 +836,11 @@  discard block
 block discarded – undo
836 836
     }
837 837
 	
838 838
 	########### WPML ###########
839
-    if ( function_exists( 'icl_object_id' ) ) {       
839
+    if (function_exists('icl_object_id')) {       
840 840
 		$lang_code = ICL_LANGUAGE_CODE;
841 841
 		
842 842
 		if ($lang_code && $post_types) {
843
-            $where .= " AND icl_t.language_code = '".$lang_code."' AND icl_t.element_type IN('post_" . $post_types . "') ";
843
+            $where .= " AND icl_t.language_code = '" . $lang_code . "' AND icl_t.element_type IN('post_" . $post_types . "') ";
844 844
         }
845 845
     }
846 846
     ########### WPML ###########
@@ -869,7 +869,7 @@  discard block
 block discarded – undo
869 869
     //$user_id = get_current_user_id();
870 870
     $user_id = $curauth->ID;
871 871
     if (isset($_REQUEST['stype'])) {
872
-        $where = $wpdb->prepare(" AND $wpdb->posts.post_type IN (%s) ",$_REQUEST['stype']);
872
+        $where = $wpdb->prepare(" AND $wpdb->posts.post_type IN (%s) ", $_REQUEST['stype']);
873 873
     } else {
874 874
         $where = " AND $wpdb->posts.post_type IN ('gd_place') ";
875 875
     }
Please login to merge, or discard this patch.
Braces   +33 added lines, -21 removed lines patch added patch discarded remove patch
@@ -16,7 +16,9 @@  discard block
 block discarded – undo
16 16
  */
17 17
 function geodir_session_start()
18 18
 {
19
-    if (!session_id()) session_start();
19
+    if (!session_id()) {
20
+        session_start();
21
+    }
20 22
     global $geodir_add_location_url;
21 23
 
22 24
     $geodir_add_location_url = NULL;
@@ -86,7 +88,9 @@  discard block
 block discarded – undo
86 88
 
87 89
     if ((is_search() && isset($_REQUEST['geodir_search']) && $_REQUEST['geodir_search'] != '')):
88 90
 
89
-        if (isset($_REQUEST['scat']) && $_REQUEST['scat'] == 'all') $_REQUEST['scat'] = '';
91
+        if (isset($_REQUEST['scat']) && $_REQUEST['scat'] == 'all') {
92
+            $_REQUEST['scat'] = '';
93
+        }
90 94
         //if(isset($_REQUEST['s']) && $_REQUEST['s'] == '+') $_REQUEST['s'] = '';
91 95
 
92 96
         if (isset($_REQUEST['sdist'])) {
@@ -198,8 +202,9 @@  discard block
 block discarded – undo
198 202
         add_filter('posts_fields', 'geodir_posts_fields', 1);
199 203
         add_filter('posts_join', 'geodir_posts_join', 1);
200 204
         geodir_post_where();
201
-        if (!is_admin())
202
-            add_filter('posts_orderby', 'geodir_posts_orderby', 1);
205
+        if (!is_admin()) {
206
+                    add_filter('posts_orderby', 'geodir_posts_orderby', 1);
207
+        }
203 208
 
204 209
         // advanced filter for popular post view widget
205 210
         global $wp_query;
@@ -346,8 +351,9 @@  discard block
 block discarded – undo
346 351
     $sort_by = '';
347 352
     $orderby = ' ';
348 353
 
349
-    if (get_query_var('order_by'))
350
-        $sort_by = get_query_var('order_by');
354
+    if (get_query_var('order_by')) {
355
+            $sort_by = get_query_var('order_by');
356
+    }
351 357
 
352 358
     /*if(isset($wp_query->tax_query->queries) && $wp_query->tax_query->queries){
353 359
         $current_term = $wp_query->get_queried_object();
@@ -367,14 +373,16 @@  discard block
 block discarded – undo
367 373
         $orderby .= " distance,";
368 374
     }
369 375
 
370
-    if (isset($_REQUEST['sort_by']) && $_REQUEST['sort_by'] != '' && is_main_query())
371
-        $sort_by = esc_attr($_REQUEST['sort_by']);
376
+    if (isset($_REQUEST['sort_by']) && $_REQUEST['sort_by'] != '' && is_main_query()) {
377
+            $sort_by = esc_attr($_REQUEST['sort_by']);
378
+    }
372 379
 
373 380
 
374 381
     if ($sort_by == '') {
375 382
         $default_sort = geodir_get_posts_default_sort($geodir_post_type);
376
-        if (!empty($default_sort))
377
-            $sort_by = $default_sort;
383
+        if (!empty($default_sort)) {
384
+                    $sort_by = $default_sort;
385
+        }
378 386
     }
379 387
 
380 388
     /*
@@ -560,8 +568,9 @@  discard block
 block discarded – undo
560 568
 
561 569
             add_filter('posts_where', 'searching_filter_where', 1);
562 570
 
563
-            if ($snear != '')
564
-                add_filter('posts_where', 'searching_filter_where', 1);
571
+            if ($snear != '') {
572
+                            add_filter('posts_where', 'searching_filter_where', 1);
573
+            }
565 574
 
566 575
             add_filter('posts_orderby', 'geodir_posts_orderby', 1);
567 576
 
@@ -729,10 +738,11 @@  discard block
 block discarded – undo
729 738
     }
730 739
 
731 740
     $better_search_terms = '';
732
-    if (isset($_REQUEST['stype']))
733
-        $post_types = esc_attr(wp_strip_all_tags($_REQUEST['stype']));
734
-    else
735
-        $post_types = 'gd_place';
741
+    if (isset($_REQUEST['stype'])) {
742
+            $post_types = esc_attr(wp_strip_all_tags($_REQUEST['stype']));
743
+    } else {
744
+            $post_types = 'gd_place';
745
+    }
736 746
 
737 747
     if ($s != '') {
738 748
         $keywords = explode(" ", $s);
@@ -760,7 +770,7 @@  discard block
 block discarded – undo
760 770
     if($taxonomies) {
761 771
         $taxonomies = implode("','", $taxonomies);
762 772
         $taxonomies = "'" . $taxonomies . "'";
763
-    }else{$taxonomies='';}
773
+    } else{$taxonomies='';}
764 774
 
765 775
     $content_where = $terms_where = '';
766 776
 	if ($s != '') {
@@ -875,11 +885,13 @@  discard block
 block discarded – undo
875 885
     }
876 886
 
877 887
     if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
878
-        if ($user_fav_posts = get_user_meta($user_id, 'gd_user_favourite_post', true))
879
-            $user_fav_posts = implode("','", $user_fav_posts);
888
+        if ($user_fav_posts = get_user_meta($user_id, 'gd_user_favourite_post', true)) {
889
+                    $user_fav_posts = implode("','", $user_fav_posts);
890
+        }
880 891
         $where .= " AND $wpdb->posts.ID IN ('$user_fav_posts')  ";
881
-    } else
882
-        $where .= " AND $wpdb->posts.post_author = $user_id ";
892
+    } else {
893
+            $where .= " AND $wpdb->posts.post_author = $user_id ";
894
+    }
883 895
 
884 896
     $where .= " AND $wpdb->posts.post_status IN ('publish','draft','pending') ";
885 897
 
Please login to merge, or discard this patch.
Indentation   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Contains all function for filtering listing.
4
- *
5
- * @since 1.0.0
6
- * @package GeoDirectory
7
- */
3
+     * Contains all function for filtering listing.
4
+     *
5
+     * @since 1.0.0
6
+     * @package GeoDirectory
7
+     */
8 8
  
9 9
 /**
10 10
  * Starts session if not started.
@@ -235,10 +235,10 @@  discard block
 block discarded – undo
235 235
     // Filter-Location-Manager to add location table.
236 236
     $fields .= ", " . $table . ".* ";
237 237
     
238
-	if ($snear != '' || $gd_session->get('all_near_me')) {
238
+    if ($snear != '' || $gd_session->get('all_near_me')) {
239 239
         $DistanceRadius = geodir_getDistanceRadius(get_option('geodir_search_dist_1'));
240 240
         
241
-		if ($gd_session->get('all_near_me')) {
241
+        if ($gd_session->get('all_near_me')) {
242 242
             $mylat = $gd_session->get('user_lat');
243 243
             $mylon = $gd_session->get('user_lon');
244 244
         }
@@ -270,13 +270,13 @@  discard block
 block discarded – undo
270 270
                 $count = 0;
271 271
                 foreach ($keywords as $keyword) {
272 272
                     $keyword = trim($keyword);
273
-					$count++;
273
+                    $count++;
274 274
                     if ($count < count($keywords)) {
275
-                       // $gd_titlematch_part .= $wpdb->posts . ".post_title LIKE '%%" . $keyword . "%%' " . $key . " ";
276
-						$gd_titlematch_part .= "( " . $wpdb->posts . ".post_title LIKE '" . $keyword . "' OR " . $wpdb->posts . ".post_title LIKE '" . $keyword . "%%' OR " . $wpdb->posts . ".post_title LIKE '%% " . $keyword . "%%' ) " . $key . " ";
275
+                        // $gd_titlematch_part .= $wpdb->posts . ".post_title LIKE '%%" . $keyword . "%%' " . $key . " ";
276
+                        $gd_titlematch_part .= "( " . $wpdb->posts . ".post_title LIKE '" . $keyword . "' OR " . $wpdb->posts . ".post_title LIKE '" . $keyword . "%%' OR " . $wpdb->posts . ".post_title LIKE '%% " . $keyword . "%%' ) " . $key . " ";
277 277
                     } else {
278 278
                         //$gd_titlematch_part .= $wpdb->posts . ".post_title LIKE '%%" . $keyword . "%%' ";
279
-						$gd_titlematch_part .= "( " . $wpdb->posts . ".post_title LIKE '" . $keyword . "' OR " . $wpdb->posts . ".post_title LIKE '" . $keyword . "%%' OR " . $wpdb->posts . ".post_title LIKE '%% " . $keyword . "%%' ) ";
279
+                        $gd_titlematch_part .= "( " . $wpdb->posts . ".post_title LIKE '" . $keyword . "' OR " . $wpdb->posts . ".post_title LIKE '" . $keyword . "%%' OR " . $wpdb->posts . ".post_title LIKE '%% " . $keyword . "%%' ) ";
280 280
                     }
281 281
                 }
282 282
                 $gd_titlematch_part .= "THEN 1 ELSE 0 END AS " . $part . ",";
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
             $gd_titlematch_part = "";
286 286
         }
287 287
         //$fields .= $wpdb->prepare(", CASE WHEN " . $table . ".is_featured='1' THEN 1 ELSE 0 END AS gd_featured, CASE WHEN " . $wpdb->posts . ".post_title=%s THEN 1 ELSE 0 END AS gd_exacttitle," . $gd_titlematch_part . " CASE WHEN " . $wpdb->posts . ".post_title LIKE %s THEN 1 ELSE 0 END AS gd_titlematch, CASE WHEN " . $wpdb->posts . ".post_content LIKE %s THEN 1 ELSE 0 END AS gd_content", array($s, '%' . $s . '%', '%' . $s . '%'));
288
-		$fields .= $wpdb->prepare(", CASE WHEN " . $table . ".is_featured='1' THEN 1 ELSE 0 END AS gd_featured, CASE WHEN " . $wpdb->posts . ".post_title LIKE %s THEN 1 ELSE 0 END AS gd_exacttitle," . $gd_titlematch_part . " CASE WHEN ( " . $wpdb->posts . ".post_title LIKE %s OR " . $wpdb->posts . ".post_title LIKE %s OR " . $wpdb->posts . ".post_title LIKE %s ) THEN 1 ELSE 0 END AS gd_titlematch, CASE WHEN ( " . $wpdb->posts . ".post_content LIKE %s OR " . $wpdb->posts . ".post_content LIKE %s OR " . $wpdb->posts . ".post_content LIKE %s OR " . $wpdb->posts . ".post_content LIKE %s ) THEN 1 ELSE 0 END AS gd_content", array($s, $s, $s . '%', '% ' . $s . '%', $s, $s . ' %', '% ' . $s . ' %', '% ' . $s));
288
+        $fields .= $wpdb->prepare(", CASE WHEN " . $table . ".is_featured='1' THEN 1 ELSE 0 END AS gd_featured, CASE WHEN " . $wpdb->posts . ".post_title LIKE %s THEN 1 ELSE 0 END AS gd_exacttitle," . $gd_titlematch_part . " CASE WHEN ( " . $wpdb->posts . ".post_title LIKE %s OR " . $wpdb->posts . ".post_title LIKE %s OR " . $wpdb->posts . ".post_title LIKE %s ) THEN 1 ELSE 0 END AS gd_titlematch, CASE WHEN ( " . $wpdb->posts . ".post_content LIKE %s OR " . $wpdb->posts . ".post_content LIKE %s OR " . $wpdb->posts . ".post_content LIKE %s OR " . $wpdb->posts . ".post_content LIKE %s ) THEN 1 ELSE 0 END AS gd_content", array($s, $s, $s . '%', '% ' . $s . '%', $s, $s . ' %', '% ' . $s . ' %', '% ' . $s));
289 289
     }
290 290
     return $fields;
291 291
 }
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
             break;
407 407
         case 'high_review':
408 408
         case 'rating_count_desc':
409
-			$orderby = $table . ".rating_count DESC, " . $table . ".overall_rating DESC, ";
409
+            $orderby = $table . ".rating_count DESC, " . $table . ".overall_rating DESC, ";
410 410
             break;
411 411
         case 'low_rating':
412 412
             $orderby = "( " . $table . ".overall_rating  ) ASC, " . $table . ".rating_count ASC,  ";
@@ -526,8 +526,8 @@  discard block
 block discarded – undo
526 526
 
527 527
                 default:
528 528
                     if (geodir_column_exist($table, $sort_by)) {
529
-						$orderby = $table . "." . $sort_by . " " . $order . ", ";
530
-					}
529
+                        $orderby = $table . "." . $sort_by . " " . $order . ", ";
530
+                    }
531 531
                     break;
532 532
 
533 533
             endswitch;
@@ -704,14 +704,14 @@  discard block
 block discarded – undo
704 704
     $category_search_range = '';
705 705
 
706 706
     if (is_single() && get_query_var('post_type')) {
707
-		return $where;
708
-	}
707
+        return $where;
708
+    }
709 709
 
710 710
     if (is_tax()) {
711
-		return $where;
712
-	}
711
+        return $where;
712
+    }
713 713
 	
714
-	$s = trim($s);
714
+    $s = trim($s);
715 715
 
716 716
     $where = '';
717 717
 
@@ -722,7 +722,7 @@  discard block
 block discarded – undo
722 722
         foreach ($s_SA as $s_term) {
723 723
             //$s_term = esc_attr($s_term);
724 724
             //$better_search[] = " OR $wpdb->posts.post_title LIKE\"%$s_term%\" ";
725
-			$better_search[] = " OR ( $wpdb->posts.post_title LIKE \"$s_term\" OR $wpdb->posts.post_title LIKE \"$s_term%\" OR $wpdb->posts.post_title LIKE \"% $s_term%\" ) ";
725
+            $better_search[] = " OR ( $wpdb->posts.post_title LIKE \"$s_term\" OR $wpdb->posts.post_title LIKE \"$s_term%\" OR $wpdb->posts.post_title LIKE \"% $s_term%\" ) ";
726 726
         }
727 727
     }
728 728
 
@@ -751,7 +751,7 @@  discard block
 block discarded – undo
751 751
                 $keyword = trim($keyword);
752 752
                 if ($keyword != '') {
753 753
                     //$better_search_terms .= ' OR ' . $wpdb->posts . '.post_title LIKE "%' . $adv_search_val . '%"';
754
-					$better_search_terms .= ' OR ( ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '" OR ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '%" OR ' . $wpdb->posts . '.post_title LIKE "% ' . $keyword . '%" )';
754
+                    $better_search_terms .= ' OR ( ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '" OR ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '%" OR ' . $wpdb->posts . '.post_title LIKE "% ' . $keyword . '%" )';
755 755
                 }
756 756
             }
757 757
         }
@@ -765,7 +765,7 @@  discard block
 block discarded – undo
765 765
     }else{$taxonomies='';}
766 766
 
767 767
     $content_where = $terms_where = '';
768
-	if ($s != '') {
768
+    if ($s != '') {
769 769
         /**
770 770
          * Filter the search query content where values.
771 771
          *
@@ -773,7 +773,7 @@  discard block
 block discarded – undo
773 773
          * @package GeoDirectory
774 774
          * @param string $content_where The query values, default: `" OR ($wpdb->posts.post_content LIKE \"$s\" OR $wpdb->posts.post_content LIKE \"$s%\" OR $wpdb->posts.post_content LIKE \"% $s%\" OR $wpdb->posts.post_content LIKE \"%>$s%\" OR $wpdb->posts.post_content LIKE \"%\n$s%\") ") "`.
775 775
          */
776
-		$content_where = apply_filters("geodir_search_content_where"," OR ($wpdb->posts.post_content LIKE \"$s\" OR $wpdb->posts.post_content LIKE \"$s%\" OR $wpdb->posts.post_content LIKE \"% $s%\" OR $wpdb->posts.post_content LIKE \"%>$s%\" OR $wpdb->posts.post_content LIKE \"%\n$s%\") ");
776
+        $content_where = apply_filters("geodir_search_content_where"," OR ($wpdb->posts.post_content LIKE \"$s\" OR $wpdb->posts.post_content LIKE \"$s%\" OR $wpdb->posts.post_content LIKE \"% $s%\" OR $wpdb->posts.post_content LIKE \"%>$s%\" OR $wpdb->posts.post_content LIKE \"%\n$s%\") ");
777 777
         /**
778 778
          * Filter the search query term values.
779 779
          *
@@ -782,7 +782,7 @@  discard block
 block discarded – undo
782 782
          * @param string $terms_where The separator, default: `" AND ($wpdb->terms.name LIKE \"$s\" OR $wpdb->terms.name LIKE \"$s%\" OR $wpdb->terms.name LIKE \"% $s%\" OR $wpdb->terms.name IN ($s_A)) "`.
783 783
          */
784 784
         $terms_where = apply_filters("geodir_search_terms_where"," AND ($wpdb->terms.name LIKE \"$s\" OR $wpdb->terms.name LIKE \"$s%\" OR $wpdb->terms.name LIKE \"% $s%\" OR $wpdb->terms.name IN ($s_A)) ");
785
-	}
785
+    }
786 786
 		
787 787
     if ($snear != '') {
788 788
         if (is_numeric($gd_session->get('near_me_range')) && !isset($_REQUEST['sdist'])) {
@@ -798,7 +798,7 @@  discard block
 block discarded – undo
798 798
         $rlat1 = is_numeric(min($lat1, $lat2)) ? min($lat1, $lat2) : '';
799 799
         $rlat2 = is_numeric(max($lat1, $lat2)) ? max($lat1, $lat2) : '';
800 800
 
801
-	    $where .= " AND ( ( $wpdb->posts.post_title LIKE \"$s\" $better_search_terms)
801
+        $where .= " AND ( ( $wpdb->posts.post_title LIKE \"$s\" $better_search_terms)
802 802
 			                    $content_where 
803 803
 								OR ($wpdb->posts.ID IN( 
804 804
 										SELECT $wpdb->term_relationships.object_id as post_id 
@@ -837,11 +837,11 @@  discard block
 block discarded – undo
837 837
 				AND ($wpdb->posts.post_status = 'publish') ";
838 838
     }
839 839
 	
840
-	########### WPML ###########
840
+    ########### WPML ###########
841 841
     if ( function_exists( 'icl_object_id' ) ) {       
842
-		$lang_code = ICL_LANGUAGE_CODE;
842
+        $lang_code = ICL_LANGUAGE_CODE;
843 843
 		
844
-		if ($lang_code && $post_types) {
844
+        if ($lang_code && $post_types) {
845 845
             $where .= " AND icl_t.language_code = '".$lang_code."' AND icl_t.element_type IN('post_" . $post_types . "') ";
846 846
         }
847 847
     }
Please login to merge, or discard this patch.