Passed
Pull Request — master (#204)
by Kiran
08:01
created
geodirectory-admin/option-pages/design_settings_array.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -579,7 +579,7 @@
 block discarded – undo
579 579
     ),
580 580
 	array(
581 581
 		'name' => __('Enable Font Awesome', 'geodirectory'),
582
-		'desc' => __('When enabled all rating images will be using font awesome rating icons as images.', 'geodirectory' ),
582
+		'desc' => __('When enabled all rating images will be using font awesome rating icons as images.', 'geodirectory'),
583 583
 		'id' => 'geodir_reviewrating_enable_font_awesome',
584 584
 		'type' => 'checkbox',
585 585
 		'std' => '0'
Please login to merge, or discard this patch.
geodirectory-functions/comments_functions.php 1 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/template_functions.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
                 $listing_page_id = $post->ID;
34 34
 				
35 35
 				$regex_pattern = get_shortcode_regex();
36
-				preg_match('/'.$regex_pattern.'/s', $post->post_content, $regex_matches);
36
+				preg_match('/' . $regex_pattern . '/s', $post->post_content, $regex_matches);
37 37
 				
38 38
 				if (!empty($regex_matches) && isset($regex_matches[2]) == 'gd_add_listing' && isset($regex_matches[3])) {
39 39
 					$shortcode_atts = shortcode_parse_atts($regex_matches[3]);
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
                 if (!empty($post_types))
56 56
                     $post_type = $post_types[0];
57 57
 					
58
-				if($sc_post_type != '' )
58
+				if ($sc_post_type != '')
59 59
 					$post_type = $sc_post_type;
60 60
 				
61 61
                 if ($is_wpml && !empty($wp->query_vars['page_id'])) {
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
      */
411 411
     do_action("geodir_get_template_part_{$slug}", $slug, $name);
412 412
     $templates = array();
413
-    $name = (string)$name;
413
+    $name = (string) $name;
414 414
     if ('' !== $name) {
415 415
         $template_name = "{$slug}-{$name}.php";
416 416
 
@@ -524,7 +524,7 @@  discard block
 block discarded – undo
524 524
 function geodir_convert_listing_view_class($columns = '') {
525 525
 	$class = '';
526 526
 	
527
-	switch ((int)$columns) {
527
+	switch ((int) $columns) {
528 528
 		case 1:
529 529
 			$class = '';
530 530
 		break;
@@ -589,7 +589,7 @@  discard block
 block discarded – undo
589 589
 		$html .= '<option value=""></option>';
590 590
 		if (!empty($star_texts) && is_array($star_texts)) {
591 591
 			foreach ($star_texts as $i => $text) {
592
-				$html .= '<option ' . selected((int)($i + 1), (int)$default, false) . ' value="' . (int)($i + 1) . '">' . $text . '</option>';
592
+				$html .= '<option ' . selected((int) ($i + 1), (int) $default, false) . ' value="' . (int) ($i + 1) . '">' . $text . '</option>';
593 593
 			}
594 594
 		} else {
595 595
 			$html .= '<option value="1">1</option>';
@@ -618,14 +618,14 @@  discard block
 block discarded – undo
618 618
 function geodir_font_awesome_rating_stars_html($html, $rating, $star_count = 5) {
619 619
 	if (get_option('geodir_reviewrating_enable_font_awesome') == '1') {
620 620
 		$rating = min($rating, $star_count);
621
-		$full_stars = floor( $rating );
622
-		$half_stars = ceil( $rating - $full_stars );
621
+		$full_stars = floor($rating);
622
+		$half_stars = ceil($rating - $full_stars);
623 623
 		$empty_stars = $star_count - $full_stars - $half_stars;
624 624
 		
625 625
 		$html = '<div class="gd-star-rating gd-fa-star-rating">';
626
-		$html .= str_repeat( '<i class="fa fa-star gd-full-star"></i>', $full_stars );
627
-		$html .= str_repeat( '<i class="fa fa-star-o fa-star-half-full gd-half-star"></i>', $half_stars );
628
-		$html .= str_repeat( '<i class="fa fa-star-o gd-empty-star"></i>', $empty_stars);
626
+		$html .= str_repeat('<i class="fa fa-star gd-full-star"></i>', $full_stars);
627
+		$html .= str_repeat('<i class="fa fa-star-o fa-star-half-full gd-half-star"></i>', $half_stars);
628
+		$html .= str_repeat('<i class="fa fa-star-o gd-empty-star"></i>', $empty_stars);
629 629
 		$html .= '</div>';
630 630
 	}
631 631
 
Please login to merge, or discard this patch.
geodirectory_hooks_actions.php 1 patch
Spacing   +76 added lines, -76 removed lines patch added patch discarded remove patch
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 /* ON TEMPLATE INCLUDE */
137 137
 /////////////////////////
138 138
 
139
-add_filter('template_include', 'geodir_template_loader',9);
139
+add_filter('template_include', 'geodir_template_loader', 9);
140 140
 
141 141
 /////////////////////////
142 142
 /* CATEGORY / TAXONOMY / CUSTOM POST ACTIONS */
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
 ////////////////////////
178 178
 
179 179
 add_action('geodir_update_postrating', 'geodir_term_review_count_force_update', 100);
180
-add_action('transition_post_status', 'geodir_term_review_count_force_update', 100,3);
180
+add_action('transition_post_status', 'geodir_term_review_count_force_update', 100, 3);
181 181
 add_action('created_term', 'geodir_term_review_count_force_update', 100);
182 182
 add_action('edited_term', 'geodir_term_review_count_force_update', 100);
183 183
 add_action('delete_term', 'geodir_term_review_count_force_update', 100);
@@ -319,8 +319,8 @@  discard block
 block discarded – undo
319 319
 
320 320
 /////// GEO DIRECOTORY CUSTOM HOOKS ///
321 321
 
322
-add_action('geodir_before_tab_content', 'geodir_before_tab_content');// this function is in custom_functions.php and it is used to wrap detail page tab content 
323
-add_action('geodir_after_tab_content', 'geodir_after_tab_content');// this function is in custom_functions.php and it is used to wrap detail page tab content
322
+add_action('geodir_before_tab_content', 'geodir_before_tab_content'); // this function is in custom_functions.php and it is used to wrap detail page tab content 
323
+add_action('geodir_after_tab_content', 'geodir_after_tab_content'); // this function is in custom_functions.php and it is used to wrap detail page tab content
324 324
 
325 325
 // Detail page sidebar content 
326 326
 add_action('geodir_detail_page_sidebar', 'geodir_detail_page_sidebar_content_sorting', 1);
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
     $content_html = ob_get_clean();
423 423
     if (trim($content_html) != '')
424 424
         $content_html = '<div class="geodir-company_info geodir-details-sidebar-social-sharing">' . $content_html . '</div>';
425
-    if ((int)get_option('geodir_disable_tfg_buttons_section') != 1) {
425
+    if ((int) get_option('geodir_disable_tfg_buttons_section') != 1) {
426 426
         /**
427 427
          * Filter the geodir_social_sharing_buttons() function content.
428 428
          *
@@ -469,7 +469,7 @@  discard block
 block discarded – undo
469 469
     $content_html = ob_get_clean();
470 470
     if (trim($content_html) != '')
471 471
         $content_html = '<div class="geodir-company_info geodir-details-sidebar-sharethis">' . $content_html . '</div>';
472
-    if ((int)get_option('geodir_disable_sharethis_button_section') != 1) {
472
+    if ((int) get_option('geodir_disable_sharethis_button_section') != 1) {
473 473
         /**
474 474
          * Filter the geodir_share_this_button() function content.
475 475
          *
@@ -528,7 +528,7 @@  discard block
 block discarded – undo
528 528
     $content_html = ob_get_clean();
529 529
     if (trim($content_html) != '')
530 530
         $content_html = '<div class="geodir-company_info geodir-details-sidebar-user-links">' . $content_html . '</div>';
531
-    if ((int)get_option('geodir_disable_user_links_section') != 1) {
531
+    if ((int) get_option('geodir_disable_user_links_section') != 1) {
532 532
         /**
533 533
          * Filter the geodir_edit_post_link() function content.
534 534
          *
@@ -557,7 +557,7 @@  discard block
 block discarded – undo
557 557
 
558 558
     $id = trim(get_option('geodir_ga_id'));
559 559
 
560
-    if(!$id){return;}//if no Google Analytics ID then bail.
560
+    if (!$id) {return; }//if no Google Analytics ID then bail.
561 561
 
562 562
     ob_start(); // Start buffering;
563 563
     /**
@@ -566,7 +566,7 @@  discard block
 block discarded – undo
566 566
      * @since 1.0.0
567 567
      */
568 568
     do_action('geodir_before_google_analytics');
569
-    if (get_option('geodir_ga_stats') && is_user_logged_in() &&  (isset($package_info->google_analytics) && $package_info->google_analytics == '1') && (get_current_user_id()==$post->post_author || current_user_can( 'manage_options' )) ) {
569
+    if (get_option('geodir_ga_stats') && is_user_logged_in() && (isset($package_info->google_analytics) && $package_info->google_analytics == '1') && (get_current_user_id() == $post->post_author || current_user_can('manage_options'))) {
570 570
         $page_url = $_SERVER['REQUEST_URI'];
571 571
         //$page_url = "/";
572 572
         ?>
@@ -594,13 +594,13 @@  discard block
 block discarded – undo
594 594
 
595 595
             function gdga_weekVSweek(){
596 596
 
597
-                jQuery.ajax({url: "<?php echo get_bloginfo('url').'/?ptype=ga&ga_page='.$page_url; ?>&ga_type=thisweek", success: function(result){
597
+                jQuery.ajax({url: "<?php echo get_bloginfo('url') . '/?ptype=ga&ga_page=' . $page_url; ?>&ga_type=thisweek", success: function(result){
598 598
                     ga_data1 = jQuery.parseJSON(result);
599 599
                     if(ga_data1.error){jQuery('#ga_stats').html(result);return;}
600 600
                     gd_renderWeekOverWeekChart();
601 601
                 }});
602 602
 
603
-                jQuery.ajax({url: "<?php echo get_bloginfo('url').'/?ptype=ga&ga_page='.$page_url; ?>&ga_type=lastweek", success: function(result){
603
+                jQuery.ajax({url: "<?php echo get_bloginfo('url') . '/?ptype=ga&ga_page=' . $page_url; ?>&ga_type=lastweek", success: function(result){
604 604
                     ga_data2 = jQuery.parseJSON(result);
605 605
                     gd_renderWeekOverWeekChart();
606 606
                 }});
@@ -610,14 +610,14 @@  discard block
 block discarded – undo
610 610
 
611 611
             function gdga_yearVSyear(){
612 612
 
613
-                jQuery.ajax({url: "<?php echo get_bloginfo('url').'/?ptype=ga&ga_page='.$page_url; ?>&ga_type=thisyear", success: function(result){
613
+                jQuery.ajax({url: "<?php echo get_bloginfo('url') . '/?ptype=ga&ga_page=' . $page_url; ?>&ga_type=thisyear", success: function(result){
614 614
                     ga_data3 = jQuery.parseJSON(result);
615 615
                     if(ga_data3.error){jQuery('#ga_stats').html(result);return;}
616 616
 
617 617
                     gd_renderYearOverYearChart()
618 618
                 }});
619 619
 
620
-                jQuery.ajax({url: "<?php echo get_bloginfo('url').'/?ptype=ga&ga_page='.$page_url; ?>&ga_type=lastyear", success: function(result){
620
+                jQuery.ajax({url: "<?php echo get_bloginfo('url') . '/?ptype=ga&ga_page=' . $page_url; ?>&ga_type=lastyear", success: function(result){
621 621
                     ga_data4 = jQuery.parseJSON(result);
622 622
                     gd_renderYearOverYearChart()
623 623
                 }});
@@ -627,7 +627,7 @@  discard block
 block discarded – undo
627 627
 
628 628
             function gdga_country(){
629 629
 
630
-                jQuery.ajax({url: "<?php echo get_bloginfo('url').'/?ptype=ga&ga_page='.$page_url; ?>&ga_type=country", success: function(result){
630
+                jQuery.ajax({url: "<?php echo get_bloginfo('url') . '/?ptype=ga&ga_page=' . $page_url; ?>&ga_type=country", success: function(result){
631 631
                     ga_data5 = jQuery.parseJSON(result);
632 632
                     if(ga_data5.error){jQuery('#ga_stats').html(result);return;}
633 633
                     gd_renderTopCountriesChart();
@@ -637,7 +637,7 @@  discard block
 block discarded – undo
637 637
 
638 638
             function gdga_realtime(){
639 639
 
640
-                jQuery.ajax({url: "<?php echo get_bloginfo('url').'/?ptype=ga&ga_page='.$page_url; ?>&ga_type=realtime", success: function(result){
640
+                jQuery.ajax({url: "<?php echo get_bloginfo('url') . '/?ptype=ga&ga_page=' . $page_url; ?>&ga_type=realtime", success: function(result){
641 641
                     ga_data6 = jQuery.parseJSON(result);
642 642
                     if(ga_data6.error){jQuery('#ga_stats').html(result);return;}
643 643
                     gd_renderRealTime();
@@ -708,7 +708,7 @@  discard block
 block discarded – undo
708 708
             }
709 709
 
710 710
             function gdga_noResults(){
711
-                jQuery('#gdga-chart-container').html('<?php _e('No results available','geodirectory');?>');
711
+                jQuery('#gdga-chart-container').html('<?php _e('No results available', 'geodirectory'); ?>');
712 712
                 jQuery('#gdga-legend-container').html('');
713 713
             }
714 714
 
@@ -746,18 +746,18 @@  discard block
 block discarded – undo
746 746
 
747 747
 
748 748
 
749
-                    var labels = ['<?php _e('Jan', 'geodirectory');?>',
750
-                        '<?php _e('Feb', 'geodirectory');?>',
751
-                        '<?php _e('Mar', 'geodirectory');?>',
752
-                        '<?php _e('Apr', 'geodirectory');?>',
753
-                        '<?php _e('May', 'geodirectory');?>',
754
-                        '<?php _e('Jun', 'geodirectory');?>',
755
-                        '<?php _e('Jul', 'geodirectory');?>',
756
-                        '<?php _e('Aug', 'geodirectory');?>',
757
-                        '<?php _e('Sep', 'geodirectory');?>',
758
-                        '<?php _e('Oct', 'geodirectory');?>',
759
-                        '<?php _e('Nov', 'geodirectory');?>',
760
-                        '<?php _e('Dec', 'geodirectory');?>'];
749
+                    var labels = ['<?php _e('Jan', 'geodirectory'); ?>',
750
+                        '<?php _e('Feb', 'geodirectory'); ?>',
751
+                        '<?php _e('Mar', 'geodirectory'); ?>',
752
+                        '<?php _e('Apr', 'geodirectory'); ?>',
753
+                        '<?php _e('May', 'geodirectory'); ?>',
754
+                        '<?php _e('Jun', 'geodirectory'); ?>',
755
+                        '<?php _e('Jul', 'geodirectory'); ?>',
756
+                        '<?php _e('Aug', 'geodirectory'); ?>',
757
+                        '<?php _e('Sep', 'geodirectory'); ?>',
758
+                        '<?php _e('Oct', 'geodirectory'); ?>',
759
+                        '<?php _e('Nov', 'geodirectory'); ?>',
760
+                        '<?php _e('Dec', 'geodirectory'); ?>'];
761 761
 
762 762
 
763 763
                     // Ensure the data arrays are at least as long as the labels array.
@@ -772,13 +772,13 @@  discard block
 block discarded – undo
772 772
                         labels : labels,
773 773
                         datasets : [
774 774
                             {
775
-                                label: '<?php _e('Last Year', 'geodirectory');?>',
775
+                                label: '<?php _e('Last Year', 'geodirectory'); ?>',
776 776
                                 fillColor : "rgba(220,220,220,0.5)",
777 777
                                 strokeColor : "rgba(220,220,220,1)",
778 778
                                 data : data2
779 779
                             },
780 780
                             {
781
-                                label: '<?php _e('This Year', 'geodirectory');?>',
781
+                                label: '<?php _e('This Year', 'geodirectory'); ?>',
782 782
                                 fillColor : "rgba(151,187,205,0.5)",
783 783
                                 strokeColor : "rgba(151,187,205,1)",
784 784
                                 data : data1
@@ -828,23 +828,23 @@  discard block
 block discarded – undo
828 828
 
829 829
                     <?php
830 830
                     // Here we list the shorthand days of the week so it can be used in translation.
831
-                    __("Mon",'geodirectory');
832
-                    __("Tue",'geodirectory');
833
-                    __("Wed",'geodirectory');
834
-                    __("Thu",'geodirectory');
835
-                    __("Fri",'geodirectory');
836
-                    __("Sat",'geodirectory');
837
-                    __("Sun",'geodirectory');
831
+                    __("Mon", 'geodirectory');
832
+                    __("Tue", 'geodirectory');
833
+                    __("Wed", 'geodirectory');
834
+                    __("Thu", 'geodirectory');
835
+                    __("Fri", 'geodirectory');
836
+                    __("Sat", 'geodirectory');
837
+                    __("Sun", 'geodirectory');
838 838
                     ?>
839 839
 
840 840
                     labels = [
841
-                        "<?php _e(date('D', strtotime("+1 day")),'geodirectory'); ?>",
842
-                        "<?php _e(date('D', strtotime("+2 day")),'geodirectory'); ?>",
843
-                        "<?php _e(date('D', strtotime("+3 day")),'geodirectory'); ?>",
844
-                        "<?php _e(date('D', strtotime("+4 day")),'geodirectory'); ?>",
845
-                        "<?php _e(date('D', strtotime("+5 day")),'geodirectory'); ?>",
846
-                        "<?php _e(date('D', strtotime("+6 day")),'geodirectory'); ?>",
847
-                        "<?php _e(date('D', strtotime("+7 day")),'geodirectory'); ?>"
841
+                        "<?php _e(date('D', strtotime("+1 day")), 'geodirectory'); ?>",
842
+                        "<?php _e(date('D', strtotime("+2 day")), 'geodirectory'); ?>",
843
+                        "<?php _e(date('D', strtotime("+3 day")), 'geodirectory'); ?>",
844
+                        "<?php _e(date('D', strtotime("+4 day")), 'geodirectory'); ?>",
845
+                        "<?php _e(date('D', strtotime("+5 day")), 'geodirectory'); ?>",
846
+                        "<?php _e(date('D', strtotime("+6 day")), 'geodirectory'); ?>",
847
+                        "<?php _e(date('D', strtotime("+7 day")), 'geodirectory'); ?>"
848 848
                     ];
849 849
 
850 850
 
@@ -853,7 +853,7 @@  discard block
 block discarded – undo
853 853
                         labels : labels,
854 854
                         datasets : [
855 855
                             {
856
-                                label: '<?php _e('Last Week', 'geodirectory');?>',
856
+                                label: '<?php _e('Last Week', 'geodirectory'); ?>',
857 857
                                 fillColor : "rgba(220,220,220,0.5)",
858 858
                                 strokeColor : "rgba(220,220,220,1)",
859 859
                                 pointColor : "rgba(220,220,220,1)",
@@ -861,7 +861,7 @@  discard block
 block discarded – undo
861 861
                                 data : data2
862 862
                             },
863 863
                             {
864
-                                label: '<?php _e('This Week', 'geodirectory');?>',
864
+                                label: '<?php _e('This Week', 'geodirectory'); ?>',
865 865
                                 fillColor : "rgba(151,187,205,0.5)",
866 866
                                 strokeColor : "rgba(151,187,205,1)",
867 867
                                 pointColor : "rgba(151,187,205,1)",
@@ -1053,18 +1053,18 @@  discard block
 block discarded – undo
1053 1053
 
1054 1054
 
1055 1055
         <span id="ga_stats">
1056
-            <div id="ga-analytics-title"><?php _e("Analytics", 'geodirectory');?></div>
1056
+            <div id="ga-analytics-title"><?php _e("Analytics", 'geodirectory'); ?></div>
1057 1057
 
1058 1058
             <div id="gd-active-users-container">
1059
-                <div class="gd-ActiveUsers"><?php _e("Active Users:", 'geodirectory');?>
1059
+                <div class="gd-ActiveUsers"><?php _e("Active Users:", 'geodirectory'); ?>
1060 1060
                     <b class="gd-ActiveUsers-value">0</b>
1061 1061
                 </div>
1062 1062
             </div>
1063 1063
 
1064 1064
             <select id="gdga-select-analytic" onchange="gdga_select_option();" style="display: none;">
1065
-                <option value="weeks"><?php _e("Last Week vs This Week", 'geodirectory');?></option>
1066
-                <option value="years"><?php _e("This Year vs Last Year", 'geodirectory');?></option>
1067
-                <option value="country"><?php _e("Top Countries", 'geodirectory');?></option>
1065
+                <option value="weeks"><?php _e("Last Week vs This Week", 'geodirectory'); ?></option>
1066
+                <option value="years"><?php _e("This Year vs Last Year", 'geodirectory'); ?></option>
1067
+                <option value="country"><?php _e("Top Countries", 'geodirectory'); ?></option>
1068 1068
             </select>
1069 1069
             <img alt="loader icon" id="gdga-loader-icon" src="<?php echo geodir_plugin_url() . '/geodirectory-assets/images/ajax-loader.gif'; ?>" />
1070 1070
             <div class="Chartjs-figure" id="gdga-chart-container"></div>
@@ -1082,7 +1082,7 @@  discard block
 block discarded – undo
1082 1082
     $content_html = ob_get_clean();
1083 1083
     if (trim($content_html) != '')
1084 1084
         $content_html = '<div class="geodir-company_info geodir-details-sidebar-google-analytics">' . $content_html . '</div>';
1085
-    if ((int)get_option('geodir_disable_google_analytics_section') != 1) {
1085
+    if ((int) get_option('geodir_disable_google_analytics_section') != 1) {
1086 1086
         /**
1087 1087
          * Filter the geodir_edit_post_link() function content.
1088 1088
          *
@@ -1178,7 +1178,7 @@  discard block
 block discarded – undo
1178 1178
     if (trim($content_html) != '') {
1179 1179
         $content_html = '<div class="geodir-company_info geodir-details-sidebar-rating">' . $content_html . '</div>';
1180 1180
     }
1181
-    if ((int)get_option('geodir_disable_rating_info_section') != 1) {
1181
+    if ((int) get_option('geodir_disable_rating_info_section') != 1) {
1182 1182
         /**
1183 1183
          * Filter the geodir_detail_page_review_rating() function content.
1184 1184
          *
@@ -1218,7 +1218,7 @@  discard block
 block discarded – undo
1218 1218
     $content_html = ob_get_clean();
1219 1219
     if (trim($content_html) != '')
1220 1220
         $content_html = '<div class="geodir-company_info geodir-details-sidebar-listing-info">' . $content_html . '</div>';
1221
-    if ((int)get_option('geodir_disable_listing_info_section') != 1) {
1221
+    if ((int) get_option('geodir_disable_listing_info_section') != 1) {
1222 1222
         /**
1223 1223
          * Filter the output html for function geodir_detail_page_more_info().
1224 1224
          *
@@ -1309,7 +1309,7 @@  discard block
 block discarded – undo
1309 1309
 		'gd_allowed_img_types' => !empty($allowed_img_types) ? implode(',', $allowed_img_types) : '',
1310 1310
 		'geodir_txt_form_wait' => __('Wait...', 'geodirectory'),
1311 1311
 		'geodir_txt_form_searching' => __('Searching...', 'geodirectory'),
1312
-		'fa_rating' => (int)get_option('geodir_reviewrating_enable_font_awesome') == 1 ? 1 : '',
1312
+		'fa_rating' => (int) get_option('geodir_reviewrating_enable_font_awesome') == 1 ? 1 : '',
1313 1313
 		'reviewrating' => defined('GEODIRREVIEWRATING_VERSION') ? 1 : '',
1314 1314
     );
1315 1315
 
@@ -1326,7 +1326,7 @@  discard block
 block discarded – undo
1326 1326
     foreach ($arr_alert_msg as $key => $value) {
1327 1327
         if (!is_scalar($value))
1328 1328
             continue;
1329
-        $arr_alert_msg[$key] = html_entity_decode((string)$value, ENT_QUOTES, 'UTF-8');
1329
+        $arr_alert_msg[$key] = html_entity_decode((string) $value, ENT_QUOTES, 'UTF-8');
1330 1330
     }
1331 1331
 
1332 1332
     $script = "var geodir_all_js_msg = " . json_encode($arr_alert_msg) . ';';
@@ -1502,7 +1502,7 @@  discard block
 block discarded – undo
1502 1502
         global $post;
1503 1503
         $term_condition = '';
1504 1504
         if (isset($_REQUEST['backandedit'])) {
1505
-            $post = (object)$gd_session->get('listing');
1505
+            $post = (object) $gd_session->get('listing');
1506 1506
             $term_condition = isset($post->geodir_accept_term_condition) ? $post->geodir_accept_term_condition : '';
1507 1507
         }
1508 1508
 
@@ -1516,7 +1516,7 @@  discard block
 block discarded – undo
1516 1516
                     echo 'checked="checked"';
1517 1517
                 } ?> field_type="checkbox" name="geodir_accept_term_condition" id="geodir_accept_term_condition"
1518 1518
                        class="geodir_textfield" value="1"
1519
-                       style="display:inline-block"/><a href="<?php $terms_page = get_option('geodir_term_condition_page'); if($terms_page){ echo get_permalink($terms_page);}?>" target="_blank"><?php _e('Please accept our terms and conditions', 'geodirectory'); ?></a>
1519
+                       style="display:inline-block"/><a href="<?php $terms_page = get_option('geodir_term_condition_page'); if ($terms_page) { echo get_permalink($terms_page); }?>" target="_blank"><?php _e('Please accept our terms and conditions', 'geodirectory'); ?></a>
1520 1520
 				</span>
1521 1521
             </div>
1522 1522
             <span class="geodir_message_error"><?php if (isset($required_msg)) {
@@ -1623,7 +1623,7 @@  discard block
 block discarded – undo
1623 1623
     global $wpdb, $plugin_prefix;
1624 1624
 	
1625 1625
 	// Remove unused virtual page
1626
-	$listings_page_id = (int)get_option('geodir_listing_page');
1626
+	$listings_page_id = (int) get_option('geodir_listing_page');
1627 1627
 	if ($listings_page_id) {
1628 1628
 		$wpdb->query($wpdb->prepare("DELETE FROM " . $wpdb->posts . " WHERE ID=%d AND post_name = %s AND post_type=%s", array($listings_page_id, 'listings', 'page')));
1629 1629
         delete_option('geodir_listing_page');
@@ -1885,43 +1885,43 @@  discard block
 block discarded – undo
1885 1885
 
1886 1886
 
1887 1887
     $gd_page = '';
1888
-    if(geodir_is_page('home')){
1888
+    if (geodir_is_page('home')) {
1889 1889
         $gd_page = 'home';
1890 1890
         $title = (get_option('geodir_meta_title_homepage')) ? get_option('geodir_meta_title_homepage') : $title;
1891 1891
     }
1892
-    elseif(geodir_is_page('detail')){
1892
+    elseif (geodir_is_page('detail')) {
1893 1893
         $gd_page = 'detail';
1894 1894
         $title = (get_option('geodir_meta_title_detail')) ? get_option('geodir_meta_title_detail') : $title;
1895 1895
     }
1896
-    elseif(geodir_is_page('pt')){
1896
+    elseif (geodir_is_page('pt')) {
1897 1897
         $gd_page = 'pt';
1898 1898
         $title = (get_option('geodir_meta_title_pt')) ? get_option('geodir_meta_title_pt') : $title;
1899 1899
     }
1900
-    elseif(geodir_is_page('listing')){
1900
+    elseif (geodir_is_page('listing')) {
1901 1901
         $gd_page = 'listing';
1902 1902
         $title = (get_option('geodir_meta_title_listing')) ? get_option('geodir_meta_title_listing') : $title;
1903 1903
     }
1904
-    elseif(geodir_is_page('location')){
1904
+    elseif (geodir_is_page('location')) {
1905 1905
         $gd_page = 'location';
1906 1906
         $title = (get_option('geodir_meta_title_location')) ? get_option('geodir_meta_title_location') : $title;
1907 1907
     }
1908
-    elseif(geodir_is_page('search')){
1908
+    elseif (geodir_is_page('search')) {
1909 1909
         $gd_page = 'search';
1910 1910
         $title = (get_option('geodir_meta_title_search')) ? get_option('geodir_meta_title_search') : $title;
1911 1911
     }
1912
-    elseif(geodir_is_page('add-listing')){
1912
+    elseif (geodir_is_page('add-listing')) {
1913 1913
         $gd_page = 'add-listing';
1914 1914
         $title = (get_option('geodir_meta_title_add-listing')) ? get_option('geodir_meta_title_add-listing') : $title;
1915 1915
     }
1916
-    elseif(geodir_is_page('author')){
1916
+    elseif (geodir_is_page('author')) {
1917 1917
         $gd_page = 'author';
1918 1918
         $title = (get_option('geodir_meta_title_author')) ? get_option('geodir_meta_title_author') : $title;
1919 1919
     }
1920
-    elseif(geodir_is_page('login')){
1920
+    elseif (geodir_is_page('login')) {
1921 1921
         $gd_page = 'login';
1922 1922
         $title = (get_option('geodir_meta_title_login')) ? get_option('geodir_meta_title_login') : $title;
1923 1923
     }
1924
-    elseif(geodir_is_page('listing-success')){
1924
+    elseif (geodir_is_page('listing-success')) {
1925 1925
         $gd_page = 'listing-success';
1926 1926
         $title = (get_option('geodir_meta_title_listing-success')) ? get_option('geodir_meta_title_listing-success') : $title;
1927 1927
     }
@@ -2185,7 +2185,7 @@  discard block
 block discarded – undo
2185 2185
  */
2186 2186
 function geodir_remove_template_redirect_actions()
2187 2187
 {
2188
-    if (geodir_is_page('login')){
2188
+    if (geodir_is_page('login')) {
2189 2189
         remove_all_actions('template_redirect');
2190 2190
         remove_action('init', 'avia_modify_front', 10);
2191 2191
     }
@@ -2636,8 +2636,8 @@  discard block
 block discarded – undo
2636 2636
                                 $date_format = $date_format['date_format'];
2637 2637
                             }
2638 2638
 
2639
-                            $search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format
2640
-                            $replace = array('d','j','l','m','n','F','Y');//PHP date format
2639
+                            $search = array('dd', 'd', 'DD', 'mm', 'm', 'MM', 'yy'); //jQuery UI datepicker format
2640
+                            $replace = array('d', 'j', 'l', 'm', 'n', 'F', 'Y'); //PHP date format
2641 2641
 
2642 2642
                             $date_format = str_replace($search, $replace, $date_format);
2643 2643
 
@@ -2732,7 +2732,7 @@  discard block
 block discarded – undo
2732 2732
                             $html_var = $type['htmlvar_name'];
2733 2733
                             $html_val = $type['htmlvar_name'];
2734 2734
 
2735
-                            if ((int)$post->$html_var == 1) {
2735
+                            if ((int) $post->$html_var == 1) {
2736 2736
 
2737 2737
                                 if ($post->$type['htmlvar_name'] == '1') {
2738 2738
                                     $html_val = __('Yes', 'geodirectory');
@@ -2908,7 +2908,7 @@  discard block
 block discarded – undo
2908 2908
 
2909 2909
                                 if (!empty($files)) {
2910 2910
                                     $extra_fields = !empty($type['extra_fields']) ? maybe_unserialize($type['extra_fields']) : NULL;
2911
-							   		$allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types'] ) ? $extra_fields['gd_file_types'] : '';
2911
+							   		$allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types']) ? $extra_fields['gd_file_types'] : '';
2912 2912
 							   
2913 2913
 									$file_paths = '';
2914 2914
                                     foreach ($files as $file) {
@@ -2936,7 +2936,7 @@  discard block
 block discarded – undo
2936 2936
                                             // If the uploaded file is image
2937 2937
                                             if (in_array($uploaded_file_type, $image_file_types)) {
2938 2938
                                                 $file_paths .= '<div class="geodir-custom-post-gallery" class="clearfix">';
2939
-												$file_paths .= '<a href="'.$file.'">';
2939
+												$file_paths .= '<a href="' . $file . '">';
2940 2940
 												$file_paths .= geodir_show_image(array('src' => $file), 'thumbnail', false, false);
2941 2941
 												$file_paths .= '</a>';
2942 2942
 												$file_paths .= '</div>';
@@ -3286,7 +3286,7 @@  discard block
 block discarded – undo
3286 3286
  * @return array Translation texts.
3287 3287
  */
3288 3288
 function geodir_load_gd_options_text_translation($translation_texts = array()) {
3289
-	$translation_texts = !empty( $translation_texts ) && is_array( $translation_texts ) ? $translation_texts : array();
3289
+	$translation_texts = !empty($translation_texts) && is_array($translation_texts) ? $translation_texts : array();
3290 3290
 	
3291 3291
 	$gd_options = array('geodir_post_submited_success_email_subject_admin', 'geodir_post_submited_success_email_content_admin', 'geodir_post_submited_success_email_subject', 'geodir_post_submited_success_email_content', 'geodir_forgot_password_subject', 'geodir_forgot_password_content', 'geodir_registration_success_email_subject', 'geodir_registration_success_email_content', 'geodir_post_published_email_subject', 'geodir_post_published_email_content', 'geodir_email_friend_subject', 'geodir_email_friend_content', 'geodir_email_enquiry_subject', 'geodir_email_enquiry_content', 'geodir_post_added_success_msg_content');
3292 3292
 	
Please login to merge, or discard this patch.
geodirectory_template_tags.php 1 patch
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 {
38 38
     $is_detail_page = false;
39 39
 
40
-    if((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview') )) {
40
+    if ((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview'))) {
41 41
         $is_detail_page = true;
42 42
     }
43 43
 
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
         'siteurl' => get_option('siteurl'),
52 52
         'geodir_plugin_url' => geodir_plugin_url(),
53 53
         'geodir_ajax_url' => geodir_get_ajax_url(),
54
-        'geodir_gd_modal' => (int)get_option('geodir_disable_gb_modal'),
54
+        'geodir_gd_modal' => (int) get_option('geodir_disable_gb_modal'),
55 55
         'is_rtl' => is_rtl() ? 1 : 0 // fix rtl issue
56 56
     );
57 57
 
@@ -72,25 +72,25 @@  discard block
 block discarded – undo
72 72
      *
73 73
      * }
74 74
      */
75
-    $geodir_vars_data = apply_filters('geodir_vars_data',$geodir_vars_data);
75
+    $geodir_vars_data = apply_filters('geodir_vars_data', $geodir_vars_data);
76 76
 
77 77
     wp_localize_script('geodirectory-script', 'geodir_var', $geodir_vars_data);
78 78
 
79 79
 
80 80
 
81 81
 
82
-    wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION,true);
83
-    if($is_detail_page){wp_enqueue_script('geodirectory-jquery-flexslider-js');}
82
+    wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION, true);
83
+    if ($is_detail_page) {wp_enqueue_script('geodirectory-jquery-flexslider-js'); }
84 84
 
85 85
 
86 86
 
87
-    wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url() . '/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION,true);
87
+    wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url() . '/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION, true);
88 88
     wp_enqueue_script('geodirectory-lightbox-jquery');
89 89
 
90 90
 
91 91
 
92
-    wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url() . '/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION,true);
93
-    if($is_detail_page){wp_enqueue_script('geodirectory-jquery-simplemodal');}
92
+    wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url() . '/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION, true);
93
+    if ($is_detail_page) {wp_enqueue_script('geodirectory-jquery-simplemodal'); }
94 94
 
95 95
 
96 96
     //if( get_option('geodir_enqueue_google_api_script')==1)
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
             wp_enqueue_script( 'geodirectory-googlemap-script' );
112 112
            }
113 113
         */
114
-    wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION,true);
114
+    wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION, true);
115 115
     wp_enqueue_script('geodirectory-goMap-script');
116 116
 
117 117
 
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
         wp_enqueue_script('plupload-all');
134 134
         wp_enqueue_script('jquery-ui-sortable');
135 135
 
136
-        wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION,true);
136
+        wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
137 137
         wp_enqueue_script('geodirectory-plupload-script');
138 138
 
139 139
         // SCRIPT FOR UPLOAD END
@@ -245,12 +245,12 @@  discard block
 block discarded – undo
245 245
  */
246 246
 function geodir_add_async_forscript($url)
247 247
 {
248
-    if (strpos($url, '#asyncload')===false)
248
+    if (strpos($url, '#asyncload') === false)
249 249
         return $url;
250 250
     else if (is_admin())
251 251
         return str_replace('#asyncload', '', $url);
252 252
     else
253
-        return str_replace('#asyncload', '', $url)."' async='async";
253
+        return str_replace('#asyncload', '', $url) . "' async='async";
254 254
 }
255 255
 add_filter('clean_url', 'geodir_add_async_forscript', 11, 1);
256 256
 
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
 {
265 265
 
266 266
 
267
-    if(get_option('geodir_scss_core')) {
267
+    if (get_option('geodir_scss_core')) {
268 268
 
269 269
 
270 270
         wp_register_style('geodirectory-frontend-style', geodir_plugin_url() . '/geodirectory-assets/css/style.css', array(), GEODIRECTORY_VERSION);
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
         wp_register_style('geodir-chosen-style', geodir_plugin_url() . '/geodirectory-assets/css/chosen.css', array(), GEODIRECTORY_VERSION);
299 299
         wp_enqueue_style('geodir-chosen-style');
300 300
 
301
-    }else{
301
+    } else {
302 302
         wp_register_style('geodir-core-scss', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION);
303 303
         wp_enqueue_style('geodir-core-scss');
304 304
 
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
 
307 307
     }
308 308
 
309
-    if(is_rtl()){
309
+    if (is_rtl()) {
310 310
     wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url() . '/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION);
311 311
     wp_enqueue_style('geodirectory-frontend-rtl-style');
312 312
     }
@@ -378,7 +378,7 @@  discard block
 block discarded – undo
378 378
         if ($max_page > 1 || $always_show) {
379 379
 			// Extra pagination info
380 380
 			$geodir_pagination_more_info = get_option('geodir_pagination_advance_info');
381
-			$start_no = ( $paged - 1 ) * $posts_per_page + 1;
381
+			$start_no = ($paged - 1) * $posts_per_page + 1;
382 382
 			$end_no = min($paged * $posts_per_page, $numposts);
383 383
 			
384 384
 			if ($geodir_pagination_more_info != '') {
@@ -445,7 +445,7 @@  discard block
 block discarded – undo
445 445
         jQuery(function ($) {
446 446
             $("#distance_slider").slider({
447 447
                 range: true,
448
-                values: [0, <?php echo ($_REQUEST['sdist']!='') ? $_REQUEST['sdist'] : "0"; ?>],
448
+                values: [0, <?php echo ($_REQUEST['sdist'] != '') ? $_REQUEST['sdist'] : "0"; ?>],
449 449
                 min: 0,
450 450
                 max: <?php echo $dist; ?>,
451 451
                 step: <?php echo $dist_dif; ?>,
@@ -510,7 +510,7 @@  discard block
 block discarded – undo
510 510
 
511 511
 
512 512
     <script type="text/javascript">
513
-        var default_location = '<?php if($search_location = geodir_get_default_location())  echo $search_location->city ;?>';
513
+        var default_location = '<?php if ($search_location = geodir_get_default_location())  echo $search_location->city; ?>';
514 514
         var latlng;
515 515
         var Sgeocoder;
516 516
         var address;
@@ -523,7 +523,7 @@  discard block
 block discarded – undo
523 523
 				var $form = jQuery(this).closest('form');
524 524
 				
525 525
 				if (jQuery("#sdist input[type='radio']:checked").length != 0) dist = jQuery("#sdist input[type='radio']:checked").val();
526
-				if (jQuery('.search_text', $form).val() == '' || jQuery('.search_text', $form).val() == '<?php echo $default_search_for_text;?>') jQuery('.search_text', $form).val(s);
526
+				if (jQuery('.search_text', $form).val() == '' || jQuery('.search_text', $form).val() == '<?php echo $default_search_for_text; ?>') jQuery('.search_text', $form).val(s);
527 527
 				
528 528
 				// Disable location based search for disabled location post type.
529 529
 				if (jQuery('.search_by_post', $form).val() != '' && typeof gd_cpt_no_location == 'function') {
@@ -537,7 +537,7 @@  discard block
 block discarded – undo
537 537
 					}
538 538
 				}
539 539
 				
540
-				if (dist > 0 || (jQuery('select[name="sort_by"]').val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest') || (jQuery(".snear", $form).val() != '' && jQuery(".snear", $form).val() != '<?php echo $default_near_text;?>')) {
540
+				if (dist > 0 || (jQuery('select[name="sort_by"]').val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest') || (jQuery(".snear", $form).val() != '' && jQuery(".snear", $form).val() != '<?php echo $default_near_text; ?>')) {
541 541
 					geodir_setsearch($form);
542 542
 				} else {
543 543
 					jQuery(".snear", $form).val('');
@@ -557,7 +557,7 @@  discard block
 block discarded – undo
557 557
 		});
558 558
         
559 559
 		function geodir_setsearch($form) {
560
-			if ((dist > 0 || (jQuery('select[name="sort_by"]', $form).val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest')) && (jQuery(".snear", $form).val() == '' || jQuery(".snear", $form).val() == '<?php echo $default_near_text;?>')) jQuery(".snear", $form).val(default_location);
560
+			if ((dist > 0 || (jQuery('select[name="sort_by"]', $form).val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest')) && (jQuery(".snear", $form).val() == '' || jQuery(".snear", $form).val() == '<?php echo $default_near_text; ?>')) jQuery(".snear", $form).val(default_location);
561 561
 			geocodeAddress($form);
562 562
 		}
563 563
 
@@ -570,8 +570,8 @@  discard block
 block discarded – undo
570 570
         function geocodeAddress($form) {
571 571
             Sgeocoder = new google.maps.Geocoder(); // Call the geocode function
572 572
 
573
-            if (jQuery('.snear', $form).val() == '' || ( jQuery('.sgeo_lat').val() != '' && jQuery('.sgeo_lon').val() != ''  ) || jQuery('.snear', $form).val().match("^<?php _e('In:','geodirectory');?>")) {
574
-                if (jQuery('.snear', $form).val().match("^<?php _e('In:','geodirectory');?>")) {
573
+            if (jQuery('.snear', $form).val() == '' || ( jQuery('.sgeo_lat').val() != '' && jQuery('.sgeo_lon').val() != ''  ) || jQuery('.snear', $form).val().match("^<?php _e('In:', 'geodirectory'); ?>")) {
574
+                if (jQuery('.snear', $form).val().match("^<?php _e('In:', 'geodirectory'); ?>")) {
575 575
                     jQuery(".snear", $form).val('');
576 576
                 }
577 577
                 jQuery($form).submit();
@@ -579,24 +579,24 @@  discard block
 block discarded – undo
579 579
 
580 580
                 var address = jQuery(".snear", $form).val();
581 581
 
582
-                if (jQuery('.snear', $form).val() == '<?php echo $default_near_text;?>') {
582
+                if (jQuery('.snear', $form).val() == '<?php echo $default_near_text; ?>') {
583 583
                     initialise2();
584 584
                 } else {
585 585
 
586 586
                     Sgeocoder.geocode({'address': address<?php
587
-                    if($near_add = get_option('geodir_search_near_addition')){echo '+", '.$near_add.'"';}
588
-                    if($near_add2 =
587
+                    if ($near_add = get_option('geodir_search_near_addition')) {echo '+", ' . $near_add . '"'; }
588
+                    if ($near_add2 =
589 589
                     /**
590 590
                      * Adds any extra info to the near search box query when trying to geolocate it via google api.
591 591
                      *
592 592
                      * @since 1.0.0
593 593
                      */
594
-                    apply_filters('geodir_search_near_addition','')){echo $near_add2;}//gt_advanced_near_search();?>},
594
+                    apply_filters('geodir_search_near_addition', '')) {echo $near_add2; }//gt_advanced_near_search();?>},
595 595
                         function (results, status) {
596 596
                             if (status == google.maps.GeocoderStatus.OK) {
597 597
                                 updateSearchPosition(results[0].geometry.location, $form);
598 598
                             } else {
599
-                                alert("<?php _e('Search was not successful for the following reason:','geodirectory');?>" + status);
599
+                                alert("<?php _e('Search was not successful for the following reason:', 'geodirectory'); ?>" + status);
600 600
                             }
601 601
                         });
602 602
                 }
@@ -627,19 +627,19 @@  discard block
 block discarded – undo
627 627
             var msg;
628 628
             switch (err.code) {
629 629
                 case err.UNKNOWN_ERROR:
630
-                    msg = "<?php _e('Unable to find your location','geodirectory');?>";
630
+                    msg = "<?php _e('Unable to find your location', 'geodirectory'); ?>";
631 631
                     break;
632 632
                 case err.PERMISSION_DENINED:
633
-                    msg = "<?php _e('Permission denied in finding your location','geodirectory');?>";
633
+                    msg = "<?php _e('Permission denied in finding your location', 'geodirectory'); ?>";
634 634
                     break;
635 635
                 case err.POSITION_UNAVAILABLE:
636
-                    msg = "<?php _e('Your location is currently unknown','geodirectory');?>";
636
+                    msg = "<?php _e('Your location is currently unknown', 'geodirectory'); ?>";
637 637
                     break;
638 638
                 case err.BREAK:
639
-                    msg = "<?php _e('Attempt to find location took too long','geodirectory');?>";
639
+                    msg = "<?php _e('Attempt to find location took too long', 'geodirectory'); ?>";
640 640
                     break;
641 641
                 default:
642
-                    msg = "<?php _e('Location detection not supported in browser','geodirectory');?>";
642
+                    msg = "<?php _e('Location detection not supported in browser', 'geodirectory'); ?>";
643 643
             }
644 644
             jQuery('#info').html(msg);
645 645
         }
@@ -679,7 +679,7 @@  discard block
 block discarded – undo
679 679
              * @param object $post The post object.
680 680
              * @param string $link The link to the post.
681 681
              */
682
-            return apply_filters('geodir_featured_badge_on_image', '<a href="' . $link . '"><span class="geodir_featured_img">&nbsp;</span></a>',$post,$link);
682
+            return apply_filters('geodir_featured_badge_on_image', '<a href="' . $link . '"><span class="geodir_featured_img">&nbsp;</span></a>', $post, $link);
683 683
             break;
684 684
         case 'new' :
685 685
             /**
@@ -689,7 +689,7 @@  discard block
 block discarded – undo
689 689
              * @param object $post The post object.
690 690
              * @param string $link The link to the post.
691 691
              */
692
-            return apply_filters('geodir_new_badge_on_image', '<a href="' . $link . '"><span class="geodir_new_listing">&nbsp;</span></a>',$post,$link);
692
+            return apply_filters('geodir_new_badge_on_image', '<a href="' . $link . '"><span class="geodir_new_listing">&nbsp;</span></a>', $post, $link);
693 693
             break;
694 694
 
695 695
     }
Please login to merge, or discard this patch.