@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | /** |
11 | 11 | * Get All Plugin functions from WordPress |
12 | 12 | */ |
13 | -include_once(ABSPATH . 'wp-admin/includes/plugin.php'); |
|
13 | +include_once(ABSPATH.'wp-admin/includes/plugin.php'); |
|
14 | 14 | |
15 | 15 | /*-----------------------------------------------------------------------------------*/ |
16 | 16 | /* Helper functions */ |
@@ -29,9 +29,9 @@ discard block |
||
29 | 29 | { |
30 | 30 | |
31 | 31 | if (is_ssl()) : |
32 | - return str_replace('http://', 'https://', WP_PLUGIN_URL) . "/" . plugin_basename(dirname(dirname(__FILE__))); |
|
32 | + return str_replace('http://', 'https://', WP_PLUGIN_URL)."/".plugin_basename(dirname(dirname(__FILE__))); |
|
33 | 33 | else : |
34 | - return WP_PLUGIN_URL . "/" . plugin_basename(dirname(dirname(__FILE__))); |
|
34 | + return WP_PLUGIN_URL."/".plugin_basename(dirname(dirname(__FILE__))); |
|
35 | 35 | endif; |
36 | 36 | } |
37 | 37 | |
@@ -47,10 +47,10 @@ discard block |
||
47 | 47 | */ |
48 | 48 | function geodir_plugin_path() |
49 | 49 | { |
50 | - if ( defined( 'GD_TESTING_MODE' ) && GD_TESTING_MODE ) { |
|
50 | + if (defined('GD_TESTING_MODE') && GD_TESTING_MODE) { |
|
51 | 51 | return dirname(dirname(__FILE__)); |
52 | 52 | } else { |
53 | - return WP_PLUGIN_DIR . "/" . plugin_basename(dirname(dirname(__FILE__))); |
|
53 | + return WP_PLUGIN_DIR."/".plugin_basename(dirname(dirname(__FILE__))); |
|
54 | 54 | } |
55 | 55 | } |
56 | 56 | |
@@ -129,10 +129,10 @@ discard block |
||
129 | 129 | foreach ($params as $key => $value) { |
130 | 130 | if (gettype($value) == 'array') { //Handle array data properly |
131 | 131 | foreach ($value as $val) { |
132 | - $params_arr[] = $key . '[]=' . urlencode($val); |
|
132 | + $params_arr[] = $key.'[]='.urlencode($val); |
|
133 | 133 | } |
134 | 134 | } else { |
135 | - $params_arr[] = $key . '=' . urlencode($value); |
|
135 | + $params_arr[] = $key.'='.urlencode($value); |
|
136 | 136 | } |
137 | 137 | } |
138 | 138 | $link .= implode('&', $params_arr); |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | |
161 | 161 | $add_listing_link = get_page_link(geodir_add_listing_page_id()); |
162 | 162 | |
163 | - return esc_url( add_query_arg(array('listing_type' => $post_type), $add_listing_link) ); |
|
163 | + return esc_url(add_query_arg(array('listing_type' => $post_type), $add_listing_link)); |
|
164 | 164 | } else |
165 | 165 | return get_bloginfo('url'); |
166 | 166 | } |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | $pageURL .= "s"; |
181 | 181 | } |
182 | 182 | $pageURL .= "://"; |
183 | - $pageURL .= $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"]; |
|
183 | + $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]; |
|
184 | 184 | /** |
185 | 185 | * Filter the current page URL returned by function geodir_curPageURL(). |
186 | 186 | * |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | function geodir_is_page($gdpage = '') |
253 | 253 | { |
254 | 254 | |
255 | - global $wp_query, $post,$wp; |
|
255 | + global $wp_query, $post, $wp; |
|
256 | 256 | //if(!is_admin()): |
257 | 257 | |
258 | 258 | switch ($gdpage): |
@@ -277,14 +277,14 @@ discard block |
||
277 | 277 | break; |
278 | 278 | case 'detail': |
279 | 279 | $post_type = get_query_var('post_type'); |
280 | - if(is_array($post_type)){$post_type = reset($post_type);} |
|
280 | + if (is_array($post_type)) {$post_type = reset($post_type); } |
|
281 | 281 | if (is_single() && in_array($post_type, geodir_get_posttypes())) |
282 | 282 | return true; |
283 | 283 | break; |
284 | 284 | case 'pt': |
285 | 285 | $post_type = get_query_var('post_type'); |
286 | - if(is_array($post_type)){$post_type = reset($post_type);} |
|
287 | - if (is_post_type_archive() && in_array($post_type , geodir_get_posttypes()) && !is_tax()) |
|
286 | + if (is_array($post_type)) {$post_type = reset($post_type); } |
|
287 | + if (is_post_type_archive() && in_array($post_type, geodir_get_posttypes()) && !is_tax()) |
|
288 | 288 | return true; |
289 | 289 | |
290 | 290 | break; |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | return true; |
296 | 296 | } |
297 | 297 | $post_type = get_query_var('post_type'); |
298 | - if(is_array($post_type)){$post_type = reset($post_type);} |
|
298 | + if (is_array($post_type)) {$post_type = reset($post_type); } |
|
299 | 299 | if (is_post_type_archive() && in_array($post_type, geodir_get_posttypes())) |
300 | 300 | return true; |
301 | 301 | |
@@ -314,8 +314,8 @@ discard block |
||
314 | 314 | if (is_author() && isset($_REQUEST['geodir_dashbord'])) |
315 | 315 | return true; |
316 | 316 | |
317 | - if (function_exists('bp_loggedin_user_id') && function_exists('bp_displayed_user_id') && $my_id = (int)bp_loggedin_user_id()) { |
|
318 | - if (((bool)bp_is_current_component('listings') || (bool)bp_is_current_component('favorites')) && $my_id > 0 && $my_id == (int)bp_displayed_user_id()) { |
|
317 | + if (function_exists('bp_loggedin_user_id') && function_exists('bp_displayed_user_id') && $my_id = (int) bp_loggedin_user_id()) { |
|
318 | + if (((bool) bp_is_current_component('listings') || (bool) bp_is_current_component('favorites')) && $my_id > 0 && $my_id == (int) bp_displayed_user_id()) { |
|
319 | 319 | return true; |
320 | 320 | } |
321 | 321 | } |
@@ -368,7 +368,7 @@ discard block |
||
368 | 368 | if (empty($wp->query_vars) || !array_diff(array_keys($wp->query_vars), array('preview', 'page', 'paged', 'cpage'))) { |
369 | 369 | if (get_option('geodir_set_as_home')) |
370 | 370 | $wp->query_vars['gd_is_geodir_page'] = true; |
371 | - if(geodir_is_page('home')){ |
|
371 | + if (geodir_is_page('home')) { |
|
372 | 372 | $wp->query_vars['gd_is_geodir_page'] = true; |
373 | 373 | } |
374 | 374 | |
@@ -420,7 +420,7 @@ discard block |
||
420 | 420 | |
421 | 421 | if (!isset($wp->query_vars['gd_is_geodir_page'])) { |
422 | 422 | $geodir_taxonomis = geodir_get_taxonomies('', true); |
423 | - if(!empty($geodir_taxonomis)){ |
|
423 | + if (!empty($geodir_taxonomis)) { |
|
424 | 424 | foreach ($geodir_taxonomis as $taxonomy) { |
425 | 425 | if (array_key_exists($taxonomy, $wp->query_vars)) { |
426 | 426 | $wp->query_vars['gd_is_geodir_page'] = true; |
@@ -440,10 +440,10 @@ discard block |
||
440 | 440 | |
441 | 441 | |
442 | 442 | //check if homepage |
443 | - if(!isset($wp->query_vars['gd_is_geodir_page']) |
|
443 | + if (!isset($wp->query_vars['gd_is_geodir_page']) |
|
444 | 444 | && !isset($wp->query_vars['page_id']) |
445 | 445 | && !isset($wp->query_vars['pagename']) |
446 | - && is_page_geodir_home()){ |
|
446 | + && is_page_geodir_home()) { |
|
447 | 447 | $wp->query_vars['gd_is_geodir_page'] = true; |
448 | 448 | } |
449 | 449 | //echo $wp->query_vars['gd_is_geodir_page'] ; |
@@ -505,7 +505,7 @@ discard block |
||
505 | 505 | * @since 1.0.0 |
506 | 506 | * @param array $imagesizes[$size] Image size array of the passed key. |
507 | 507 | */ |
508 | - return apply_filters('geodir_get_imagesize_' . $size, $imagesizes[$size]); |
|
508 | + return apply_filters('geodir_get_imagesize_'.$size, $imagesizes[$size]); |
|
509 | 509 | |
510 | 510 | } elseif (!empty($size)) { |
511 | 511 | |
@@ -544,13 +544,13 @@ discard block |
||
544 | 544 | function createRandomString() |
545 | 545 | { |
546 | 546 | $chars = "abcdefghijkmlnopqrstuvwxyz1023456789"; |
547 | - srand((double)microtime() * 1000000); |
|
547 | + srand((double) microtime() * 1000000); |
|
548 | 548 | $i = 0; |
549 | 549 | $rstring = ''; |
550 | 550 | while ($i <= 25) { |
551 | 551 | $num = rand() % 33; |
552 | 552 | $tmp = substr($chars, $num, 1); |
553 | - $rstring = $rstring . $tmp; |
|
553 | + $rstring = $rstring.$tmp; |
|
554 | 554 | $i++; |
555 | 555 | } |
556 | 556 | return $rstring; |
@@ -681,11 +681,11 @@ discard block |
||
681 | 681 | } |
682 | 682 | |
683 | 683 | if (!empty($subject)) { |
684 | - $subject = __(stripslashes_deep($subject),'geodirectory'); |
|
684 | + $subject = __(stripslashes_deep($subject), 'geodirectory'); |
|
685 | 685 | } |
686 | 686 | |
687 | 687 | if (!empty($message)) { |
688 | - $message = __(stripslashes_deep($message),'geodirectory'); |
|
688 | + $message = __(stripslashes_deep($message), 'geodirectory'); |
|
689 | 689 | } |
690 | 690 | |
691 | 691 | $to_message = nl2br($to_message); |
@@ -705,12 +705,12 @@ discard block |
||
705 | 705 | |
706 | 706 | if ($post_info) { |
707 | 707 | $posted_date = $post_info->post_date; |
708 | - $listingLink = '<a href="' . $productlink . '"><b>' . $post_info->post_title . '</b></a>'; |
|
708 | + $listingLink = '<a href="'.$productlink.'"><b>'.$post_info->post_title.'</b></a>'; |
|
709 | 709 | } |
710 | 710 | $siteurl = home_url(); |
711 | - $siteurl_link = '<a href="' . $siteurl . '">' . $siteurl . '</a>'; |
|
711 | + $siteurl_link = '<a href="'.$siteurl.'">'.$siteurl.'</a>'; |
|
712 | 712 | $loginurl = geodir_login_url(); |
713 | - $loginurl_link = '<a href="' . $loginurl . '">login</a>'; |
|
713 | + $loginurl_link = '<a href="'.$loginurl.'">login</a>'; |
|
714 | 714 | |
715 | 715 | $post_author_id = !empty($post_info) ? $post_info->post_author : 0; |
716 | 716 | $post_author_name = geodir_get_client_name($post_author_id); |
@@ -724,18 +724,18 @@ discard block |
||
724 | 724 | $fromEmailName = get_option('site_email_name'); |
725 | 725 | } |
726 | 726 | |
727 | - $search_array = array('[#listing_link#]', '[#site_name_url#]', '[#post_id#]', '[#site_name#]', '[#to_name#]', '[#from_name#]', '[#subject#]', '[#comments#]', '[#login_url#]', '[#login_details#]', '[#client_name#]', '[#posted_date#]','[#from_email#]','[#user_login#]','[#username#]','[#post_author_id#]','[#post_author_name#]','[#current_date#]'); |
|
728 | - $replace_array = array($listingLink, $siteurl_link, $post_id, $sitefromEmailName, $toEmailName, $fromEmailName, $to_subject, $to_message, $loginurl_link, $login_details, $toEmailName, $posted_date,$fromEmail, $user_login, $user_login, $post_author_id, $post_author_name, $current_date); |
|
727 | + $search_array = array('[#listing_link#]', '[#site_name_url#]', '[#post_id#]', '[#site_name#]', '[#to_name#]', '[#from_name#]', '[#subject#]', '[#comments#]', '[#login_url#]', '[#login_details#]', '[#client_name#]', '[#posted_date#]', '[#from_email#]', '[#user_login#]', '[#username#]', '[#post_author_id#]', '[#post_author_name#]', '[#current_date#]'); |
|
728 | + $replace_array = array($listingLink, $siteurl_link, $post_id, $sitefromEmailName, $toEmailName, $fromEmailName, $to_subject, $to_message, $loginurl_link, $login_details, $toEmailName, $posted_date, $fromEmail, $user_login, $user_login, $post_author_id, $post_author_name, $current_date); |
|
729 | 729 | $message = str_replace($search_array, $replace_array, $message); |
730 | 730 | |
731 | - $search_array = array('[#listing_link#]', '[#site_name_url#]', '[#post_id#]', '[#site_name#]', '[#to_name#]', '[#from_name#]', '[#subject#]', '[#client_name#]', '[#posted_date#]','[#from_email#]','[#user_login#]','[#username#]','[#post_author_id#]','[#post_author_name#]','[#current_date#]'); |
|
732 | - $replace_array = array($listingLink, $siteurl_link, $post_id, $sitefromEmailName, $toEmailName, $fromEmailName, $to_subject, $toEmailName, $posted_date,$fromEmail, $user_login, $user_login, $post_author_id, $post_author_name, $current_date); |
|
731 | + $search_array = array('[#listing_link#]', '[#site_name_url#]', '[#post_id#]', '[#site_name#]', '[#to_name#]', '[#from_name#]', '[#subject#]', '[#client_name#]', '[#posted_date#]', '[#from_email#]', '[#user_login#]', '[#username#]', '[#post_author_id#]', '[#post_author_name#]', '[#current_date#]'); |
|
732 | + $replace_array = array($listingLink, $siteurl_link, $post_id, $sitefromEmailName, $toEmailName, $fromEmailName, $to_subject, $toEmailName, $posted_date, $fromEmail, $user_login, $user_login, $post_author_id, $post_author_name, $current_date); |
|
733 | 733 | $subject = str_replace($search_array, $replace_array, $subject); |
734 | 734 | |
735 | - $headers = 'MIME-Version: 1.0' . "\r\n"; |
|
736 | - $headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n"; |
|
737 | - $headers .= "Reply-To: " . $fromEmail . "\r\n"; |
|
738 | - $headers .= 'From: ' . $sitefromEmailName . ' <' . $sitefromEmail . '>' . "\r\n"; |
|
735 | + $headers = 'MIME-Version: 1.0'."\r\n"; |
|
736 | + $headers .= 'Content-type: text/html; charset=UTF-8'."\r\n"; |
|
737 | + $headers .= "Reply-To: ".$fromEmail."\r\n"; |
|
738 | + $headers .= 'From: '.$sitefromEmailName.' <'.$sitefromEmail.'>'."\r\n"; |
|
739 | 739 | |
740 | 740 | $to = $toEmail; |
741 | 741 | |
@@ -756,7 +756,7 @@ discard block |
||
756 | 756 | * @param string $post_id The post ID. |
757 | 757 | * @param string $user_id The user ID. |
758 | 758 | */ |
759 | - $to = apply_filters('geodir_sendEmail_to',$to,$fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id ); |
|
759 | + $to = apply_filters('geodir_sendEmail_to', $to, $fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id); |
|
760 | 760 | /** |
761 | 761 | * Filter the client email subject. |
762 | 762 | * |
@@ -774,7 +774,7 @@ discard block |
||
774 | 774 | * @param string $post_id The post ID. |
775 | 775 | * @param string $user_id The user ID. |
776 | 776 | */ |
777 | - $subject = apply_filters('geodir_sendEmail_subject',$subject,$fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id ); |
|
777 | + $subject = apply_filters('geodir_sendEmail_subject', $subject, $fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id); |
|
778 | 778 | /** |
779 | 779 | * Filter the client email message. |
780 | 780 | * |
@@ -792,7 +792,7 @@ discard block |
||
792 | 792 | * @param string $post_id The post ID. |
793 | 793 | * @param string $user_id The user ID. |
794 | 794 | */ |
795 | - $message = apply_filters('geodir_sendEmail_message',$message,$fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id ); |
|
795 | + $message = apply_filters('geodir_sendEmail_message', $message, $fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id); |
|
796 | 796 | /** |
797 | 797 | * Filter the client email headers. |
798 | 798 | * |
@@ -810,22 +810,22 @@ discard block |
||
810 | 810 | * @param string $post_id The post ID. |
811 | 811 | * @param string $user_id The user ID. |
812 | 812 | */ |
813 | - $headers = apply_filters('geodir_sendEmail_headers',$headers,$fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id ); |
|
813 | + $headers = apply_filters('geodir_sendEmail_headers', $headers, $fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id); |
|
814 | 814 | |
815 | 815 | $sent = wp_mail($to, $subject, $message, $headers); |
816 | 816 | |
817 | - if( ! $sent ) { |
|
818 | - if ( is_array( $to ) ) { |
|
819 | - $to = implode( ',', $to ); |
|
817 | + if (!$sent) { |
|
818 | + if (is_array($to)) { |
|
819 | + $to = implode(',', $to); |
|
820 | 820 | } |
821 | 821 | $log_message = sprintf( |
822 | - __( "Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory' ), |
|
822 | + __("Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory'), |
|
823 | 823 | $message_type, |
824 | - date_i18n( 'F j Y H:i:s', current_time( 'timestamp' ) ), |
|
824 | + date_i18n('F j Y H:i:s', current_time('timestamp')), |
|
825 | 825 | $to, |
826 | 826 | $subject |
827 | 827 | ); |
828 | - geodir_error_log( $log_message ); |
|
828 | + geodir_error_log($log_message); |
|
829 | 829 | } |
830 | 830 | |
831 | 831 | ///////// ADMIN BCC EMIALS |
@@ -837,11 +837,11 @@ discard block |
||
837 | 837 | $subject = __(stripslashes_deep(get_option('geodir_post_submited_success_email_subject_admin')), 'geodirectory'); |
838 | 838 | $message = __(stripslashes_deep(get_option('geodir_post_submited_success_email_content_admin')), 'geodirectory'); |
839 | 839 | |
840 | - $search_array = array('[#listing_link#]', '[#site_name_url#]', '[#post_id#]', '[#site_name#]', '[#to_name#]', '[#from_name#]', '[#subject#]', '[#comments#]', '[#login_url#]', '[#login_details#]', '[#client_name#]', '[#posted_date#]','[#user_login#]','[#username#]'); |
|
840 | + $search_array = array('[#listing_link#]', '[#site_name_url#]', '[#post_id#]', '[#site_name#]', '[#to_name#]', '[#from_name#]', '[#subject#]', '[#comments#]', '[#login_url#]', '[#login_details#]', '[#client_name#]', '[#posted_date#]', '[#user_login#]', '[#username#]'); |
|
841 | 841 | $replace_array = array($listingLink, $siteurl_link, $post_id, $sitefromEmailName, $toEmailName, $fromEmailName, $to_subject, $to_message, $loginurl_link, $login_details, $toEmailName, $posted_date, $user_login, $user_login); |
842 | 842 | $message = str_replace($search_array, $replace_array, $message); |
843 | 843 | |
844 | - $search_array = array('[#listing_link#]', '[#site_name_url#]', '[#post_id#]', '[#site_name#]', '[#to_name#]', '[#from_name#]', '[#subject#]', '[#client_name#]', '[#posted_date#]','[#user_login#]','[#username#]'); |
|
844 | + $search_array = array('[#listing_link#]', '[#site_name_url#]', '[#post_id#]', '[#site_name#]', '[#to_name#]', '[#from_name#]', '[#subject#]', '[#client_name#]', '[#posted_date#]', '[#user_login#]', '[#username#]'); |
|
845 | 845 | $replace_array = array($listingLink, $siteurl_link, $post_id, $sitefromEmailName, $toEmailName, $fromEmailName, $to_subject, $toEmailName, $posted_date, $user_login, $user_login); |
846 | 846 | $subject = str_replace($search_array, $replace_array, $subject); |
847 | 847 | |
@@ -866,21 +866,21 @@ discard block |
||
866 | 866 | $admin_bcc = true; |
867 | 867 | } |
868 | 868 | |
869 | - if($admin_bcc===true){ |
|
869 | + if ($admin_bcc === true) { |
|
870 | 870 | $sent = wp_mail($to, $subject, $message, $headers); |
871 | 871 | |
872 | - if( ! $sent ) { |
|
873 | - if ( is_array( $to ) ) { |
|
874 | - $to = implode( ',', $to ); |
|
872 | + if (!$sent) { |
|
873 | + if (is_array($to)) { |
|
874 | + $to = implode(',', $to); |
|
875 | 875 | } |
876 | 876 | $log_message = sprintf( |
877 | - __( "Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory' ), |
|
877 | + __("Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory'), |
|
878 | 878 | $message_type, |
879 | - date_i18n( 'F j Y H:i:s', current_time( 'timestamp' ) ), |
|
879 | + date_i18n('F j Y H:i:s', current_time('timestamp')), |
|
880 | 880 | $to, |
881 | 881 | $subject |
882 | 882 | ); |
883 | - geodir_error_log( $log_message ); |
|
883 | + geodir_error_log($log_message); |
|
884 | 884 | } |
885 | 885 | } |
886 | 886 | |
@@ -912,12 +912,12 @@ discard block |
||
912 | 912 | foreach ($parents as $parent): |
913 | 913 | $item = get_term_by('id', $parent, get_query_var('taxonomy')); |
914 | 914 | $url = get_term_link($item, get_query_var('taxonomy')); |
915 | - echo '<li> > <a href="' . $url . '">' . $item->name . '</a></li>'; |
|
915 | + echo '<li> > <a href="'.$url.'">'.$item->name.'</a></li>'; |
|
916 | 916 | endforeach; |
917 | 917 | |
918 | 918 | endif; |
919 | 919 | |
920 | - echo '<li> > ' . $term->name . '</li>'; |
|
920 | + echo '<li> > '.$term->name.'</li>'; |
|
921 | 921 | } |
922 | 922 | |
923 | 923 | |
@@ -951,7 +951,7 @@ discard block |
||
951 | 951 | * |
952 | 952 | * @since 1.0.0 |
953 | 953 | */ |
954 | - $breadcrumb .= '<li>' . apply_filters('geodir_breadcrumb_first_link', '<a href="' . home_url() . '">' . __('Home', 'geodirectory') . '</a>') . '</li>'; |
|
954 | + $breadcrumb .= '<li>'.apply_filters('geodir_breadcrumb_first_link', '<a href="'.home_url().'">'.__('Home', 'geodirectory').'</a>').'</li>'; |
|
955 | 955 | |
956 | 956 | $gd_post_type = geodir_get_current_posttype(); |
957 | 957 | $post_type_info = get_post_type_object($gd_post_type); |
@@ -975,7 +975,7 @@ discard block |
||
975 | 975 | $location_manager = defined('POST_LOCATION_TABLE') ? true : false; |
976 | 976 | $neighbourhood_active = $location_manager && get_option('location_neighbourhoods') ? true : false; |
977 | 977 | |
978 | - if(geodir_is_page('detail') && isset($post->country_slug)){ |
|
978 | + if (geodir_is_page('detail') && isset($post->country_slug)) { |
|
979 | 979 | $location_terms = array( |
980 | 980 | 'gd_country' => $post->country_slug, |
981 | 981 | 'gd_region' => $post->region_slug, |
@@ -1030,12 +1030,12 @@ discard block |
||
1030 | 1030 | $is_location_last = ''; |
1031 | 1031 | $is_taxonomy_last = ''; |
1032 | 1032 | $breadcrumb .= '<li>'; |
1033 | - if (get_query_var($gd_post_type . 'category')) |
|
1034 | - $gd_taxonomy = $gd_post_type . 'category'; |
|
1035 | - elseif (get_query_var($gd_post_type . '_tags')) |
|
1036 | - $gd_taxonomy = $gd_post_type . '_tags'; |
|
1033 | + if (get_query_var($gd_post_type.'category')) |
|
1034 | + $gd_taxonomy = $gd_post_type.'category'; |
|
1035 | + elseif (get_query_var($gd_post_type.'_tags')) |
|
1036 | + $gd_taxonomy = $gd_post_type.'_tags'; |
|
1037 | 1037 | |
1038 | - $breadcrumb .= $separator . '<a href="' . $listing_link . '">' . __(ucfirst($post_type_info->label), 'geodirectory') . '</a>'; |
|
1038 | + $breadcrumb .= $separator.'<a href="'.$listing_link.'">'.__(ucfirst($post_type_info->label), 'geodirectory').'</a>'; |
|
1039 | 1039 | if (!empty($gd_taxonomy) || geodir_is_page('detail')) |
1040 | 1040 | $is_location_last = false; |
1041 | 1041 | else |
@@ -1085,18 +1085,18 @@ discard block |
||
1085 | 1085 | } |
1086 | 1086 | |
1087 | 1087 | if ($is_location_last && $key == 'gd_country' && !(isset($location_terms['gd_region']) && $location_terms['gd_region'] != '') && !(isset($location_terms['gd_city']) && $location_terms['gd_city'] != '')) { |
1088 | - $breadcrumb .= $location_term_actual_country != '' ? $separator . $location_term_actual_country : $separator . $gd_location_link_text; |
|
1088 | + $breadcrumb .= $location_term_actual_country != '' ? $separator.$location_term_actual_country : $separator.$gd_location_link_text; |
|
1089 | 1089 | } else if ($is_location_last && $key == 'gd_region' && !(isset($location_terms['gd_city']) && $location_terms['gd_city'] != '')) { |
1090 | - $breadcrumb .= $location_term_actual_region != '' ? $separator . $location_term_actual_region : $separator . $gd_location_link_text; |
|
1090 | + $breadcrumb .= $location_term_actual_region != '' ? $separator.$location_term_actual_region : $separator.$gd_location_link_text; |
|
1091 | 1091 | } else if ($is_location_last && $key == 'gd_city' && empty($location_terms['gd_neighbourhood'])) { |
1092 | - $breadcrumb .= $location_term_actual_city != '' ? $separator . $location_term_actual_city : $separator . $gd_location_link_text; |
|
1092 | + $breadcrumb .= $location_term_actual_city != '' ? $separator.$location_term_actual_city : $separator.$gd_location_link_text; |
|
1093 | 1093 | } else if ($is_location_last && $key == 'gd_neighbourhood') { |
1094 | - $breadcrumb .= $separator . $gd_location_link_text; |
|
1094 | + $breadcrumb .= $separator.$gd_location_link_text; |
|
1095 | 1095 | } else { |
1096 | 1096 | if (get_option('permalink_structure') != '') { |
1097 | - $location_link .= $location_term . '/'; |
|
1097 | + $location_link .= $location_term.'/'; |
|
1098 | 1098 | } else { |
1099 | - $location_link .= "&$key=" . $location_term; |
|
1099 | + $location_link .= "&$key=".$location_term; |
|
1100 | 1100 | } |
1101 | 1101 | |
1102 | 1102 | if ($key == 'gd_country' && $location_term_actual_country != '') { |
@@ -1113,7 +1113,7 @@ discard block |
||
1113 | 1113 | } |
1114 | 1114 | */ |
1115 | 1115 | |
1116 | - $breadcrumb .= $separator . '<a href="' . $location_link . '">' . $gd_location_link_text . '</a>'; |
|
1116 | + $breadcrumb .= $separator.'<a href="'.$location_link.'">'.$gd_location_link_text.'</a>'; |
|
1117 | 1117 | } |
1118 | 1118 | } |
1119 | 1119 | } |
@@ -1124,8 +1124,8 @@ discard block |
||
1124 | 1124 | |
1125 | 1125 | //if(get_option('geodir_add_categories_url')) |
1126 | 1126 | { |
1127 | - if (get_query_var($gd_post_type . '_tags')) { |
|
1128 | - $cat_link = $listing_link . 'tags/'; |
|
1127 | + if (get_query_var($gd_post_type.'_tags')) { |
|
1128 | + $cat_link = $listing_link.'tags/'; |
|
1129 | 1129 | } else |
1130 | 1130 | $cat_link = $listing_link; |
1131 | 1131 | |
@@ -1136,7 +1136,7 @@ discard block |
||
1136 | 1136 | |
1137 | 1137 | if ($location_term != '') { |
1138 | 1138 | if (get_option('permalink_structure') != '') { |
1139 | - $cat_link .= $location_term . '/'; |
|
1139 | + $cat_link .= $location_term.'/'; |
|
1140 | 1140 | } |
1141 | 1141 | } |
1142 | 1142 | } |
@@ -1155,10 +1155,10 @@ discard block |
||
1155 | 1155 | } |
1156 | 1156 | |
1157 | 1157 | if ($term_index == count($term_array) && $is_taxonomy_last) |
1158 | - $breadcrumb .= $separator . $term_link_text; |
|
1158 | + $breadcrumb .= $separator.$term_link_text; |
|
1159 | 1159 | else { |
1160 | - $cat_link .= $term . '/'; |
|
1161 | - $breadcrumb .= $separator . '<a href="' . $cat_link . '">' . $term_link_text . '</a>'; |
|
1160 | + $cat_link .= $term.'/'; |
|
1161 | + $breadcrumb .= $separator.'<a href="'.$cat_link.'">'.$term_link_text.'</a>'; |
|
1162 | 1162 | } |
1163 | 1163 | $term_index++; |
1164 | 1164 | } |
@@ -1168,7 +1168,7 @@ discard block |
||
1168 | 1168 | } |
1169 | 1169 | |
1170 | 1170 | if (geodir_is_page('detail')) |
1171 | - $breadcrumb .= $separator . get_the_title(); |
|
1171 | + $breadcrumb .= $separator.get_the_title(); |
|
1172 | 1172 | |
1173 | 1173 | $breadcrumb .= '</li>'; |
1174 | 1174 | |
@@ -1188,7 +1188,7 @@ discard block |
||
1188 | 1188 | $default_author_link = apply_filters('geodir_dashboard_author_link', $default_author_link, $user_id); |
1189 | 1189 | |
1190 | 1190 | $breadcrumb .= '<li>'; |
1191 | - $breadcrumb .= $separator . '<a href="' . $default_author_link . '">' . __('My Dashboard', 'geodirectory') . '</a>'; |
|
1191 | + $breadcrumb .= $separator.'<a href="'.$default_author_link.'">'.__('My Dashboard', 'geodirectory').'</a>'; |
|
1192 | 1192 | |
1193 | 1193 | if (isset($_REQUEST['list'])) { |
1194 | 1194 | $author_link = geodir_getlink($author_link, array('geodir_dashbord' => 'true', 'stype' => $_REQUEST['stype']), false); |
@@ -1203,20 +1203,20 @@ discard block |
||
1203 | 1203 | */ |
1204 | 1204 | $author_link = apply_filters('geodir_dashboard_author_link', $author_link, $user_id, $_REQUEST['stype']); |
1205 | 1205 | |
1206 | - $breadcrumb .= $separator . '<a href="' . $author_link . '">' . __(ucfirst($post_type_info->label), 'geodirectory') . '</a>'; |
|
1207 | - $breadcrumb .= $separator . ucfirst(__('My', 'geodirectory') . ' ' . $_REQUEST['list']); |
|
1206 | + $breadcrumb .= $separator.'<a href="'.$author_link.'">'.__(ucfirst($post_type_info->label), 'geodirectory').'</a>'; |
|
1207 | + $breadcrumb .= $separator.ucfirst(__('My', 'geodirectory').' '.$_REQUEST['list']); |
|
1208 | 1208 | } else |
1209 | - $breadcrumb .= $separator . __(ucfirst($post_type_info->label), 'geodirectory'); |
|
1209 | + $breadcrumb .= $separator.__(ucfirst($post_type_info->label), 'geodirectory'); |
|
1210 | 1210 | |
1211 | 1211 | $breadcrumb .= '</li>'; |
1212 | 1212 | } elseif (is_category() || is_single()) { |
1213 | 1213 | $category = get_the_category(); |
1214 | 1214 | if (is_category()) { |
1215 | - $breadcrumb .= '<li>' . $separator . $category[0]->cat_name . '</li>'; |
|
1215 | + $breadcrumb .= '<li>'.$separator.$category[0]->cat_name.'</li>'; |
|
1216 | 1216 | } |
1217 | 1217 | if (is_single()) { |
1218 | - $breadcrumb .= '<li>' . $separator . '<a href="' . get_category_link($category[0]->term_id) . '">' . $category[0]->cat_name . '</a></li>'; |
|
1219 | - $breadcrumb .= '<li>' . $separator . get_the_title() . '</li>'; |
|
1218 | + $breadcrumb .= '<li>'.$separator.'<a href="'.get_category_link($category[0]->term_id).'">'.$category[0]->cat_name.'</a></li>'; |
|
1219 | + $breadcrumb .= '<li>'.$separator.get_the_title().'</li>'; |
|
1220 | 1220 | } |
1221 | 1221 | /* End of my version ##################################################### */ |
1222 | 1222 | } else if (is_page()) { |
@@ -1226,31 +1226,31 @@ discard block |
||
1226 | 1226 | $page_title = defined('GD_LOCATION') ? GD_LOCATION : __('Location', 'geodirectory'); |
1227 | 1227 | } |
1228 | 1228 | |
1229 | - $breadcrumb .= '<li>' . $separator; |
|
1229 | + $breadcrumb .= '<li>'.$separator; |
|
1230 | 1230 | $breadcrumb .= stripslashes_deep($page_title); |
1231 | 1231 | $breadcrumb .= '</li>'; |
1232 | 1232 | } else if (is_tag()) { |
1233 | - $breadcrumb .= "<li> " . $separator . single_tag_title('',false) . '</li>'; |
|
1233 | + $breadcrumb .= "<li> ".$separator.single_tag_title('', false).'</li>'; |
|
1234 | 1234 | } else if (is_day()) { |
1235 | - $breadcrumb .= "<li> " . $separator . __(" Archive for", 'geodirectory') . " "; |
|
1235 | + $breadcrumb .= "<li> ".$separator.__(" Archive for", 'geodirectory')." "; |
|
1236 | 1236 | the_time('F jS, Y'); |
1237 | 1237 | $breadcrumb .= '</li>'; |
1238 | 1238 | } else if (is_month()) { |
1239 | - $breadcrumb .= "<li> " . $separator . __(" Archive for", 'geodirectory') . " "; |
|
1239 | + $breadcrumb .= "<li> ".$separator.__(" Archive for", 'geodirectory')." "; |
|
1240 | 1240 | the_time('F, Y'); |
1241 | 1241 | $breadcrumb .= '</li>'; |
1242 | 1242 | } else if (is_year()) { |
1243 | - $breadcrumb .= "<li> " . $separator . __(" Archive for", 'geodirectory') . " "; |
|
1243 | + $breadcrumb .= "<li> ".$separator.__(" Archive for", 'geodirectory')." "; |
|
1244 | 1244 | the_time('Y'); |
1245 | 1245 | $breadcrumb .= '</li>'; |
1246 | 1246 | } else if (is_author()) { |
1247 | - $breadcrumb .= "<li> " . $separator . __(" Author Archive", 'geodirectory'); |
|
1247 | + $breadcrumb .= "<li> ".$separator.__(" Author Archive", 'geodirectory'); |
|
1248 | 1248 | $breadcrumb .= '</li>'; |
1249 | 1249 | } else if (isset($_GET['paged']) && !empty($_GET['paged'])) { |
1250 | - $breadcrumb .= "<li>" . $separator . __("Blog Archives", 'geodirectory'); |
|
1250 | + $breadcrumb .= "<li>".$separator.__("Blog Archives", 'geodirectory'); |
|
1251 | 1251 | $breadcrumb .= '</li>'; |
1252 | 1252 | } else if (is_search()) { |
1253 | - $breadcrumb .= "<li> " . $separator . __(" Search Results", 'geodirectory'); |
|
1253 | + $breadcrumb .= "<li> ".$separator.__(" Search Results", 'geodirectory'); |
|
1254 | 1254 | $breadcrumb .= '</li>'; |
1255 | 1255 | } |
1256 | 1256 | $breadcrumb .= '</ul></div>'; |
@@ -1306,7 +1306,7 @@ discard block |
||
1306 | 1306 | function fetch_remote_file($url) |
1307 | 1307 | { |
1308 | 1308 | // extract the file name and extension from the url |
1309 | - require_once(ABSPATH . 'wp-includes/pluggable.php'); |
|
1309 | + require_once(ABSPATH.'wp-includes/pluggable.php'); |
|
1310 | 1310 | $file_name = basename($url); |
1311 | 1311 | if (strpos($file_name, '?') !== false) { |
1312 | 1312 | list($file_name) = explode('?', $file_name); |
@@ -1322,7 +1322,7 @@ discard block |
||
1322 | 1322 | return new WP_Error('upload_dir_error', $upload['error']); |
1323 | 1323 | |
1324 | 1324 | // fetch the remote url and write it to the placeholder file |
1325 | - $headers = wp_remote_get($url, array('stream' => true,'filename' => $upload['file'])); |
|
1325 | + $headers = wp_remote_get($url, array('stream' => true, 'filename' => $upload['file'])); |
|
1326 | 1326 | |
1327 | 1327 | $log_message = ''; |
1328 | 1328 | $filesize = filesize($upload['file']); |
@@ -1335,16 +1335,16 @@ discard block |
||
1335 | 1335 | $log_message = sprintf(__('Remote server returned error response %1$d %2$s', 'geodirectory'), esc_html($headers['response']), get_status_header_desc($headers['response'])); |
1336 | 1336 | } |
1337 | 1337 | elseif (isset($headers['headers']['content-length']) && $filesize != $headers['headers']['content-length']) { |
1338 | - $log_message = __('Remote file is incorrect size', 'geodirectory'); |
|
1338 | + $log_message = __('Remote file is incorrect size', 'geodirectory'); |
|
1339 | 1339 | } |
1340 | 1340 | elseif (0 == $filesize) { |
1341 | 1341 | $log_message = __('Zero size file downloaded', 'geodirectory'); |
1342 | 1342 | } |
1343 | 1343 | |
1344 | - if($log_message){ |
|
1344 | + if ($log_message) { |
|
1345 | 1345 | $del = unlink($upload['file']); |
1346 | - if(!$del){geodir_error_log(__('GeoDirectory: fetch_remote_file() failed to delete temp file.', 'geodirectory'));} |
|
1347 | - return new WP_Error('import_file_error',$log_message ); |
|
1346 | + if (!$del) {geodir_error_log(__('GeoDirectory: fetch_remote_file() failed to delete temp file.', 'geodirectory')); } |
|
1347 | + return new WP_Error('import_file_error', $log_message); |
|
1348 | 1348 | } |
1349 | 1349 | |
1350 | 1350 | |
@@ -1360,12 +1360,12 @@ discard block |
||
1360 | 1360 | */ |
1361 | 1361 | function geodir_max_upload_size() |
1362 | 1362 | { |
1363 | - $max_filesize = (float)get_option('geodir_upload_max_filesize', 2); |
|
1363 | + $max_filesize = (float) get_option('geodir_upload_max_filesize', 2); |
|
1364 | 1364 | |
1365 | 1365 | if ($max_filesize > 0 && $max_filesize < 1) { |
1366 | - $max_filesize = (int)($max_filesize * 1024) . 'kb'; |
|
1366 | + $max_filesize = (int) ($max_filesize * 1024).'kb'; |
|
1367 | 1367 | } else { |
1368 | - $max_filesize = $max_filesize > 0 ? $max_filesize . 'mb' : '2mb'; |
|
1368 | + $max_filesize = $max_filesize > 0 ? $max_filesize.'mb' : '2mb'; |
|
1369 | 1369 | } |
1370 | 1370 | |
1371 | 1371 | /** |
@@ -1388,7 +1388,7 @@ discard block |
||
1388 | 1388 | */ |
1389 | 1389 | function geodir_dummy_folder_exists() |
1390 | 1390 | { |
1391 | - $path = geodir_plugin_path() . '/geodirectory-admin/dummy/'; |
|
1391 | + $path = geodir_plugin_path().'/geodirectory-admin/dummy/'; |
|
1392 | 1392 | if (!is_dir($path)) |
1393 | 1393 | return false; |
1394 | 1394 | else |
@@ -1432,35 +1432,35 @@ discard block |
||
1432 | 1432 | { |
1433 | 1433 | global $wpdb; |
1434 | 1434 | if ($message_type == 'expiration') { |
1435 | - $subject = stripslashes(__(get_option('renew_email_subject'),'geodirectory')); |
|
1436 | - $client_message = stripslashes(__(get_option('renew_email_content'),'geodirectory')); |
|
1435 | + $subject = stripslashes(__(get_option('renew_email_subject'), 'geodirectory')); |
|
1436 | + $client_message = stripslashes(__(get_option('renew_email_content'), 'geodirectory')); |
|
1437 | 1437 | } elseif ($message_type == 'post_submited') { |
1438 | - $subject = __(get_option('post_submited_success_email_subject_admin'),'geodirectory'); |
|
1439 | - $client_message = __(get_option('post_submited_success_email_content_admin'),'geodirectory'); |
|
1438 | + $subject = __(get_option('post_submited_success_email_subject_admin'), 'geodirectory'); |
|
1439 | + $client_message = __(get_option('post_submited_success_email_content_admin'), 'geodirectory'); |
|
1440 | 1440 | } elseif ($message_type == 'renew') { |
1441 | - $subject = __(get_option('post_renew_success_email_subject_admin'),'geodirectory'); |
|
1442 | - $client_message = __(get_option('post_renew_success_email_content_admin'),'geodirectory'); |
|
1441 | + $subject = __(get_option('post_renew_success_email_subject_admin'), 'geodirectory'); |
|
1442 | + $client_message = __(get_option('post_renew_success_email_content_admin'), 'geodirectory'); |
|
1443 | 1443 | } elseif ($message_type == 'upgrade') { |
1444 | - $subject = __(get_option('post_upgrade_success_email_subject_admin'),'geodirectory'); |
|
1445 | - $client_message = __(get_option('post_upgrade_success_email_content_admin'),'geodirectory'); |
|
1444 | + $subject = __(get_option('post_upgrade_success_email_subject_admin'), 'geodirectory'); |
|
1445 | + $client_message = __(get_option('post_upgrade_success_email_content_admin'), 'geodirectory'); |
|
1446 | 1446 | } elseif ($message_type == 'claim_approved') { |
1447 | - $subject = __(get_option('claim_approved_email_subject'),'geodirectory'); |
|
1448 | - $client_message = __(get_option('claim_approved_email_content'),'geodirectory'); |
|
1447 | + $subject = __(get_option('claim_approved_email_subject'), 'geodirectory'); |
|
1448 | + $client_message = __(get_option('claim_approved_email_content'), 'geodirectory'); |
|
1449 | 1449 | } elseif ($message_type == 'claim_rejected') { |
1450 | - $subject = __(get_option('claim_rejected_email_subject'),'geodirectory'); |
|
1451 | - $client_message = __(get_option('claim_rejected_email_content'),'geodirectory'); |
|
1450 | + $subject = __(get_option('claim_rejected_email_subject'), 'geodirectory'); |
|
1451 | + $client_message = __(get_option('claim_rejected_email_content'), 'geodirectory'); |
|
1452 | 1452 | } elseif ($message_type == 'claim_requested') { |
1453 | - $subject = __(get_option('claim_email_subject_admin'),'geodirectory'); |
|
1454 | - $client_message = __(get_option('claim_email_content_admin'),'geodirectory'); |
|
1453 | + $subject = __(get_option('claim_email_subject_admin'), 'geodirectory'); |
|
1454 | + $client_message = __(get_option('claim_email_content_admin'), 'geodirectory'); |
|
1455 | 1455 | } elseif ($message_type == 'auto_claim') { |
1456 | - $subject = __(get_option('auto_claim_email_subject'),'geodirectory'); |
|
1457 | - $client_message = __(get_option('auto_claim_email_content'),'geodirectory'); |
|
1456 | + $subject = __(get_option('auto_claim_email_subject'), 'geodirectory'); |
|
1457 | + $client_message = __(get_option('auto_claim_email_content'), 'geodirectory'); |
|
1458 | 1458 | } elseif ($message_type == 'payment_success') { |
1459 | - $subject = __(get_option('post_payment_success_admin_email_subject'),'geodirectory'); |
|
1460 | - $client_message = __(get_option('post_payment_success_admin_email_content'),'geodirectory'); |
|
1459 | + $subject = __(get_option('post_payment_success_admin_email_subject'), 'geodirectory'); |
|
1460 | + $client_message = __(get_option('post_payment_success_admin_email_content'), 'geodirectory'); |
|
1461 | 1461 | } elseif ($message_type == 'payment_fail') { |
1462 | - $subject = __(get_option('post_payment_fail_admin_email_subject'),'geodirectory'); |
|
1463 | - $client_message = __(get_option('post_payment_fail_admin_email_content'),'geodirectory'); |
|
1462 | + $subject = __(get_option('post_payment_fail_admin_email_subject'), 'geodirectory'); |
|
1463 | + $client_message = __(get_option('post_payment_fail_admin_email_content'), 'geodirectory'); |
|
1464 | 1464 | } |
1465 | 1465 | $transaction_details = $custom_1; |
1466 | 1466 | $fromEmail = get_option('site_email'); |
@@ -1471,11 +1471,11 @@ discard block |
||
1471 | 1471 | $productlink = get_permalink($page_id); |
1472 | 1472 | $post_info = get_post($page_id); |
1473 | 1473 | $post_date = date('dS F,Y', strtotime($post_info->post_date)); |
1474 | - $listingLink = '<a href="' . $productlink . '"><b>' . $post_info->post_title . '</b></a>'; |
|
1474 | + $listingLink = '<a href="'.$productlink.'"><b>'.$post_info->post_title.'</b></a>'; |
|
1475 | 1475 | $loginurl = geodir_login_url(); |
1476 | - $loginurl_link = '<a href="' . $loginurl . '">login</a>'; |
|
1476 | + $loginurl_link = '<a href="'.$loginurl.'">login</a>'; |
|
1477 | 1477 | $siteurl = home_url(); |
1478 | - $siteurl_link = '<a href="' . $siteurl . '">' . $fromEmailName . '</a>'; |
|
1478 | + $siteurl_link = '<a href="'.$siteurl.'">'.$fromEmailName.'</a>'; |
|
1479 | 1479 | $user_info = get_userdata($user_id); |
1480 | 1480 | $user_email = $user_info->user_email; |
1481 | 1481 | $display_name = geodir_get_client_name($user_id); |
@@ -1489,14 +1489,14 @@ discard block |
||
1489 | 1489 | } else { |
1490 | 1490 | $post_type = 'listing'; |
1491 | 1491 | } |
1492 | - $renew_link = '<a href="' . $siteurl . '?ptype=post_' . $post_type . '&renew=1&pid=' . $page_id . '">' . RENEW_LINK . '</a>'; |
|
1492 | + $renew_link = '<a href="'.$siteurl.'?ptype=post_'.$post_type.'&renew=1&pid='.$page_id.'">'.RENEW_LINK.'</a>'; |
|
1493 | 1493 | $search_array = array('[#client_name#]', '[#listing_link#]', '[#posted_date#]', '[#number_of_days#]', '[#number_of_grace_days#]', '[#login_url#]', '[#username#]', '[#user_email#]', '[#site_name_url#]', '[#renew_link#]', '[#post_id#]', '[#site_name#]', '[#transaction_details#]'); |
1494 | 1494 | $replace_array = array($display_name, $listingLink, $post_date, $alivedays, $number_of_grace_days, $loginurl_link, $user_login, $user_email, $siteurl_link, $renew_link, $page_id, $fromEmailName, $transaction_details); |
1495 | 1495 | $client_message = str_replace($search_array, $replace_array, $client_message); |
1496 | 1496 | $subject = str_replace($search_array, $replace_array, $subject); |
1497 | - $headers = 'MIME-Version: 1.0' . "\r\n"; |
|
1498 | - $headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n"; |
|
1499 | - $headers .= 'From: ' . $fromEmailName . ' <' . $fromEmail . '>' . "\r\n"; |
|
1497 | + $headers = 'MIME-Version: 1.0'."\r\n"; |
|
1498 | + $headers .= 'Content-type: text/html; charset=UTF-8'."\r\n"; |
|
1499 | + $headers .= 'From: '.$fromEmailName.' <'.$fromEmail.'>'."\r\n"; |
|
1500 | 1500 | |
1501 | 1501 | $to = $fromEmail; |
1502 | 1502 | $message = $client_message; |
@@ -1513,7 +1513,7 @@ discard block |
||
1513 | 1513 | * @param string $message_type Can be 'expiration','post_submited','renew','upgrade','claim_approved','claim_rejected','claim_requested','auto_claim','payment_success','payment_fail'. |
1514 | 1514 | * @param string $custom_1 Custom data to be sent. |
1515 | 1515 | */ |
1516 | - $to = apply_filters('geodir_adminEmail_to',$to,$page_id, $user_id, $message_type, $custom_1 ); |
|
1516 | + $to = apply_filters('geodir_adminEmail_to', $to, $page_id, $user_id, $message_type, $custom_1); |
|
1517 | 1517 | /** |
1518 | 1518 | * Filter the admin email subject. |
1519 | 1519 | * |
@@ -1525,7 +1525,7 @@ discard block |
||
1525 | 1525 | * @param string $message_type Can be 'expiration','post_submited','renew','upgrade','claim_approved','claim_rejected','claim_requested','auto_claim','payment_success','payment_fail'. |
1526 | 1526 | * @param string $custom_1 Custom data to be sent. |
1527 | 1527 | */ |
1528 | - $subject = apply_filters('geodir_adminEmail_subject',$subject,$page_id, $user_id, $message_type, $custom_1); |
|
1528 | + $subject = apply_filters('geodir_adminEmail_subject', $subject, $page_id, $user_id, $message_type, $custom_1); |
|
1529 | 1529 | /** |
1530 | 1530 | * Filter the admin email message. |
1531 | 1531 | * |
@@ -1537,7 +1537,7 @@ discard block |
||
1537 | 1537 | * @param string $message_type Can be 'expiration','post_submited','renew','upgrade','claim_approved','claim_rejected','claim_requested','auto_claim','payment_success','payment_fail'. |
1538 | 1538 | * @param string $custom_1 Custom data to be sent. |
1539 | 1539 | */ |
1540 | - $message = apply_filters('geodir_adminEmail_message',$message,$page_id, $user_id, $message_type, $custom_1); |
|
1540 | + $message = apply_filters('geodir_adminEmail_message', $message, $page_id, $user_id, $message_type, $custom_1); |
|
1541 | 1541 | /** |
1542 | 1542 | * Filter the admin email headers. |
1543 | 1543 | * |
@@ -1549,23 +1549,23 @@ discard block |
||
1549 | 1549 | * @param string $message_type Can be 'expiration','post_submited','renew','upgrade','claim_approved','claim_rejected','claim_requested','auto_claim','payment_success','payment_fail'. |
1550 | 1550 | * @param string $custom_1 Custom data to be sent. |
1551 | 1551 | */ |
1552 | - $headers = apply_filters('geodir_adminEmail_headers',$headers,$page_id, $user_id, $message_type, $custom_1); |
|
1552 | + $headers = apply_filters('geodir_adminEmail_headers', $headers, $page_id, $user_id, $message_type, $custom_1); |
|
1553 | 1553 | |
1554 | 1554 | |
1555 | 1555 | |
1556 | 1556 | $sent = wp_mail($to, $subject, $message, $headers); |
1557 | - if( ! $sent ) { |
|
1558 | - if ( is_array( $to ) ) { |
|
1559 | - $to = implode( ',', $to ); |
|
1557 | + if (!$sent) { |
|
1558 | + if (is_array($to)) { |
|
1559 | + $to = implode(',', $to); |
|
1560 | 1560 | } |
1561 | 1561 | $log_message = sprintf( |
1562 | - __( "Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory' ), |
|
1562 | + __("Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory'), |
|
1563 | 1563 | $message_type, |
1564 | - date_i18n( 'F j Y H:i:s', current_time( 'timestamp' ) ), |
|
1564 | + date_i18n('F j Y H:i:s', current_time('timestamp')), |
|
1565 | 1565 | $to, |
1566 | 1566 | $subject |
1567 | 1567 | ); |
1568 | - geodir_error_log( $log_message ); |
|
1568 | + geodir_error_log($log_message); |
|
1569 | 1569 | } |
1570 | 1570 | } |
1571 | 1571 | } |
@@ -1591,18 +1591,18 @@ discard block |
||
1591 | 1591 | { |
1592 | 1592 | $login_details = ''; |
1593 | 1593 | if ($message_type == 'send_friend') { |
1594 | - $subject = stripslashes(__(get_option('email_friend_subject'),'geodirectory')); |
|
1595 | - $message = stripslashes(__(get_option('email_friend_content'),'geodirectory')); |
|
1594 | + $subject = stripslashes(__(get_option('email_friend_subject'), 'geodirectory')); |
|
1595 | + $message = stripslashes(__(get_option('email_friend_content'), 'geodirectory')); |
|
1596 | 1596 | } elseif ($message_type == 'send_enquiry') { |
1597 | - $subject = __(get_option('email_enquiry_subject'),'geodirectory'); |
|
1598 | - $message = __(get_option('email_enquiry_content'),'geodirectory'); |
|
1597 | + $subject = __(get_option('email_enquiry_subject'), 'geodirectory'); |
|
1598 | + $message = __(get_option('email_enquiry_content'), 'geodirectory'); |
|
1599 | 1599 | } elseif ($message_type == 'forgot_password') { |
1600 | - $subject = __(get_option('forgot_password_subject'),'geodirectory'); |
|
1601 | - $message = __(get_option('forgot_password_content'),'geodirectory'); |
|
1600 | + $subject = __(get_option('forgot_password_subject'), 'geodirectory'); |
|
1601 | + $message = __(get_option('forgot_password_content'), 'geodirectory'); |
|
1602 | 1602 | $login_details = $to_message; |
1603 | 1603 | } elseif ($message_type == 'registration') { |
1604 | - $subject = __(get_option('registration_success_email_subject'),'geodirectory'); |
|
1605 | - $message = __(get_option('registration_success_email_content'),'geodirectory'); |
|
1604 | + $subject = __(get_option('registration_success_email_subject'), 'geodirectory'); |
|
1605 | + $message = __(get_option('registration_success_email_content'), 'geodirectory'); |
|
1606 | 1606 | $login_details = $to_message; |
1607 | 1607 | } |
1608 | 1608 | $to_message = nl2br($to_message); |
@@ -1610,11 +1610,11 @@ discard block |
||
1610 | 1610 | $sitefromEmailName = get_site_emailName(); |
1611 | 1611 | $productlink = get_permalink($post_id); |
1612 | 1612 | $post_info = get_post($post_id); |
1613 | - $listingLink = '<a href="' . $productlink . '"><b>' . $post_info->post_title . '</b></a>'; |
|
1613 | + $listingLink = '<a href="'.$productlink.'"><b>'.$post_info->post_title.'</b></a>'; |
|
1614 | 1614 | $siteurl = home_url(); |
1615 | - $siteurl_link = '<a href="' . $siteurl . '">' . $siteurl . '</a>'; |
|
1615 | + $siteurl_link = '<a href="'.$siteurl.'">'.$siteurl.'</a>'; |
|
1616 | 1616 | $loginurl = geodir_login_url(); |
1617 | - $loginurl_link = '<a href="' . $loginurl . '">login</a>'; |
|
1617 | + $loginurl_link = '<a href="'.$loginurl.'">login</a>'; |
|
1618 | 1618 | if ($fromEmail == '') { |
1619 | 1619 | $fromEmail = get_option('site_email'); |
1620 | 1620 | } |
@@ -1628,26 +1628,26 @@ discard block |
||
1628 | 1628 | $search_array = array('[#listing_link#]', '[#site_name_url#]', '[#post_id#]', '[#site_name#]', '[#to_name#]', '[#from_name#]', '[#subject#]', '[#client_name#]'); |
1629 | 1629 | $replace_array = array($listingLink, $siteurl_link, $post_id, $sitefromEmailName, $toEmailName, $fromEmailName, $to_subject, $toEmailName); |
1630 | 1630 | $subject = str_replace($search_array, $replace_array, $subject); |
1631 | - $headers = 'MIME-Version: 1.0' . "\r\n"; |
|
1632 | - $headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n"; |
|
1633 | - $headers .= "Reply-To: " . $fromEmail . "\r\n"; |
|
1634 | - $headers .= 'From: ' . $sitefromEmailName . ' <' . $sitefromEmail . '>' . "\r\n"; |
|
1631 | + $headers = 'MIME-Version: 1.0'."\r\n"; |
|
1632 | + $headers .= 'Content-type: text/html; charset=UTF-8'."\r\n"; |
|
1633 | + $headers .= "Reply-To: ".$fromEmail."\r\n"; |
|
1634 | + $headers .= 'From: '.$sitefromEmailName.' <'.$sitefromEmail.'>'."\r\n"; |
|
1635 | 1635 | |
1636 | 1636 | $to = $toEmail; |
1637 | 1637 | |
1638 | 1638 | $sent = wp_mail($to, $subject, $message, $headers); |
1639 | - if( ! $sent ) { |
|
1640 | - if ( is_array( $to ) ) { |
|
1641 | - $to = implode( ',', $to ); |
|
1639 | + if (!$sent) { |
|
1640 | + if (is_array($to)) { |
|
1641 | + $to = implode(',', $to); |
|
1642 | 1642 | } |
1643 | 1643 | $log_message = sprintf( |
1644 | - __( "Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory' ), |
|
1644 | + __("Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory'), |
|
1645 | 1645 | $message_type, |
1646 | - date_i18n( 'F j Y H:i:s', current_time( 'timestamp' ) ), |
|
1646 | + date_i18n('F j Y H:i:s', current_time('timestamp')), |
|
1647 | 1647 | $to, |
1648 | 1648 | $subject |
1649 | 1649 | ); |
1650 | - geodir_error_log( $log_message ); |
|
1650 | + geodir_error_log($log_message); |
|
1651 | 1651 | } |
1652 | 1652 | |
1653 | 1653 | ///////// ADMIN BCC EMIALS |
@@ -1655,7 +1655,7 @@ discard block |
||
1655 | 1655 | if ($message_type == 'registration') { |
1656 | 1656 | $message_raw = explode(__("Password:", 'geodirectory'), $message); |
1657 | 1657 | $message_raw2 = explode("</p>", $message_raw[1], 2); |
1658 | - $message = $message_raw[0] . __('Password:', 'geodirectory') . ' **********</p>' . $message_raw2[1]; |
|
1658 | + $message = $message_raw[0].__('Password:', 'geodirectory').' **********</p>'.$message_raw2[1]; |
|
1659 | 1659 | } |
1660 | 1660 | $adminEmail = get_bloginfo('admin_email'); |
1661 | 1661 | $to = $adminEmail; |
@@ -1673,20 +1673,20 @@ discard block |
||
1673 | 1673 | $admin_bcc = true; |
1674 | 1674 | } |
1675 | 1675 | |
1676 | - if($admin_bcc === true){ |
|
1676 | + if ($admin_bcc === true) { |
|
1677 | 1677 | $sent = wp_mail($to, $subject, $message, $headers); |
1678 | - if( ! $sent ) { |
|
1679 | - if ( is_array( $to ) ) { |
|
1680 | - $to = implode( ',', $to ); |
|
1678 | + if (!$sent) { |
|
1679 | + if (is_array($to)) { |
|
1680 | + $to = implode(',', $to); |
|
1681 | 1681 | } |
1682 | 1682 | $log_message = sprintf( |
1683 | - __( "Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory' ), |
|
1683 | + __("Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory'), |
|
1684 | 1684 | $message_type, |
1685 | - date_i18n( 'F j Y H:i:s', current_time( 'timestamp' ) ), |
|
1685 | + date_i18n('F j Y H:i:s', current_time('timestamp')), |
|
1686 | 1686 | $to, |
1687 | 1687 | $subject |
1688 | 1688 | ); |
1689 | - geodir_error_log( $log_message ); |
|
1689 | + geodir_error_log($log_message); |
|
1690 | 1690 | } |
1691 | 1691 | } |
1692 | 1692 | |
@@ -1734,7 +1734,7 @@ discard block |
||
1734 | 1734 | function geodir_custom_posts_body_class($classes) { |
1735 | 1735 | global $wpdb, $wp; |
1736 | 1736 | $post_types = geodir_get_posttypes('object'); |
1737 | - if (!empty($post_types) && count((array)$post_types) > 1) { |
|
1737 | + if (!empty($post_types) && count((array) $post_types) > 1) { |
|
1738 | 1738 | $classes[] = 'geodir_custom_posts'; |
1739 | 1739 | } |
1740 | 1740 | |
@@ -1794,7 +1794,7 @@ discard block |
||
1794 | 1794 | $geodir_option = get_option($geodir_option_name); |
1795 | 1795 | |
1796 | 1796 | if (!empty($geodir_option)) { |
1797 | - add_option($geodir_option_name . '_' . $version_date, $geodir_option); |
|
1797 | + add_option($geodir_option_name.'_'.$version_date, $geodir_option); |
|
1798 | 1798 | } |
1799 | 1799 | } |
1800 | 1800 | |
@@ -1900,36 +1900,36 @@ discard block |
||
1900 | 1900 | |
1901 | 1901 | $query_args = $gd_query_args_widgets; |
1902 | 1902 | if (empty($query_args) || empty($query_args['is_geodir_loop'])) { |
1903 | - return $wpdb->posts . ".post_date DESC, "; |
|
1903 | + return $wpdb->posts.".post_date DESC, "; |
|
1904 | 1904 | } |
1905 | 1905 | |
1906 | 1906 | $post_type = empty($query_args['post_type']) ? 'gd_place' : $query_args['post_type']; |
1907 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
1907 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
1908 | 1908 | |
1909 | 1909 | $sort_by = !empty($query_args['order_by']) ? $query_args['order_by'] : ''; |
1910 | 1910 | |
1911 | 1911 | switch ($sort_by) { |
1912 | 1912 | case 'latest': |
1913 | 1913 | case 'newest': |
1914 | - $orderby = $wpdb->posts . ".post_date DESC, "; |
|
1914 | + $orderby = $wpdb->posts.".post_date DESC, "; |
|
1915 | 1915 | break; |
1916 | 1916 | case 'featured': |
1917 | - $orderby = $table . ".is_featured ASC, "; |
|
1917 | + $orderby = $table.".is_featured ASC, "; |
|
1918 | 1918 | break; |
1919 | 1919 | case 'az': |
1920 | - $orderby = $wpdb->posts . ".post_title ASC, "; |
|
1920 | + $orderby = $wpdb->posts.".post_title ASC, "; |
|
1921 | 1921 | break; |
1922 | 1922 | case 'high_review': |
1923 | - $orderby = $table . ".rating_count DESC, " . $table . ".overall_rating DESC, "; |
|
1923 | + $orderby = $table.".rating_count DESC, ".$table.".overall_rating DESC, "; |
|
1924 | 1924 | break; |
1925 | 1925 | case 'high_rating': |
1926 | - $orderby = "( " . $table . ".overall_rating ) DESC, "; |
|
1926 | + $orderby = "( ".$table.".overall_rating ) DESC, "; |
|
1927 | 1927 | break; |
1928 | 1928 | case 'random': |
1929 | 1929 | $orderby = "RAND(), "; |
1930 | 1930 | break; |
1931 | 1931 | default: |
1932 | - $orderby = $wpdb->posts . ".post_title ASC, "; |
|
1932 | + $orderby = $wpdb->posts.".post_title ASC, "; |
|
1933 | 1933 | break; |
1934 | 1934 | } |
1935 | 1935 | |
@@ -1956,9 +1956,9 @@ discard block |
||
1956 | 1956 | $gd_query_args_widgets = $query_args; |
1957 | 1957 | |
1958 | 1958 | $post_type = empty($query_args['post_type']) ? 'gd_place' : $query_args['post_type']; |
1959 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
1959 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
1960 | 1960 | |
1961 | - $fields = $wpdb->posts . ".*, " . $table . ".*"; |
|
1961 | + $fields = $wpdb->posts.".*, ".$table.".*"; |
|
1962 | 1962 | /** |
1963 | 1963 | * Filter widget listing fields string part that is being used for query. |
1964 | 1964 | * |
@@ -1969,7 +1969,7 @@ discard block |
||
1969 | 1969 | */ |
1970 | 1970 | $fields = apply_filters('geodir_filter_widget_listings_fields', $fields, $table, $post_type); |
1971 | 1971 | |
1972 | - $join = "INNER JOIN " . $table . " ON (" . $table . ".post_id = " . $wpdb->posts . ".ID)"; |
|
1972 | + $join = "INNER JOIN ".$table." ON (".$table.".post_id = ".$wpdb->posts.".ID)"; |
|
1973 | 1973 | |
1974 | 1974 | ########### WPML ########### |
1975 | 1975 | |
@@ -1977,7 +1977,7 @@ discard block |
||
1977 | 1977 | global $sitepress; |
1978 | 1978 | $lang_code = ICL_LANGUAGE_CODE; |
1979 | 1979 | if ($lang_code) { |
1980 | - $join .= " JOIN " . $table_prefix . "icl_translations icl_t ON icl_t.element_id = " . $table_prefix . "posts.ID"; |
|
1980 | + $join .= " JOIN ".$table_prefix."icl_translations icl_t ON icl_t.element_id = ".$table_prefix."posts.ID"; |
|
1981 | 1981 | } |
1982 | 1982 | } |
1983 | 1983 | |
@@ -1992,9 +1992,9 @@ discard block |
||
1992 | 1992 | */ |
1993 | 1993 | $join = apply_filters('geodir_filter_widget_listings_join', $join, $post_type); |
1994 | 1994 | |
1995 | - $post_status = is_super_admin() ? " OR " . $wpdb->posts . ".post_status = 'private'" : ''; |
|
1995 | + $post_status = is_super_admin() ? " OR ".$wpdb->posts.".post_status = 'private'" : ''; |
|
1996 | 1996 | |
1997 | - $where = " AND ( " . $wpdb->posts . ".post_status = 'publish' " . $post_status . " ) AND " . $wpdb->posts . ".post_type = '" . $post_type . "'"; |
|
1997 | + $where = " AND ( ".$wpdb->posts.".post_status = 'publish' ".$post_status." ) AND ".$wpdb->posts.".post_type = '".$post_type."'"; |
|
1998 | 1998 | |
1999 | 1999 | ########### WPML ########### |
2000 | 2000 | if (function_exists('icl_object_id')) { |
@@ -2011,7 +2011,7 @@ discard block |
||
2011 | 2011 | * @param string $post_type Post type. |
2012 | 2012 | */ |
2013 | 2013 | $where = apply_filters('geodir_filter_widget_listings_where', $where, $post_type); |
2014 | - $where = $where != '' ? " WHERE 1=1 " . $where : ''; |
|
2014 | + $where = $where != '' ? " WHERE 1=1 ".$where : ''; |
|
2015 | 2015 | |
2016 | 2016 | $groupby = " GROUP BY $wpdb->posts.ID "; |
2017 | 2017 | /** |
@@ -2024,10 +2024,10 @@ discard block |
||
2024 | 2024 | $groupby = apply_filters('geodir_filter_widget_listings_groupby', $groupby, $post_type); |
2025 | 2025 | |
2026 | 2026 | if ($count_only) { |
2027 | - $sql = "SELECT COUNT(" . $wpdb->posts . ".ID) AS total FROM " . $wpdb->posts . " |
|
2028 | - " . $join . " |
|
2027 | + $sql = "SELECT COUNT(".$wpdb->posts.".ID) AS total FROM ".$wpdb->posts." |
|
2028 | + " . $join." |
|
2029 | 2029 | " . $where; |
2030 | - $rows = (int)$wpdb->get_var($sql); |
|
2030 | + $rows = (int) $wpdb->get_var($sql); |
|
2031 | 2031 | } else { |
2032 | 2032 | $orderby = geodir_widget_listings_get_order($query_args); |
2033 | 2033 | /** |
@@ -2039,8 +2039,8 @@ discard block |
||
2039 | 2039 | * @param string $post_type Post type. |
2040 | 2040 | */ |
2041 | 2041 | $orderby = apply_filters('geodir_filter_widget_listings_orderby', $orderby, $table, $post_type); |
2042 | - $orderby .= $wpdb->posts . ".post_title ASC"; |
|
2043 | - $orderby = $orderby != '' ? " ORDER BY " . $orderby : ''; |
|
2042 | + $orderby .= $wpdb->posts.".post_title ASC"; |
|
2043 | + $orderby = $orderby != '' ? " ORDER BY ".$orderby : ''; |
|
2044 | 2044 | |
2045 | 2045 | $limit = !empty($query_args['posts_per_page']) ? $query_args['posts_per_page'] : 5; |
2046 | 2046 | /** |
@@ -2053,16 +2053,16 @@ discard block |
||
2053 | 2053 | $limit = apply_filters('geodir_filter_widget_listings_limit', $limit, $post_type); |
2054 | 2054 | |
2055 | 2055 | $page = !empty($query_args['pageno']) ? absint($query_args['pageno']) : 1; |
2056 | - if ( !$page ) |
|
2056 | + if (!$page) |
|
2057 | 2057 | $page = 1; |
2058 | 2058 | |
2059 | - $limit = (int)$limit > 0 ? " LIMIT " . absint( ( $page - 1 ) * (int)$limit ) . ", " . (int)$limit : ""; |
|
2059 | + $limit = (int) $limit > 0 ? " LIMIT ".absint(($page - 1) * (int) $limit).", ".(int) $limit : ""; |
|
2060 | 2060 | |
2061 | - $sql = "SELECT SQL_CALC_FOUND_ROWS " . $fields . " FROM " . $wpdb->posts . " |
|
2062 | - " . $join . " |
|
2063 | - " . $where . " |
|
2064 | - " . $groupby . " |
|
2065 | - " . $orderby . " |
|
2061 | + $sql = "SELECT SQL_CALC_FOUND_ROWS ".$fields." FROM ".$wpdb->posts." |
|
2062 | + " . $join." |
|
2063 | + " . $where." |
|
2064 | + " . $groupby." |
|
2065 | + " . $orderby." |
|
2066 | 2066 | " . $limit; |
2067 | 2067 | $rows = $wpdb->get_results($sql); |
2068 | 2068 | } |
@@ -2115,10 +2115,10 @@ discard block |
||
2115 | 2115 | } |
2116 | 2116 | |
2117 | 2117 | $post_type = empty($query_args['post_type']) ? 'gd_place' : $query_args['post_type']; |
2118 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
2118 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
2119 | 2119 | |
2120 | 2120 | if (!empty($query_args['with_pics_only'])) { |
2121 | - $join .= " LEFT JOIN " . GEODIR_ATTACHMENT_TABLE . " ON ( " . GEODIR_ATTACHMENT_TABLE . ".post_id=" . $table . ".post_id AND " . GEODIR_ATTACHMENT_TABLE . ".mime_type LIKE '%image%' )"; |
|
2121 | + $join .= " LEFT JOIN ".GEODIR_ATTACHMENT_TABLE." ON ( ".GEODIR_ATTACHMENT_TABLE.".post_id=".$table.".post_id AND ".GEODIR_ATTACHMENT_TABLE.".mime_type LIKE '%image%' )"; |
|
2122 | 2122 | } |
2123 | 2123 | |
2124 | 2124 | if (!empty($query_args['tax_query'])) { |
@@ -2150,7 +2150,7 @@ discard block |
||
2150 | 2150 | return $where; |
2151 | 2151 | } |
2152 | 2152 | $post_type = empty($query_args['post_type']) ? 'gd_place' : $query_args['post_type']; |
2153 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
2153 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
2154 | 2154 | |
2155 | 2155 | if (!empty($query_args)) { |
2156 | 2156 | if (!empty($query_args['gd_location']) && function_exists('geodir_default_location_where')) { |
@@ -2158,27 +2158,27 @@ discard block |
||
2158 | 2158 | } |
2159 | 2159 | |
2160 | 2160 | if (!empty($query_args['post_author'])) { |
2161 | - $where .= " AND " . $wpdb->posts . ".post_author = " . (int)$query_args['post_author']; |
|
2161 | + $where .= " AND ".$wpdb->posts.".post_author = ".(int) $query_args['post_author']; |
|
2162 | 2162 | } |
2163 | 2163 | |
2164 | 2164 | if (!empty($query_args['show_featured_only'])) { |
2165 | - $where .= " AND " . $table . ".is_featured = '1'"; |
|
2165 | + $where .= " AND ".$table.".is_featured = '1'"; |
|
2166 | 2166 | } |
2167 | 2167 | |
2168 | 2168 | if (!empty($query_args['show_special_only'])) { |
2169 | - $where .= " AND ( " . $table . ".geodir_special_offers != '' AND " . $table . ".geodir_special_offers IS NOT NULL )"; |
|
2169 | + $where .= " AND ( ".$table.".geodir_special_offers != '' AND ".$table.".geodir_special_offers IS NOT NULL )"; |
|
2170 | 2170 | } |
2171 | 2171 | |
2172 | 2172 | if (!empty($query_args['with_pics_only'])) { |
2173 | - $where .= " AND " . GEODIR_ATTACHMENT_TABLE . ".ID IS NOT NULL "; |
|
2173 | + $where .= " AND ".GEODIR_ATTACHMENT_TABLE.".ID IS NOT NULL "; |
|
2174 | 2174 | } |
2175 | 2175 | |
2176 | 2176 | if (!empty($query_args['featured_image_only'])) { |
2177 | - $where .= " AND " . $table . ".featured_image IS NOT NULL AND " . $table . ".featured_image!='' "; |
|
2177 | + $where .= " AND ".$table.".featured_image IS NOT NULL AND ".$table.".featured_image!='' "; |
|
2178 | 2178 | } |
2179 | 2179 | |
2180 | 2180 | if (!empty($query_args['with_videos_only'])) { |
2181 | - $where .= " AND ( " . $table . ".geodir_video != '' AND " . $table . ".geodir_video IS NOT NULL )"; |
|
2181 | + $where .= " AND ( ".$table.".geodir_video != '' AND ".$table.".geodir_video IS NOT NULL )"; |
|
2182 | 2182 | } |
2183 | 2183 | |
2184 | 2184 | if (!empty($query_args['tax_query'])) { |
@@ -2235,7 +2235,7 @@ discard block |
||
2235 | 2235 | } |
2236 | 2236 | |
2237 | 2237 | if (!empty($query_args) && !empty($query_args['posts_per_page'])) { |
2238 | - $limit = (int)$query_args['posts_per_page']; |
|
2238 | + $limit = (int) $query_args['posts_per_page']; |
|
2239 | 2239 | } |
2240 | 2240 | |
2241 | 2241 | return $limit; |
@@ -2378,9 +2378,9 @@ discard block |
||
2378 | 2378 | add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2); |
2379 | 2379 | } |
2380 | 2380 | $home_url = str_replace("www.", "", $home_url); |
2381 | - if ( (strpos($home_url, $cur_url) !== false || strpos($home_url . '/', $cur_url) !== false) && ('page' == get_option('show_on_front') && get_option('page_on_front') && get_option('page_on_front')==get_option('geodir_home_page')) ) { |
|
2381 | + if ((strpos($home_url, $cur_url) !== false || strpos($home_url.'/', $cur_url) !== false) && ('page' == get_option('show_on_front') && get_option('page_on_front') && get_option('page_on_front') == get_option('geodir_home_page'))) { |
|
2382 | 2382 | return true; |
2383 | - }elseif(get_query_var('page_id') == get_option('page_on_front') && 'page' == get_option('show_on_front') && get_option('page_on_front') && get_option('page_on_front')==get_option('geodir_home_page')){ |
|
2383 | + }elseif (get_query_var('page_id') == get_option('page_on_front') && 'page' == get_option('show_on_front') && get_option('page_on_front') && get_option('page_on_front') == get_option('geodir_home_page')) { |
|
2384 | 2384 | return true; |
2385 | 2385 | } else { |
2386 | 2386 | return false; |
@@ -2463,19 +2463,19 @@ discard block |
||
2463 | 2463 | |
2464 | 2464 | $gd_post_type = geodir_get_current_posttype(); |
2465 | 2465 | |
2466 | - $category_limit = isset($instance['category_limit']) && $instance['category_limit'] > 0 ? (int)$instance['category_limit'] : 15; |
|
2467 | - if(!empty($gd_post_type)){ |
|
2466 | + $category_limit = isset($instance['category_limit']) && $instance['category_limit'] > 0 ? (int) $instance['category_limit'] : 15; |
|
2467 | + if (!empty($gd_post_type)) { |
|
2468 | 2468 | $default_post_type = $gd_post_type; |
2469 | - }elseif(isset($instance['default_post_type']) && gdsc_is_post_type_valid($instance['default_post_type']) ){ |
|
2469 | + }elseif (isset($instance['default_post_type']) && gdsc_is_post_type_valid($instance['default_post_type'])) { |
|
2470 | 2470 | $default_post_type = $instance['default_post_type']; |
2471 | - }else{ |
|
2471 | + } else { |
|
2472 | 2472 | $all_gd_post_type = geodir_get_posttypes(); |
2473 | 2473 | $default_post_type = (isset($all_gd_post_type[0])) ? $all_gd_post_type[0] : ''; |
2474 | 2474 | } |
2475 | 2475 | |
2476 | 2476 | $taxonomy = array(); |
2477 | 2477 | if (!empty($gd_post_type)) { |
2478 | - $taxonomy[] = $gd_post_type . "category"; |
|
2478 | + $taxonomy[] = $gd_post_type."category"; |
|
2479 | 2479 | } else { |
2480 | 2480 | $taxonomy = geodir_get_taxonomies($gd_post_type); |
2481 | 2481 | } |
@@ -2495,7 +2495,7 @@ discard block |
||
2495 | 2495 | $b_terms[$b_key] = geodir_sort_terms($b_val, 'count'); |
2496 | 2496 | } |
2497 | 2497 | |
2498 | - $default_taxonomy = $default_post_type != '' && isset($b_terms[$default_post_type . 'category']) ? $default_post_type . 'category' : ''; |
|
2498 | + $default_taxonomy = $default_post_type != '' && isset($b_terms[$default_post_type.'category']) ? $default_post_type.'category' : ''; |
|
2499 | 2499 | |
2500 | 2500 | $tax_change_output = ''; |
2501 | 2501 | if (count($b_terms) > 1) { |
@@ -2503,20 +2503,20 @@ discard block |
||
2503 | 2503 | foreach ($b_terms as $key => $val) { |
2504 | 2504 | $ptype = get_post_type_object(str_replace("category", "", $key)); |
2505 | 2505 | $cpt_name = __($ptype->labels->singular_name, 'geodirectory'); |
2506 | - $tax_change_output .= "<option value='$key' ". selected($key, $default_taxonomy, false) .">" . sprintf(__('%s Categories', 'geodirectory'),$cpt_name) . "</option>"; |
|
2506 | + $tax_change_output .= "<option value='$key' ".selected($key, $default_taxonomy, false).">".sprintf(__('%s Categories', 'geodirectory'), $cpt_name)."</option>"; |
|
2507 | 2507 | } |
2508 | 2508 | $tax_change_output .= "</select>"; |
2509 | 2509 | } |
2510 | 2510 | |
2511 | 2511 | if (!empty($b_terms)) { |
2512 | - $terms = $default_taxonomy != '' && isset($b_terms[$default_taxonomy]) ? $b_terms[$default_taxonomy] : reset($b_terms);// get the first array |
|
2513 | - global $cat_count;//make global so we can change via function |
|
2512 | + $terms = $default_taxonomy != '' && isset($b_terms[$default_taxonomy]) ? $b_terms[$default_taxonomy] : reset($b_terms); // get the first array |
|
2513 | + global $cat_count; //make global so we can change via function |
|
2514 | 2514 | $cat_count = 0; |
2515 | 2515 | ?> |
2516 | 2516 | <div class="geodir-category-list-in clearfix"> |
2517 | 2517 | <div class="geodir-cat-list clearfix"> |
2518 | 2518 | <?php |
2519 | - echo $before_title . __($title) . $after_title; |
|
2519 | + echo $before_title.__($title).$after_title; |
|
2520 | 2520 | |
2521 | 2521 | echo $tax_change_output; |
2522 | 2522 | |
@@ -2533,8 +2533,8 @@ discard block |
||
2533 | 2533 | $hide = 'style="display:none;"'; |
2534 | 2534 | } |
2535 | 2535 | echo "<div class='geodir-cat-list-more' $hide >"; |
2536 | - echo '<a href="javascript:void(0)" class="geodir-morecat geodir-showcat">' . __('More Categories', 'geodirectory') . '</a>'; |
|
2537 | - echo '<a href="javascript:void(0)" class="geodir-morecat geodir-hidecat geodir-hide">' . __('Less Categories', 'geodirectory') . '</a>'; |
|
2536 | + echo '<a href="javascript:void(0)" class="geodir-morecat geodir-showcat">'.__('More Categories', 'geodirectory').'</a>'; |
|
2537 | + echo '<a href="javascript:void(0)" class="geodir-morecat geodir-hidecat geodir-hide">'.__('Less Categories', 'geodirectory').'</a>'; |
|
2538 | 2538 | echo "</div>"; |
2539 | 2539 | /* add scripts */ |
2540 | 2540 | add_action('wp_footer', 'geodir_popular_category_add_scripts', 100); |
@@ -2574,7 +2574,7 @@ discard block |
||
2574 | 2574 | $class_row = $cat_count > $category_limit ? 'geodir-pcat-hide geodir-hide' : 'geodir-pcat-show'; |
2575 | 2575 | $total_post = $cat->count; |
2576 | 2576 | |
2577 | - $term_link = get_term_link( $cat, $cat->taxonomy ); |
|
2577 | + $term_link = get_term_link($cat, $cat->taxonomy); |
|
2578 | 2578 | /** |
2579 | 2579 | * Filer the category term link. |
2580 | 2580 | * |
@@ -2583,10 +2583,10 @@ discard block |
||
2583 | 2583 | * @param int $cat->term_id The term id. |
2584 | 2584 | * @param string $post_type Wordpress post type. |
2585 | 2585 | */ |
2586 | - $term_link = apply_filters( 'geodir_category_term_link', $term_link, $cat->term_id, $post_type ); |
|
2586 | + $term_link = apply_filters('geodir_category_term_link', $term_link, $cat->term_id, $post_type); |
|
2587 | 2587 | |
2588 | - echo '<li class="' . $class_row . '"><a href="' . $term_link . '">'; |
|
2589 | - echo '<img alt="' . esc_attr($cat->name) . ' icon" style="height:20px;vertical-align:middle;" src="' . $term_icon_url . '"/> <span class="cat-link">'; echo $cat->name . '</span> <span class="geodir_term_class geodir_link_span geodir_category_class_' . $post_type . '_' . $cat->term_id . '">(' . $total_post . ')</span> '; |
|
2588 | + echo '<li class="'.$class_row.'"><a href="'.$term_link.'">'; |
|
2589 | + echo '<img alt="'.esc_attr($cat->name).' icon" style="height:20px;vertical-align:middle;" src="'.$term_icon_url.'"/> <span class="cat-link">'; echo $cat->name.'</span> <span class="geodir_term_class geodir_link_span geodir_category_class_'.$post_type.'_'.$cat->term_id.'">('.$total_post.')</span> '; |
|
2590 | 2590 | echo '</a></li>'; |
2591 | 2591 | } |
2592 | 2592 | } |
@@ -2717,29 +2717,29 @@ discard block |
||
2717 | 2717 | itemWidth: 75, |
2718 | 2718 | itemMargin: 5, |
2719 | 2719 | asNavFor: '#geodir_widget_slider', |
2720 | - rtl: <?php echo ( is_rtl() ? 'true' : 'false' ); /* fix rtl issue */ ?> |
|
2720 | + rtl: <?php echo (is_rtl() ? 'true' : 'false'); /* fix rtl issue */ ?> |
|
2721 | 2721 | }); |
2722 | 2722 | |
2723 | 2723 | jQuery('#geodir_widget_slider').flexslider({ |
2724 | - animation: "<?php echo $animation;?>", |
|
2724 | + animation: "<?php echo $animation; ?>", |
|
2725 | 2725 | selector: ".geodir-slides > li", |
2726 | 2726 | namespace: "geodir-", |
2727 | 2727 | controlNav: true, |
2728 | - animationLoop: <?php echo $animationLoop;?>, |
|
2729 | - slideshow: <?php echo $slideshow;?>, |
|
2730 | - slideshowSpeed: <?php echo $slideshowSpeed;?>, |
|
2731 | - animationSpeed: <?php echo $animationSpeed;?>, |
|
2732 | - directionNav: <?php echo $directionNav;?>, |
|
2733 | - maxItems: <?php echo $max_show;?>, |
|
2728 | + animationLoop: <?php echo $animationLoop; ?>, |
|
2729 | + slideshow: <?php echo $slideshow; ?>, |
|
2730 | + slideshowSpeed: <?php echo $slideshowSpeed; ?>, |
|
2731 | + animationSpeed: <?php echo $animationSpeed; ?>, |
|
2732 | + directionNav: <?php echo $directionNav; ?>, |
|
2733 | + maxItems: <?php echo $max_show; ?>, |
|
2734 | 2734 | move: 1, |
2735 | - <?php if($slide_width){ echo "itemWidth: ".$slide_width.",";}?> |
|
2735 | + <?php if ($slide_width) { echo "itemWidth: ".$slide_width.","; }?> |
|
2736 | 2736 | sync: "#geodir_widget_carousel", |
2737 | 2737 | start: function (slider) { |
2738 | 2738 | jQuery('.geodir-listing-flex-loader').hide(); |
2739 | 2739 | jQuery('#geodir_widget_slider').css({'visibility': 'visible'}); |
2740 | 2740 | jQuery('#geodir_widget_carousel').css({'visibility': 'visible'}); |
2741 | 2741 | }, |
2742 | - rtl: <?php echo ( is_rtl() ? 'true' : 'false' ); /* fix rtl issue */ ?> |
|
2742 | + rtl: <?php echo (is_rtl() ? 'true' : 'false'); /* fix rtl issue */ ?> |
|
2743 | 2743 | }); |
2744 | 2744 | }); |
2745 | 2745 | </script> |
@@ -2775,12 +2775,12 @@ discard block |
||
2775 | 2775 | $widget_listings = geodir_get_widget_listings($query_args); |
2776 | 2776 | if (!empty($widget_listings) || (isset($with_no_results) && $with_no_results)) { |
2777 | 2777 | if ($title) { |
2778 | - echo $before_title . $title . $after_title; |
|
2778 | + echo $before_title.$title.$after_title; |
|
2779 | 2779 | } |
2780 | 2780 | |
2781 | 2781 | global $post; |
2782 | 2782 | |
2783 | - $current_post = $post;// keep current post info |
|
2783 | + $current_post = $post; // keep current post info |
|
2784 | 2784 | |
2785 | 2785 | $widget_main_slides = ''; |
2786 | 2786 | $nav_slides = ''; |
@@ -2798,11 +2798,11 @@ discard block |
||
2798 | 2798 | $widget_spacer_height = ((200 - $widget_image->height) / 2); |
2799 | 2799 | } |
2800 | 2800 | |
2801 | - $widget_main_slides .= '<li class="geodir-listing-slider-widget"><img class="geodir-listing-slider-spacer" src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $widget_image->title . '" title="' . $widget_image->title . '" style="max-height:' . $widget_spacer_height . 'px !important;margin:0 auto;" width="100" />'; |
|
2801 | + $widget_main_slides .= '<li class="geodir-listing-slider-widget"><img class="geodir-listing-slider-spacer" src="'.geodir_plugin_url()."/geodirectory-assets/images/spacer.gif".'" alt="'.$widget_image->title.'" title="'.$widget_image->title.'" style="max-height:'.$widget_spacer_height.'px !important;margin:0 auto;" width="100" />'; |
|
2802 | 2802 | |
2803 | 2803 | $title = ''; |
2804 | 2804 | if ($show_title) { |
2805 | - $title_html = '<div class="geodir-slider-title"><a href="' . get_permalink($post->ID) . '">' . get_the_title($post->ID) . '</a></div>'; |
|
2805 | + $title_html = '<div class="geodir-slider-title"><a href="'.get_permalink($post->ID).'">'.get_the_title($post->ID).'</a></div>'; |
|
2806 | 2806 | $post_id = $post->ID; |
2807 | 2807 | $post_permalink = get_permalink($post->ID); |
2808 | 2808 | $post_title = get_the_title($post->ID); |
@@ -2815,11 +2815,11 @@ discard block |
||
2815 | 2815 | * @param string $post_permalink The post permalink url. |
2816 | 2816 | * @param string $post_title The post title text. |
2817 | 2817 | */ |
2818 | - $title = apply_filters('geodir_listing_slider_title',$title_html,$post_id,$post_permalink,$post_title); |
|
2818 | + $title = apply_filters('geodir_listing_slider_title', $title_html, $post_id, $post_permalink, $post_title); |
|
2819 | 2819 | } |
2820 | 2820 | |
2821 | - $widget_main_slides .= $title . '<img src="' . $widget_image->src . '" alt="' . $widget_image->title . '" title="' . $widget_image->title . '" style="max-height:200px;margin:0 auto;" /></li>'; |
|
2822 | - $nav_slides .= '<li><img src="' . $widget_image->src . '" alt="' . $widget_image->title . '" title="' . $widget_image->title . '" style="max-height:48px;margin:0 auto;" /></li>'; |
|
2821 | + $widget_main_slides .= $title.'<img src="'.$widget_image->src.'" alt="'.$widget_image->title.'" title="'.$widget_image->title.'" style="max-height:200px;margin:0 auto;" /></li>'; |
|
2822 | + $nav_slides .= '<li><img src="'.$widget_image->src.'" alt="'.$widget_image->title.'" title="'.$widget_image->title.'" style="max-height:48px;margin:0 auto;" /></li>'; |
|
2823 | 2823 | $widget_slides++; |
2824 | 2824 | } |
2825 | 2825 | } |
@@ -2863,7 +2863,7 @@ discard block |
||
2863 | 2863 | $title = empty($instance['title']) ? __('My Dashboard', 'geodirectory') : apply_filters('widget_title', __($instance['title'], 'geodirectory')); |
2864 | 2864 | |
2865 | 2865 | echo $before_widget; |
2866 | - echo $before_title . $title . $after_title; |
|
2866 | + echo $before_title.$title.$after_title; |
|
2867 | 2867 | |
2868 | 2868 | if (is_user_logged_in()) { |
2869 | 2869 | global $current_user; |
@@ -2905,7 +2905,7 @@ discard block |
||
2905 | 2905 | */ |
2906 | 2906 | $add_link = apply_filters('geodir_dashboard_link_add_listing', $add_link, $key, $current_user->ID); |
2907 | 2907 | |
2908 | - $addlisting_links .= '<option ' . $selected . ' value="' . $add_link . '">' . __(ucfirst($name), 'geodirectory') . '</option>'; |
|
2908 | + $addlisting_links .= '<option '.$selected.' value="'.$add_link.'">'.__(ucfirst($name), 'geodirectory').'</option>'; |
|
2909 | 2909 | |
2910 | 2910 | } |
2911 | 2911 | } |
@@ -2951,7 +2951,7 @@ discard block |
||
2951 | 2951 | */ |
2952 | 2952 | $post_type_link = apply_filters('geodir_dashboard_link_favorite_listing', $post_type_link, $key, $current_user->ID); |
2953 | 2953 | |
2954 | - $favourite_links .= '<option ' . $selected . ' value="' . $post_type_link . '">' . __(ucfirst($name), 'geodirectory') . '</option>'; |
|
2954 | + $favourite_links .= '<option '.$selected.' value="'.$post_type_link.'">'.__(ucfirst($name), 'geodirectory').'</option>'; |
|
2955 | 2955 | } |
2956 | 2956 | } |
2957 | 2957 | |
@@ -2996,7 +2996,7 @@ discard block |
||
2996 | 2996 | */ |
2997 | 2997 | $listing_link = apply_filters('geodir_dashboard_link_my_listing', $listing_link, $key, $current_user->ID); |
2998 | 2998 | |
2999 | - $listing_links .= '<option ' . $selected . ' value="' . $listing_link . '">' . __(ucfirst($name), 'geodirectory') . '</option>'; |
|
2999 | + $listing_links .= '<option '.$selected.' value="'.$listing_link.'">'.__(ucfirst($name), 'geodirectory').'</option>'; |
|
3000 | 3000 | } |
3001 | 3001 | } |
3002 | 3002 | |
@@ -3179,7 +3179,7 @@ discard block |
||
3179 | 3179 | } |
3180 | 3180 | |
3181 | 3181 | if (empty($title) || $title == 'All') { |
3182 | - $title .= ' ' . __(get_post_type_plural_label($post_type), 'geodirectory'); |
|
3182 | + $title .= ' '.__(get_post_type_plural_label($post_type), 'geodirectory'); |
|
3183 | 3183 | } |
3184 | 3184 | |
3185 | 3185 | $location_url = array(); |
@@ -3233,7 +3233,7 @@ discard block |
||
3233 | 3233 | $geodir_add_location_url = '1'; |
3234 | 3234 | } |
3235 | 3235 | |
3236 | - $viewall_url = get_term_link((int)$category[0], $post_type . 'category'); |
|
3236 | + $viewall_url = get_term_link((int) $category[0], $post_type.'category'); |
|
3237 | 3237 | |
3238 | 3238 | $geodir_add_location_url = NULL; |
3239 | 3239 | } |
@@ -3241,7 +3241,7 @@ discard block |
||
3241 | 3241 | $gd_session->set('gd_multi_location', 1); |
3242 | 3242 | } |
3243 | 3243 | |
3244 | - if(is_wp_error( $viewall_url )){$viewall_url = '';} |
|
3244 | + if (is_wp_error($viewall_url)) {$viewall_url = ''; } |
|
3245 | 3245 | |
3246 | 3246 | $query_args = array( |
3247 | 3247 | 'posts_per_page' => $post_number, |
@@ -3307,7 +3307,7 @@ discard block |
||
3307 | 3307 | */ |
3308 | 3308 | do_action('geodir_before_view_all_link_in_widget'); ?> |
3309 | 3309 | <div class="geodir_list_heading clearfix"> |
3310 | - <?php echo $before_title . $title . $after_title; ?> |
|
3310 | + <?php echo $before_title.$title.$after_title; ?> |
|
3311 | 3311 | <a href="<?php echo $viewall_url; ?>" |
3312 | 3312 | class="geodir-viewall"><?php _e('View all', 'geodirectory'); ?></a> |
3313 | 3313 | </div> |
@@ -3393,9 +3393,9 @@ discard block |
||
3393 | 3393 | { |
3394 | 3394 | global $wpdb, $plugin_prefix; |
3395 | 3395 | |
3396 | - $detail_table = $plugin_prefix . $post_type . '_detail'; |
|
3396 | + $detail_table = $plugin_prefix.$post_type.'_detail'; |
|
3397 | 3397 | |
3398 | - $sql = "SELECT COALESCE(SUM(rating_count),0) FROM " . $detail_table . " WHERE post_status = 'publish' AND rating_count > 0 AND FIND_IN_SET(" . $term_id . ", " . $taxonomy . ")"; |
|
3398 | + $sql = "SELECT COALESCE(SUM(rating_count),0) FROM ".$detail_table." WHERE post_status = 'publish' AND rating_count > 0 AND FIND_IN_SET(".$term_id.", ".$taxonomy.")"; |
|
3399 | 3399 | |
3400 | 3400 | /** |
3401 | 3401 | * Filter count review sql query. |
@@ -3434,7 +3434,7 @@ discard block |
||
3434 | 3434 | * @param bool $force_update Force update option value?. Default.false. |
3435 | 3435 | * @param int $post_ID The post id to update if any. |
3436 | 3436 | */ |
3437 | - $option_data = apply_filters('geodir_count_reviews_by_terms_before', '', $force_update,$post_ID); |
|
3437 | + $option_data = apply_filters('geodir_count_reviews_by_terms_before', '', $force_update, $post_ID); |
|
3438 | 3438 | if (!empty($option_data)) { |
3439 | 3439 | return $option_data; |
3440 | 3440 | } |
@@ -3442,11 +3442,11 @@ discard block |
||
3442 | 3442 | $option_data = get_option('geodir_global_review_count'); |
3443 | 3443 | |
3444 | 3444 | if (!$option_data || $force_update) { |
3445 | - if ((int)$post_ID > 0) { // Update reviews count for specific post categories only. |
|
3445 | + if ((int) $post_ID > 0) { // Update reviews count for specific post categories only. |
|
3446 | 3446 | global $gd_session; |
3447 | - $term_array = (array)$option_data; |
|
3447 | + $term_array = (array) $option_data; |
|
3448 | 3448 | $post_type = get_post_type($post_ID); |
3449 | - $taxonomy = $post_type . 'category'; |
|
3449 | + $taxonomy = $post_type.'category'; |
|
3450 | 3450 | $terms = wp_get_object_terms($post_ID, $taxonomy, array('fields' => 'ids')); |
3451 | 3451 | |
3452 | 3452 | if (!empty($terms) && !is_wp_error($terms)) { |
@@ -3461,9 +3461,9 @@ discard block |
||
3461 | 3461 | |
3462 | 3462 | $terms = array(); |
3463 | 3463 | if (isset($_POST['post_category'][$taxonomy])) { |
3464 | - $terms = (array)$_POST['post_category'][$taxonomy]; |
|
3464 | + $terms = (array) $_POST['post_category'][$taxonomy]; |
|
3465 | 3465 | } else if (!empty($session_listing) && isset($session_listing['post_category'][$taxonomy])) { |
3466 | - $terms = (array)$session_listing['post_category'][$taxonomy]; |
|
3466 | + $terms = (array) $session_listing['post_category'][$taxonomy]; |
|
3467 | 3467 | } |
3468 | 3468 | |
3469 | 3469 | if (!empty($terms)) { |
@@ -3551,7 +3551,7 @@ discard block |
||
3551 | 3551 | return true; |
3552 | 3552 | } |
3553 | 3553 | |
3554 | -function geodir_term_review_count_force_update_single_post($post_id){ |
|
3554 | +function geodir_term_review_count_force_update_single_post($post_id) { |
|
3555 | 3555 | geodir_count_reviews_by_terms(true, $post_id); |
3556 | 3556 | } |
3557 | 3557 | |
@@ -3688,17 +3688,17 @@ discard block |
||
3688 | 3688 | */ |
3689 | 3689 | $locale = apply_filters('plugin_locale', get_locale(), 'geodirectory'); |
3690 | 3690 | |
3691 | - load_textdomain('geodirectory', WP_LANG_DIR . '/' . 'geodirectory' . '/' . 'geodirectory' . '-' . $locale . '.mo'); |
|
3692 | - load_plugin_textdomain('geodirectory', false, plugin_basename(dirname(dirname(__FILE__))) . '/geodirectory-languages'); |
|
3691 | + load_textdomain('geodirectory', WP_LANG_DIR.'/'.'geodirectory'.'/'.'geodirectory'.'-'.$locale.'.mo'); |
|
3692 | + load_plugin_textdomain('geodirectory', false, plugin_basename(dirname(dirname(__FILE__))).'/geodirectory-languages'); |
|
3693 | 3693 | |
3694 | 3694 | /** |
3695 | 3695 | * Define language constants. |
3696 | 3696 | * |
3697 | 3697 | * @since 1.0.0 |
3698 | 3698 | */ |
3699 | - require_once(geodir_plugin_path() . '/language.php'); |
|
3699 | + require_once(geodir_plugin_path().'/language.php'); |
|
3700 | 3700 | |
3701 | - $language_file = geodir_plugin_path() . '/db-language.php'; |
|
3701 | + $language_file = geodir_plugin_path().'/db-language.php'; |
|
3702 | 3702 | |
3703 | 3703 | // Load language string file if not created yet |
3704 | 3704 | if (!file_exists($language_file)) { |
@@ -3713,8 +3713,8 @@ discard block |
||
3713 | 3713 | */ |
3714 | 3714 | try { |
3715 | 3715 | require_once($language_file); |
3716 | - } catch(Exception $e) { |
|
3717 | - error_log('Language Error: ' . $e->getMessage()); |
|
3716 | + } catch (Exception $e) { |
|
3717 | + error_log('Language Error: '.$e->getMessage()); |
|
3718 | 3718 | } |
3719 | 3719 | } |
3720 | 3720 | } |
@@ -3731,18 +3731,18 @@ discard block |
||
3731 | 3731 | */ |
3732 | 3732 | function geodirectory_load_db_language() { |
3733 | 3733 | global $wp_filesystem; |
3734 | - if( empty( $wp_filesystem ) ) { |
|
3735 | - require_once( ABSPATH .'/wp-admin/includes/file.php' ); |
|
3734 | + if (empty($wp_filesystem)) { |
|
3735 | + require_once(ABSPATH.'/wp-admin/includes/file.php'); |
|
3736 | 3736 | WP_Filesystem(); |
3737 | 3737 | global $wp_filesystem; |
3738 | 3738 | } |
3739 | 3739 | |
3740 | - $language_file = geodir_plugin_path() . '/db-language.php'; |
|
3740 | + $language_file = geodir_plugin_path().'/db-language.php'; |
|
3741 | 3741 | |
3742 | - if(is_file($language_file) && !is_writable($language_file)) |
|
3742 | + if (is_file($language_file) && !is_writable($language_file)) |
|
3743 | 3743 | return false; // Not possible to create. |
3744 | 3744 | |
3745 | - if(!is_file($language_file) && !is_writable(dirname($language_file))) |
|
3745 | + if (!is_file($language_file) && !is_writable(dirname($language_file))) |
|
3746 | 3746 | return false; // Not possible to create. |
3747 | 3747 | |
3748 | 3748 | $contents_strings = array(); |
@@ -3776,17 +3776,17 @@ discard block |
||
3776 | 3776 | $contents = implode(PHP_EOL, $contents_head); |
3777 | 3777 | |
3778 | 3778 | if (!empty($contents_strings)) { |
3779 | - foreach ( $contents_strings as $string ) { |
|
3779 | + foreach ($contents_strings as $string) { |
|
3780 | 3780 | if (is_scalar($string) && $string != '') { |
3781 | 3781 | $string = str_replace("'", "\'", $string); |
3782 | - $contents .= PHP_EOL . "__('" . $string . "', 'geodirectory');"; |
|
3782 | + $contents .= PHP_EOL."__('".$string."', 'geodirectory');"; |
|
3783 | 3783 | } |
3784 | 3784 | } |
3785 | 3785 | } |
3786 | 3786 | |
3787 | 3787 | $contents .= implode(PHP_EOL, $contents_foot); |
3788 | 3788 | |
3789 | - if($wp_filesystem->put_contents( $language_file, $contents, FS_CHMOD_FILE)) |
|
3789 | + if ($wp_filesystem->put_contents($language_file, $contents, FS_CHMOD_FILE)) |
|
3790 | 3790 | return false; // Failure; could not write file. |
3791 | 3791 | |
3792 | 3792 | return true; |
@@ -3808,11 +3808,11 @@ discard block |
||
3808 | 3808 | global $wpdb; |
3809 | 3809 | |
3810 | 3810 | // Custom fields table |
3811 | - $sql = "SELECT admin_title, admin_desc, site_title, clabels, required_msg, default_value, option_values FROM " . GEODIR_CUSTOM_FIELDS_TABLE; |
|
3811 | + $sql = "SELECT admin_title, admin_desc, site_title, clabels, required_msg, default_value, option_values FROM ".GEODIR_CUSTOM_FIELDS_TABLE; |
|
3812 | 3812 | $rows = $wpdb->get_results($sql); |
3813 | 3813 | |
3814 | 3814 | if (!empty($rows)) { |
3815 | - foreach($rows as $row) { |
|
3815 | + foreach ($rows as $row) { |
|
3816 | 3816 | if (!empty($row->admin_title)) |
3817 | 3817 | $translation_texts[] = stripslashes_deep($row->admin_title); |
3818 | 3818 | |
@@ -3846,11 +3846,11 @@ discard block |
||
3846 | 3846 | } |
3847 | 3847 | |
3848 | 3848 | // Custom sorting fields table |
3849 | - $sql = "SELECT site_title, asc_title, desc_title FROM " . GEODIR_CUSTOM_SORT_FIELDS_TABLE; |
|
3849 | + $sql = "SELECT site_title, asc_title, desc_title FROM ".GEODIR_CUSTOM_SORT_FIELDS_TABLE; |
|
3850 | 3850 | $rows = $wpdb->get_results($sql); |
3851 | 3851 | |
3852 | 3852 | if (!empty($rows)) { |
3853 | - foreach($rows as $row) { |
|
3853 | + foreach ($rows as $row) { |
|
3854 | 3854 | if (!empty($row->site_title)) |
3855 | 3855 | $translation_texts[] = stripslashes_deep($row->site_title); |
3856 | 3856 | |
@@ -3864,11 +3864,11 @@ discard block |
||
3864 | 3864 | |
3865 | 3865 | // Advance search filter fields table |
3866 | 3866 | if (defined('GEODIR_ADVANCE_SEARCH_TABLE')) { |
3867 | - $sql = "SELECT field_site_name, front_search_title, field_desc FROM " . GEODIR_ADVANCE_SEARCH_TABLE; |
|
3867 | + $sql = "SELECT field_site_name, front_search_title, field_desc FROM ".GEODIR_ADVANCE_SEARCH_TABLE; |
|
3868 | 3868 | $rows = $wpdb->get_results($sql); |
3869 | 3869 | |
3870 | 3870 | if (!empty($rows)) { |
3871 | - foreach($rows as $row) { |
|
3871 | + foreach ($rows as $row) { |
|
3872 | 3872 | if (!empty($row->field_site_name)) |
3873 | 3873 | $translation_texts[] = stripslashes_deep($row->field_site_name); |
3874 | 3874 | |
@@ -3903,7 +3903,7 @@ discard block |
||
3903 | 3903 | * |
3904 | 3904 | * @param array $geodir_allowed_mime_types and file extensions. |
3905 | 3905 | */ |
3906 | - return apply_filters( 'geodir_allowed_mime_types', array( |
|
3906 | + return apply_filters('geodir_allowed_mime_types', array( |
|
3907 | 3907 | 'Image' => array( // Image formats. |
3908 | 3908 | 'jpg' => 'image/jpeg', |
3909 | 3909 | 'jpe' => 'image/jpeg', |
@@ -3992,13 +3992,13 @@ discard block |
||
3992 | 3992 | |
3993 | 3993 | |
3994 | 3994 | |
3995 | -add_filter('wpseo_replacements','geodir_wpseo_replacements',10,1); |
|
3995 | +add_filter('wpseo_replacements', 'geodir_wpseo_replacements', 10, 1); |
|
3996 | 3996 | /* |
3997 | 3997 | * Add location variables to wpseo replacements. |
3998 | 3998 | * |
3999 | 3999 | * @since 1.5.4 |
4000 | 4000 | */ |
4001 | -function geodir_wpseo_replacements($vars){ |
|
4001 | +function geodir_wpseo_replacements($vars) { |
|
4002 | 4002 | |
4003 | 4003 | global $wp; |
4004 | 4004 | $title = ''; |
@@ -4013,12 +4013,12 @@ discard block |
||
4013 | 4013 | * @param array $location_array The array of location variables. |
4014 | 4014 | * @param array $vars The page title variables. |
4015 | 4015 | */ |
4016 | - $location_array = apply_filters('geodir_filter_title_variables_location_arr_seo',$location_array, $vars); |
|
4016 | + $location_array = apply_filters('geodir_filter_title_variables_location_arr_seo', $location_array, $vars); |
|
4017 | 4017 | $location_titles = array(); |
4018 | - if(get_query_var( 'gd_country_full' )){ |
|
4019 | - if(get_query_var( 'gd_country_full' )){$location_array['gd_country'] = get_query_var( 'gd_country_full' );} |
|
4020 | - if(get_query_var( 'gd_region_full' )){$location_array['gd_region'] = get_query_var( 'gd_region_full' );} |
|
4021 | - if(get_query_var( 'gd_city_full' )){$location_array['gd_city'] = get_query_var( 'gd_city_full' );} |
|
4018 | + if (get_query_var('gd_country_full')) { |
|
4019 | + if (get_query_var('gd_country_full')) {$location_array['gd_country'] = get_query_var('gd_country_full'); } |
|
4020 | + if (get_query_var('gd_region_full')) {$location_array['gd_region'] = get_query_var('gd_region_full'); } |
|
4021 | + if (get_query_var('gd_city_full')) {$location_array['gd_city'] = get_query_var('gd_city_full'); } |
|
4022 | 4022 | } |
4023 | 4023 | $location_single = ''; |
4024 | 4024 | $gd_country = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : ''; |
@@ -4090,23 +4090,23 @@ discard block |
||
4090 | 4090 | } |
4091 | 4091 | |
4092 | 4092 | |
4093 | - if(!empty($location_titles)) { |
|
4093 | + if (!empty($location_titles)) { |
|
4094 | 4094 | $vars['%%location%%'] = implode(", ", $location_titles); |
4095 | 4095 | } |
4096 | 4096 | |
4097 | 4097 | |
4098 | - if(!empty($location_titles)) { |
|
4099 | - $vars['%%in_location%%'] = __('in ', 'geodirectory') . implode(", ", $location_titles); |
|
4098 | + if (!empty($location_titles)) { |
|
4099 | + $vars['%%in_location%%'] = __('in ', 'geodirectory').implode(", ", $location_titles); |
|
4100 | 4100 | } |
4101 | 4101 | |
4102 | 4102 | |
4103 | 4103 | |
4104 | - if($location_single) { |
|
4105 | - $vars['%%in_location_single%%'] = __('in', 'geodirectory') . ' ' .$location_single; |
|
4104 | + if ($location_single) { |
|
4105 | + $vars['%%in_location_single%%'] = __('in', 'geodirectory').' '.$location_single; |
|
4106 | 4106 | } |
4107 | 4107 | |
4108 | 4108 | |
4109 | - if($location_single) { |
|
4109 | + if ($location_single) { |
|
4110 | 4110 | $vars['%%location_single%%'] = $location_single; |
4111 | 4111 | } |
4112 | 4112 | |
@@ -4118,17 +4118,17 @@ discard block |
||
4118 | 4118 | * @param string $vars The title with variables. |
4119 | 4119 | * @param array $location_array The array of location variables. |
4120 | 4120 | */ |
4121 | - return apply_filters('geodir_wpseo_replacements_vars',$vars,$location_array); |
|
4121 | + return apply_filters('geodir_wpseo_replacements_vars', $vars, $location_array); |
|
4122 | 4122 | } |
4123 | 4123 | |
4124 | 4124 | |
4125 | -add_filter('geodir_seo_meta_title','geodir_filter_title_variables',10,3); |
|
4126 | -add_filter('geodir_seo_page_title','geodir_filter_title_variables',10,2); |
|
4127 | -add_filter('geodir_seo_meta_description_pre','geodir_filter_title_variables',10,3); |
|
4128 | -function geodir_filter_title_variables($title, $gd_page, $sep=''){ |
|
4125 | +add_filter('geodir_seo_meta_title', 'geodir_filter_title_variables', 10, 3); |
|
4126 | +add_filter('geodir_seo_page_title', 'geodir_filter_title_variables', 10, 2); |
|
4127 | +add_filter('geodir_seo_meta_description_pre', 'geodir_filter_title_variables', 10, 3); |
|
4128 | +function geodir_filter_title_variables($title, $gd_page, $sep = '') { |
|
4129 | 4129 | |
4130 | 4130 | |
4131 | - if(!$gd_page || !$title){return $title;}// if no a GD page then bail. |
|
4131 | + if (!$gd_page || !$title) {return $title; }// if no a GD page then bail. |
|
4132 | 4132 | global $post; |
4133 | 4133 | //print_r($post); |
4134 | 4134 | /* |
@@ -4170,123 +4170,123 @@ discard block |
||
4170 | 4170 | } |
4171 | 4171 | |
4172 | 4172 | |
4173 | - if(strpos($title,'%%title%%') !== false){ |
|
4174 | - $title = str_replace("%%title%%",$post->post_title,$title); |
|
4173 | + if (strpos($title, '%%title%%') !== false) { |
|
4174 | + $title = str_replace("%%title%%", $post->post_title, $title); |
|
4175 | 4175 | } |
4176 | 4176 | |
4177 | - if(strpos($title,'%%sitename%%') !== false){ |
|
4178 | - $title = str_replace("%%sitename%%",get_bloginfo('name'),$title); |
|
4177 | + if (strpos($title, '%%sitename%%') !== false) { |
|
4178 | + $title = str_replace("%%sitename%%", get_bloginfo('name'), $title); |
|
4179 | 4179 | } |
4180 | 4180 | |
4181 | - if(strpos($title,'%%sitedesc%%') !== false){ |
|
4182 | - $title = str_replace("%%sitedesc%%",get_bloginfo('description'),$title); |
|
4181 | + if (strpos($title, '%%sitedesc%%') !== false) { |
|
4182 | + $title = str_replace("%%sitedesc%%", get_bloginfo('description'), $title); |
|
4183 | 4183 | } |
4184 | 4184 | |
4185 | - if(strpos($title,'%%excerpt%%') !== false){ |
|
4186 | - $title = str_replace("%%excerpt%%",strip_tags(get_the_excerpt()),$title); |
|
4185 | + if (strpos($title, '%%excerpt%%') !== false) { |
|
4186 | + $title = str_replace("%%excerpt%%", strip_tags(get_the_excerpt()), $title); |
|
4187 | 4187 | } |
4188 | 4188 | |
4189 | - if(strpos($title,'%%pt_single%%') !== false){ |
|
4189 | + if (strpos($title, '%%pt_single%%') !== false) { |
|
4190 | 4190 | $single_name = ''; |
4191 | - if($gd_page=='search' || $gd_page=='author'){ |
|
4191 | + if ($gd_page == 'search' || $gd_page == 'author') { |
|
4192 | 4192 | $geodir_post_types = get_option('geodir_post_types'); |
4193 | 4193 | $spt = esc_attr($_REQUEST['stype']); |
4194 | - if(isset($geodir_post_types[$spt]['labels']['singular_name'])){ |
|
4195 | - $single_name = __($geodir_post_types[$spt]['labels']['singular_name'],'geodirectory'); |
|
4194 | + if (isset($geodir_post_types[$spt]['labels']['singular_name'])) { |
|
4195 | + $single_name = __($geodir_post_types[$spt]['labels']['singular_name'], 'geodirectory'); |
|
4196 | 4196 | } |
4197 | - }elseif($gd_page=='add-listing'){ |
|
4197 | + }elseif ($gd_page == 'add-listing') { |
|
4198 | 4198 | $geodir_post_types = get_option('geodir_post_types'); |
4199 | 4199 | $spt = isset($_REQUEST['listing_type']) ? esc_attr($_REQUEST['listing_type']) : ''; |
4200 | - if(!$spt && isset($_REQUEST['pid'])){ |
|
4201 | - $spt = get_post_type( $_REQUEST['pid'] ); |
|
4200 | + if (!$spt && isset($_REQUEST['pid'])) { |
|
4201 | + $spt = get_post_type($_REQUEST['pid']); |
|
4202 | 4202 | } |
4203 | - if(!$spt){$spt='gd_place';} |
|
4204 | - if(isset($geodir_post_types[$spt]['labels']['singular_name'])){ |
|
4205 | - $single_name = __($geodir_post_types[$spt]['labels']['singular_name'],'geodirectory'); |
|
4203 | + if (!$spt) {$spt = 'gd_place'; } |
|
4204 | + if (isset($geodir_post_types[$spt]['labels']['singular_name'])) { |
|
4205 | + $single_name = __($geodir_post_types[$spt]['labels']['singular_name'], 'geodirectory'); |
|
4206 | 4206 | } |
4207 | 4207 | } |
4208 | - elseif($post->post_type){ |
|
4208 | + elseif ($post->post_type) { |
|
4209 | 4209 | $geodir_post_types = get_option('geodir_post_types'); |
4210 | - if(isset($geodir_post_types[$post->post_type]['labels']['singular_name'])){ |
|
4211 | - $single_name = __($geodir_post_types[$post->post_type]['labels']['singular_name'],'geodirectory'); |
|
4210 | + if (isset($geodir_post_types[$post->post_type]['labels']['singular_name'])) { |
|
4211 | + $single_name = __($geodir_post_types[$post->post_type]['labels']['singular_name'], 'geodirectory'); |
|
4212 | 4212 | } |
4213 | 4213 | |
4214 | 4214 | |
4215 | 4215 | } |
4216 | - $title = str_replace("%%pt_single%%",$single_name,$title); |
|
4216 | + $title = str_replace("%%pt_single%%", $single_name, $title); |
|
4217 | 4217 | } |
4218 | 4218 | |
4219 | - if(strpos($title,'%%pt_plural%%') !== false){ |
|
4219 | + if (strpos($title, '%%pt_plural%%') !== false) { |
|
4220 | 4220 | $plural_name = ''; |
4221 | - if($gd_page=='search' || $gd_page=='author'){ |
|
4221 | + if ($gd_page == 'search' || $gd_page == 'author') { |
|
4222 | 4222 | $geodir_post_types = get_option('geodir_post_types'); |
4223 | 4223 | $spt = esc_attr($_REQUEST['stype']); |
4224 | - if(isset($geodir_post_types[$spt]['labels']['name'])){ |
|
4225 | - $plural_name = __($geodir_post_types[$spt]['labels']['name'],'geodirectory'); |
|
4224 | + if (isset($geodir_post_types[$spt]['labels']['name'])) { |
|
4225 | + $plural_name = __($geodir_post_types[$spt]['labels']['name'], 'geodirectory'); |
|
4226 | 4226 | } |
4227 | - }elseif($gd_page=='add-listing'){ |
|
4227 | + }elseif ($gd_page == 'add-listing') { |
|
4228 | 4228 | $geodir_post_types = get_option('geodir_post_types'); |
4229 | 4229 | $spt = sanitize_text_field($_REQUEST['listing_type']); |
4230 | - if(!$spt){$spt='gd_place';} |
|
4231 | - if(isset($geodir_post_types[$spt]['labels']['name'])){ |
|
4232 | - $plural_name = __($geodir_post_types[$spt]['labels']['name'],'geodirectory'); |
|
4230 | + if (!$spt) {$spt = 'gd_place'; } |
|
4231 | + if (isset($geodir_post_types[$spt]['labels']['name'])) { |
|
4232 | + $plural_name = __($geodir_post_types[$spt]['labels']['name'], 'geodirectory'); |
|
4233 | 4233 | } |
4234 | 4234 | } |
4235 | - elseif(isset($post->post_type) && $post->post_type){ |
|
4235 | + elseif (isset($post->post_type) && $post->post_type) { |
|
4236 | 4236 | $geodir_post_types = get_option('geodir_post_types'); |
4237 | - if(isset($geodir_post_types[$post->post_type]['labels']['name'])){ |
|
4238 | - $plural_name = __($geodir_post_types[$post->post_type]['labels']['name'],'geodirectory'); |
|
4237 | + if (isset($geodir_post_types[$post->post_type]['labels']['name'])) { |
|
4238 | + $plural_name = __($geodir_post_types[$post->post_type]['labels']['name'], 'geodirectory'); |
|
4239 | 4239 | } |
4240 | 4240 | |
4241 | 4241 | } |
4242 | - $title = str_replace("%%pt_plural%%",$plural_name,$title); |
|
4242 | + $title = str_replace("%%pt_plural%%", $plural_name, $title); |
|
4243 | 4243 | } |
4244 | 4244 | |
4245 | 4245 | |
4246 | 4246 | |
4247 | - if(strpos($title,'%%category%%') !== false){ |
|
4247 | + if (strpos($title, '%%category%%') !== false) { |
|
4248 | 4248 | $cat_name = ''; |
4249 | 4249 | |
4250 | - if($gd_page=='detail') { |
|
4250 | + if ($gd_page == 'detail') { |
|
4251 | 4251 | if ($post->default_category) { |
4252 | - $cat = get_term($post->default_category, $post->post_type . 'category'); |
|
4252 | + $cat = get_term($post->default_category, $post->post_type.'category'); |
|
4253 | 4253 | $cat_name = (isset($cat->name)) ? $cat->name : ''; |
4254 | 4254 | } |
4255 | - }elseif($gd_page=='listing'){ |
|
4255 | + }elseif ($gd_page == 'listing') { |
|
4256 | 4256 | $queried_object = get_queried_object(); |
4257 | - if(isset($queried_object->name)){ |
|
4257 | + if (isset($queried_object->name)) { |
|
4258 | 4258 | $cat_name = $queried_object->name; |
4259 | 4259 | } |
4260 | 4260 | } |
4261 | - $title = str_replace("%%category%%",$cat_name,$title); |
|
4261 | + $title = str_replace("%%category%%", $cat_name, $title); |
|
4262 | 4262 | } |
4263 | 4263 | |
4264 | - if(strpos($title,'%%tag%%') !== false){ |
|
4264 | + if (strpos($title, '%%tag%%') !== false) { |
|
4265 | 4265 | $cat_name = ''; |
4266 | 4266 | |
4267 | - if($gd_page=='detail') { |
|
4267 | + if ($gd_page == 'detail') { |
|
4268 | 4268 | if ($post->default_category) { |
4269 | - $cat = get_term($post->default_category, $post->post_type . 'category'); |
|
4269 | + $cat = get_term($post->default_category, $post->post_type.'category'); |
|
4270 | 4270 | $cat_name = (isset($cat->name)) ? $cat->name : ''; |
4271 | 4271 | } |
4272 | - }elseif($gd_page=='listing'){ |
|
4272 | + }elseif ($gd_page == 'listing') { |
|
4273 | 4273 | $queried_object = get_queried_object(); |
4274 | - if(isset($queried_object->name)){ |
|
4274 | + if (isset($queried_object->name)) { |
|
4275 | 4275 | $cat_name = $queried_object->name; |
4276 | 4276 | } |
4277 | 4277 | } |
4278 | - $title = str_replace("%%tag%%",$cat_name,$title); |
|
4278 | + $title = str_replace("%%tag%%", $cat_name, $title); |
|
4279 | 4279 | } |
4280 | 4280 | |
4281 | 4281 | |
4282 | 4282 | |
4283 | - if(strpos($title,'%%id%%') !== false){ |
|
4283 | + if (strpos($title, '%%id%%') !== false) { |
|
4284 | 4284 | $ID = (isset($post->ID)) ? $post->ID : ''; |
4285 | - $title = str_replace("%%id%%",$ID,$title); |
|
4285 | + $title = str_replace("%%id%%", $ID, $title); |
|
4286 | 4286 | } |
4287 | 4287 | |
4288 | - if(strpos($title,'%%sep%%') !== false){ |
|
4289 | - $title = str_replace("%%sep%%",$sep,$title); |
|
4288 | + if (strpos($title, '%%sep%%') !== false) { |
|
4289 | + $title = str_replace("%%sep%%", $sep, $title); |
|
4290 | 4290 | } |
4291 | 4291 | |
4292 | 4292 | |
@@ -4304,12 +4304,12 @@ discard block |
||
4304 | 4304 | * @param string $gd_page The page being filtered. |
4305 | 4305 | * @param string $sep The separator, default: `|`. |
4306 | 4306 | */ |
4307 | - $location_array = apply_filters('geodir_filter_title_variables_location_arr',$location_array,$title, $gd_page, $sep); |
|
4307 | + $location_array = apply_filters('geodir_filter_title_variables_location_arr', $location_array, $title, $gd_page, $sep); |
|
4308 | 4308 | $location_titles = array(); |
4309 | - if($gd_page=='location' && get_query_var( 'gd_country_full' )){ |
|
4310 | - if(get_query_var( 'gd_country_full' )){$location_array['gd_country'] = get_query_var( 'gd_country_full' );} |
|
4311 | - if(get_query_var( 'gd_region_full' )){$location_array['gd_region'] = get_query_var( 'gd_region_full' );} |
|
4312 | - if(get_query_var( 'gd_city_full' )){$location_array['gd_city'] = get_query_var( 'gd_city_full' );} |
|
4309 | + if ($gd_page == 'location' && get_query_var('gd_country_full')) { |
|
4310 | + if (get_query_var('gd_country_full')) {$location_array['gd_country'] = get_query_var('gd_country_full'); } |
|
4311 | + if (get_query_var('gd_region_full')) {$location_array['gd_region'] = get_query_var('gd_region_full'); } |
|
4312 | + if (get_query_var('gd_city_full')) {$location_array['gd_city'] = get_query_var('gd_city_full'); } |
|
4313 | 4313 | } |
4314 | 4314 | $location_single = ''; |
4315 | 4315 | $gd_country = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : ''; |
@@ -4381,51 +4381,51 @@ discard block |
||
4381 | 4381 | } |
4382 | 4382 | |
4383 | 4383 | |
4384 | - if(strpos($title,'%%location%%') !== false){ |
|
4384 | + if (strpos($title, '%%location%%') !== false) { |
|
4385 | 4385 | $location = ''; |
4386 | - if($location_titles) { |
|
4386 | + if ($location_titles) { |
|
4387 | 4387 | $location = implode(", ", $location_titles); |
4388 | 4388 | } |
4389 | - $title = str_replace("%%location%%",$location,$title); |
|
4389 | + $title = str_replace("%%location%%", $location, $title); |
|
4390 | 4390 | } |
4391 | 4391 | |
4392 | - if(strpos($title,'%%in_location%%') !== false){ |
|
4392 | + if (strpos($title, '%%in_location%%') !== false) { |
|
4393 | 4393 | $location = ''; |
4394 | - if($location_titles) { |
|
4395 | - $location = __('in ', 'geodirectory') . implode(", ", $location_titles); |
|
4394 | + if ($location_titles) { |
|
4395 | + $location = __('in ', 'geodirectory').implode(", ", $location_titles); |
|
4396 | 4396 | } |
4397 | - $title = str_replace("%%in_location%%",$location,$title); |
|
4397 | + $title = str_replace("%%in_location%%", $location, $title); |
|
4398 | 4398 | } |
4399 | 4399 | |
4400 | - if(strpos($title,'%%in_location_single%%') !== false){ |
|
4401 | - if($location_single) { |
|
4402 | - $location_single = __('in', 'geodirectory') . ' ' .$location_single; |
|
4400 | + if (strpos($title, '%%in_location_single%%') !== false) { |
|
4401 | + if ($location_single) { |
|
4402 | + $location_single = __('in', 'geodirectory').' '.$location_single; |
|
4403 | 4403 | } |
4404 | - $title = str_replace("%%in_location_single%%",$location_single,$title); |
|
4404 | + $title = str_replace("%%in_location_single%%", $location_single, $title); |
|
4405 | 4405 | } |
4406 | 4406 | |
4407 | - if(strpos($title,'%%location_single%%') !== false){ |
|
4408 | - $title = str_replace("%%location_single%%",$location_single,$title); |
|
4407 | + if (strpos($title, '%%location_single%%') !== false) { |
|
4408 | + $title = str_replace("%%location_single%%", $location_single, $title); |
|
4409 | 4409 | } |
4410 | 4410 | |
4411 | 4411 | |
4412 | - if(strpos($title,'%%search_term%%') !== false){ |
|
4412 | + if (strpos($title, '%%search_term%%') !== false) { |
|
4413 | 4413 | $search_term = ''; |
4414 | - if(isset($_REQUEST['s'])){ |
|
4414 | + if (isset($_REQUEST['s'])) { |
|
4415 | 4415 | $search_term = esc_attr($_REQUEST['s']); |
4416 | 4416 | } |
4417 | - $title = str_replace("%%search_term%%",$search_term,$title); |
|
4417 | + $title = str_replace("%%search_term%%", $search_term, $title); |
|
4418 | 4418 | } |
4419 | 4419 | |
4420 | - if(strpos($title,'%%search_near%%') !== false){ |
|
4420 | + if (strpos($title, '%%search_near%%') !== false) { |
|
4421 | 4421 | $search_term = ''; |
4422 | - if(isset($_REQUEST['snear'])){ |
|
4422 | + if (isset($_REQUEST['snear'])) { |
|
4423 | 4423 | $search_term = esc_attr($_REQUEST['snear']); |
4424 | 4424 | } |
4425 | - $title = str_replace("%%search_near%%",$search_term,$title); |
|
4425 | + $title = str_replace("%%search_near%%", $search_term, $title); |
|
4426 | 4426 | } |
4427 | 4427 | |
4428 | - if(strpos($title,'%%name%%') !== false){ |
|
4428 | + if (strpos($title, '%%name%%') !== false) { |
|
4429 | 4429 | $author_name = get_the_author(); |
4430 | 4430 | if (!$author_name || $author_name === '') { |
4431 | 4431 | $queried_object = get_queried_object(); |
@@ -4450,9 +4450,9 @@ discard block |
||
4450 | 4450 | $title = str_replace("%%pagetotal%%", $pagetotal, $title); |
4451 | 4451 | } |
4452 | 4452 | |
4453 | - $title = wptexturize( $title ); |
|
4454 | - $title = convert_chars( $title ); |
|
4455 | - $title = esc_html( $title ); |
|
4453 | + $title = wptexturize($title); |
|
4454 | + $title = convert_chars($title); |
|
4455 | + $title = esc_html($title); |
|
4456 | 4456 | |
4457 | 4457 | /** |
4458 | 4458 | * Filter the title variables after standard ones have been filtered. |
@@ -4465,7 +4465,7 @@ discard block |
||
4465 | 4465 | * @param string $sep The separator, default: `|`. |
4466 | 4466 | */ |
4467 | 4467 | |
4468 | - return apply_filters('geodir_filter_title_variables_vars',$title,$location_array, $gd_page, $sep); |
|
4468 | + return apply_filters('geodir_filter_title_variables_vars', $title, $location_array, $gd_page, $sep); |
|
4469 | 4469 | } |
4470 | 4470 | |
4471 | 4471 | /** |
@@ -4588,7 +4588,7 @@ discard block |
||
4588 | 4588 | } |
4589 | 4589 | |
4590 | 4590 | $action = isset($_REQUEST['action']) ? sanitize_text_field($_REQUEST['action']) : ''; |
4591 | - $is_admin = is_admin() && ( !defined('DOING_AJAX' ) || ( defined('DOING_AJAX') && !DOING_AJAX ) ) ? true : false; |
|
4591 | + $is_admin = is_admin() && (!defined('DOING_AJAX') || (defined('DOING_AJAX') && !DOING_AJAX)) ? true : false; |
|
4592 | 4592 | $inline_save = $action == 'inline-save' ? true : false; |
4593 | 4593 | |
4594 | 4594 | if (empty($post->post_type) || $is_admin || $inline_save || (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)) { |
@@ -4599,7 +4599,7 @@ discard block |
||
4599 | 4599 | return; |
4600 | 4600 | } |
4601 | 4601 | |
4602 | - $user_id = (int)get_current_user_id(); |
|
4602 | + $user_id = (int) get_current_user_id(); |
|
4603 | 4603 | |
4604 | 4604 | if ($user_id > 0 && get_option('geodir_notify_post_edited') && !wp_is_post_revision($post_ID) && in_array($post->post_type, geodir_get_posttypes())) { |
4605 | 4605 | $author_id = !empty($post->post_author) ? $post->post_author : 0; |
@@ -4643,7 +4643,7 @@ discard block |
||
4643 | 4643 | $nr = geodir_title_meta_pagenumbering('nr'); |
4644 | 4644 | |
4645 | 4645 | if ($max > 1 && $nr > 1) { |
4646 | - $replacement = sprintf($sep . ' ' . __('Page %1$d of %2$d', 'geodirectory'), $nr, $max); |
|
4646 | + $replacement = sprintf($sep.' '.__('Page %1$d of %2$d', 'geodirectory'), $nr, $max); |
|
4647 | 4647 | } |
4648 | 4648 | |
4649 | 4649 | return $replacement; |
@@ -4662,7 +4662,7 @@ discard block |
||
4662 | 4662 | |
4663 | 4663 | $nr = geodir_title_meta_pagenumbering('nr'); |
4664 | 4664 | if (isset($nr) && $nr > 0) { |
4665 | - $replacement = (string)$nr; |
|
4665 | + $replacement = (string) $nr; |
|
4666 | 4666 | } |
4667 | 4667 | |
4668 | 4668 | return $replacement; |
@@ -4681,7 +4681,7 @@ discard block |
||
4681 | 4681 | |
4682 | 4682 | $max = geodir_title_meta_pagenumbering('max'); |
4683 | 4683 | if (isset($max) && $max > 0) { |
4684 | - $replacement = (string)$max; |
|
4684 | + $replacement = (string) $max; |
|
4685 | 4685 | } |
4686 | 4686 | |
4687 | 4687 | return $replacement; |
@@ -4723,7 +4723,7 @@ discard block |
||
4723 | 4723 | } |
4724 | 4724 | |
4725 | 4725 | if (isset($post->post_content)) { |
4726 | - $max_num_pages = (substr_count($post->post_content, '<!--nextpage-->' ) + 1); |
|
4726 | + $max_num_pages = (substr_count($post->post_content, '<!--nextpage-->') + 1); |
|
4727 | 4727 | } |
4728 | 4728 | } |
4729 | 4729 |