@@ -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()) { |
@@ -1224,37 +1224,37 @@ discard block |
||
1224 | 1224 | |
1225 | 1225 | if (geodir_is_page('location')) { |
1226 | 1226 | $location_page_id = geodir_location_page_id(); |
1227 | - $loc_post = get_post( $location_page_id ); |
|
1227 | + $loc_post = get_post($location_page_id); |
|
1228 | 1228 | $post_name = $loc_post->post_name; |
1229 | - $slug= ucwords(str_replace('-',' ',$post_name)); |
|
1230 | - $page_title = !empty($slug )? $slug : __('Location', 'geodirectory'); |
|
1229 | + $slug = ucwords(str_replace('-', ' ', $post_name)); |
|
1230 | + $page_title = !empty($slug) ? $slug : __('Location', 'geodirectory'); |
|
1231 | 1231 | } |
1232 | 1232 | |
1233 | - $breadcrumb .= '<li>' . $separator; |
|
1233 | + $breadcrumb .= '<li>'.$separator; |
|
1234 | 1234 | $breadcrumb .= stripslashes_deep($page_title); |
1235 | 1235 | $breadcrumb .= '</li>'; |
1236 | 1236 | } else if (is_tag()) { |
1237 | - $breadcrumb .= "<li> " . $separator . single_tag_title('',false) . '</li>'; |
|
1237 | + $breadcrumb .= "<li> ".$separator.single_tag_title('', false).'</li>'; |
|
1238 | 1238 | } else if (is_day()) { |
1239 | - $breadcrumb .= "<li> " . $separator . __(" Archive for", 'geodirectory') . " "; |
|
1239 | + $breadcrumb .= "<li> ".$separator.__(" Archive for", 'geodirectory')." "; |
|
1240 | 1240 | the_time('F jS, Y'); |
1241 | 1241 | $breadcrumb .= '</li>'; |
1242 | 1242 | } else if (is_month()) { |
1243 | - $breadcrumb .= "<li> " . $separator . __(" Archive for", 'geodirectory') . " "; |
|
1243 | + $breadcrumb .= "<li> ".$separator.__(" Archive for", 'geodirectory')." "; |
|
1244 | 1244 | the_time('F, Y'); |
1245 | 1245 | $breadcrumb .= '</li>'; |
1246 | 1246 | } else if (is_year()) { |
1247 | - $breadcrumb .= "<li> " . $separator . __(" Archive for", 'geodirectory') . " "; |
|
1247 | + $breadcrumb .= "<li> ".$separator.__(" Archive for", 'geodirectory')." "; |
|
1248 | 1248 | the_time('Y'); |
1249 | 1249 | $breadcrumb .= '</li>'; |
1250 | 1250 | } else if (is_author()) { |
1251 | - $breadcrumb .= "<li> " . $separator . __(" Author Archive", 'geodirectory'); |
|
1251 | + $breadcrumb .= "<li> ".$separator.__(" Author Archive", 'geodirectory'); |
|
1252 | 1252 | $breadcrumb .= '</li>'; |
1253 | 1253 | } else if (isset($_GET['paged']) && !empty($_GET['paged'])) { |
1254 | - $breadcrumb .= "<li>" . $separator . __("Blog Archives", 'geodirectory'); |
|
1254 | + $breadcrumb .= "<li>".$separator.__("Blog Archives", 'geodirectory'); |
|
1255 | 1255 | $breadcrumb .= '</li>'; |
1256 | 1256 | } else if (is_search()) { |
1257 | - $breadcrumb .= "<li> " . $separator . __(" Search Results", 'geodirectory'); |
|
1257 | + $breadcrumb .= "<li> ".$separator.__(" Search Results", 'geodirectory'); |
|
1258 | 1258 | $breadcrumb .= '</li>'; |
1259 | 1259 | } |
1260 | 1260 | $breadcrumb .= '</ul></div>'; |
@@ -1310,7 +1310,7 @@ discard block |
||
1310 | 1310 | function fetch_remote_file($url) |
1311 | 1311 | { |
1312 | 1312 | // extract the file name and extension from the url |
1313 | - require_once(ABSPATH . 'wp-includes/pluggable.php'); |
|
1313 | + require_once(ABSPATH.'wp-includes/pluggable.php'); |
|
1314 | 1314 | $file_name = basename($url); |
1315 | 1315 | if (strpos($file_name, '?') !== false) { |
1316 | 1316 | list($file_name) = explode('?', $file_name); |
@@ -1342,15 +1342,15 @@ discard block |
||
1342 | 1342 | return new WP_Error('upload_dir_error', $upload['error']); |
1343 | 1343 | |
1344 | 1344 | |
1345 | - sleep(0.3);// if multiple remote file this can cause the remote server to timeout so we add a slight delay |
|
1345 | + sleep(0.3); // if multiple remote file this can cause the remote server to timeout so we add a slight delay |
|
1346 | 1346 | |
1347 | 1347 | // fetch the remote url and write it to the placeholder file |
1348 | - $headers = wp_remote_get($url, array('stream' => true,'filename' => $upload['file'])); |
|
1348 | + $headers = wp_remote_get($url, array('stream' => true, 'filename' => $upload['file'])); |
|
1349 | 1349 | |
1350 | 1350 | $log_message = ''; |
1351 | - if( is_wp_error( $headers ) ) { |
|
1351 | + if (is_wp_error($headers)) { |
|
1352 | 1352 | echo 'file: '.$url; |
1353 | - return new WP_Error('import_file_error',$headers->get_error_message()); |
|
1353 | + return new WP_Error('import_file_error', $headers->get_error_message()); |
|
1354 | 1354 | } |
1355 | 1355 | |
1356 | 1356 | $filesize = filesize($upload['file']); |
@@ -1363,21 +1363,21 @@ discard block |
||
1363 | 1363 | $log_message = sprintf(__('Remote server returned error response %1$d %2$s', 'geodirectory'), esc_html($headers['response']), get_status_header_desc($headers['response'])); |
1364 | 1364 | } |
1365 | 1365 | elseif (isset($headers['headers']['content-length']) && $filesize != $headers['headers']['content-length']) { |
1366 | - $log_message = __('Remote file is incorrect size', 'geodirectory'); |
|
1366 | + $log_message = __('Remote file is incorrect size', 'geodirectory'); |
|
1367 | 1367 | } |
1368 | 1368 | elseif (0 == $filesize) { |
1369 | 1369 | $log_message = __('Zero size file downloaded', 'geodirectory'); |
1370 | 1370 | } |
1371 | 1371 | |
1372 | - if($log_message){ |
|
1372 | + if ($log_message) { |
|
1373 | 1373 | $del = unlink($upload['file']); |
1374 | - if(!$del){geodir_error_log(__('GeoDirectory: fetch_remote_file() failed to delete temp file.', 'geodirectory'));} |
|
1375 | - return new WP_Error('import_file_error',$log_message ); |
|
1374 | + if (!$del) {geodir_error_log(__('GeoDirectory: fetch_remote_file() failed to delete temp file.', 'geodirectory')); } |
|
1375 | + return new WP_Error('import_file_error', $log_message); |
|
1376 | 1376 | } |
1377 | 1377 | |
1378 | 1378 | if ($dummy && $add_to_cache && is_array($upload)) { |
1379 | 1379 | $images = get_transient('cached_dummy_images'); |
1380 | - if(is_array($images)) |
|
1380 | + if (is_array($images)) |
|
1381 | 1381 | $images[$key] = $upload; |
1382 | 1382 | else |
1383 | 1383 | $images = array($key => $upload); |
@@ -1398,12 +1398,12 @@ discard block |
||
1398 | 1398 | */ |
1399 | 1399 | function geodir_max_upload_size() |
1400 | 1400 | { |
1401 | - $max_filesize = (float)get_option('geodir_upload_max_filesize', 2); |
|
1401 | + $max_filesize = (float) get_option('geodir_upload_max_filesize', 2); |
|
1402 | 1402 | |
1403 | 1403 | if ($max_filesize > 0 && $max_filesize < 1) { |
1404 | - $max_filesize = (int)($max_filesize * 1024) . 'kb'; |
|
1404 | + $max_filesize = (int) ($max_filesize * 1024).'kb'; |
|
1405 | 1405 | } else { |
1406 | - $max_filesize = $max_filesize > 0 ? $max_filesize . 'mb' : '2mb'; |
|
1406 | + $max_filesize = $max_filesize > 0 ? $max_filesize.'mb' : '2mb'; |
|
1407 | 1407 | } |
1408 | 1408 | |
1409 | 1409 | /** |
@@ -1426,7 +1426,7 @@ discard block |
||
1426 | 1426 | */ |
1427 | 1427 | function geodir_dummy_folder_exists() |
1428 | 1428 | { |
1429 | - $path = geodir_plugin_path() . '/geodirectory-admin/dummy/'; |
|
1429 | + $path = geodir_plugin_path().'/geodirectory-admin/dummy/'; |
|
1430 | 1430 | if (!is_dir($path)) |
1431 | 1431 | return false; |
1432 | 1432 | else |
@@ -1470,35 +1470,35 @@ discard block |
||
1470 | 1470 | { |
1471 | 1471 | global $wpdb; |
1472 | 1472 | if ($message_type == 'expiration') { |
1473 | - $subject = stripslashes(__(get_option('renew_email_subject'),'geodirectory')); |
|
1474 | - $client_message = stripslashes(__(get_option('renew_email_content'),'geodirectory')); |
|
1473 | + $subject = stripslashes(__(get_option('renew_email_subject'), 'geodirectory')); |
|
1474 | + $client_message = stripslashes(__(get_option('renew_email_content'), 'geodirectory')); |
|
1475 | 1475 | } elseif ($message_type == 'post_submited') { |
1476 | - $subject = __(get_option('post_submited_success_email_subject_admin'),'geodirectory'); |
|
1477 | - $client_message = __(get_option('post_submited_success_email_content_admin'),'geodirectory'); |
|
1476 | + $subject = __(get_option('post_submited_success_email_subject_admin'), 'geodirectory'); |
|
1477 | + $client_message = __(get_option('post_submited_success_email_content_admin'), 'geodirectory'); |
|
1478 | 1478 | } elseif ($message_type == 'renew') { |
1479 | - $subject = __(get_option('post_renew_success_email_subject_admin'),'geodirectory'); |
|
1480 | - $client_message = __(get_option('post_renew_success_email_content_admin'),'geodirectory'); |
|
1479 | + $subject = __(get_option('post_renew_success_email_subject_admin'), 'geodirectory'); |
|
1480 | + $client_message = __(get_option('post_renew_success_email_content_admin'), 'geodirectory'); |
|
1481 | 1481 | } elseif ($message_type == 'upgrade') { |
1482 | - $subject = __(get_option('post_upgrade_success_email_subject_admin'),'geodirectory'); |
|
1483 | - $client_message = __(get_option('post_upgrade_success_email_content_admin'),'geodirectory'); |
|
1482 | + $subject = __(get_option('post_upgrade_success_email_subject_admin'), 'geodirectory'); |
|
1483 | + $client_message = __(get_option('post_upgrade_success_email_content_admin'), 'geodirectory'); |
|
1484 | 1484 | } elseif ($message_type == 'claim_approved') { |
1485 | - $subject = __(get_option('claim_approved_email_subject'),'geodirectory'); |
|
1486 | - $client_message = __(get_option('claim_approved_email_content'),'geodirectory'); |
|
1485 | + $subject = __(get_option('claim_approved_email_subject'), 'geodirectory'); |
|
1486 | + $client_message = __(get_option('claim_approved_email_content'), 'geodirectory'); |
|
1487 | 1487 | } elseif ($message_type == 'claim_rejected') { |
1488 | - $subject = __(get_option('claim_rejected_email_subject'),'geodirectory'); |
|
1489 | - $client_message = __(get_option('claim_rejected_email_content'),'geodirectory'); |
|
1488 | + $subject = __(get_option('claim_rejected_email_subject'), 'geodirectory'); |
|
1489 | + $client_message = __(get_option('claim_rejected_email_content'), 'geodirectory'); |
|
1490 | 1490 | } elseif ($message_type == 'claim_requested') { |
1491 | - $subject = __(get_option('claim_email_subject_admin'),'geodirectory'); |
|
1492 | - $client_message = __(get_option('claim_email_content_admin'),'geodirectory'); |
|
1491 | + $subject = __(get_option('claim_email_subject_admin'), 'geodirectory'); |
|
1492 | + $client_message = __(get_option('claim_email_content_admin'), 'geodirectory'); |
|
1493 | 1493 | } elseif ($message_type == 'auto_claim') { |
1494 | - $subject = __(get_option('auto_claim_email_subject'),'geodirectory'); |
|
1495 | - $client_message = __(get_option('auto_claim_email_content'),'geodirectory'); |
|
1494 | + $subject = __(get_option('auto_claim_email_subject'), 'geodirectory'); |
|
1495 | + $client_message = __(get_option('auto_claim_email_content'), 'geodirectory'); |
|
1496 | 1496 | } elseif ($message_type == 'payment_success') { |
1497 | - $subject = __(get_option('post_payment_success_admin_email_subject'),'geodirectory'); |
|
1498 | - $client_message = __(get_option('post_payment_success_admin_email_content'),'geodirectory'); |
|
1497 | + $subject = __(get_option('post_payment_success_admin_email_subject'), 'geodirectory'); |
|
1498 | + $client_message = __(get_option('post_payment_success_admin_email_content'), 'geodirectory'); |
|
1499 | 1499 | } elseif ($message_type == 'payment_fail') { |
1500 | - $subject = __(get_option('post_payment_fail_admin_email_subject'),'geodirectory'); |
|
1501 | - $client_message = __(get_option('post_payment_fail_admin_email_content'),'geodirectory'); |
|
1500 | + $subject = __(get_option('post_payment_fail_admin_email_subject'), 'geodirectory'); |
|
1501 | + $client_message = __(get_option('post_payment_fail_admin_email_content'), 'geodirectory'); |
|
1502 | 1502 | } |
1503 | 1503 | $transaction_details = $custom_1; |
1504 | 1504 | $fromEmail = get_option('site_email'); |
@@ -1509,11 +1509,11 @@ discard block |
||
1509 | 1509 | $productlink = get_permalink($page_id); |
1510 | 1510 | $post_info = get_post($page_id); |
1511 | 1511 | $post_date = date('dS F,Y', strtotime($post_info->post_date)); |
1512 | - $listingLink = '<a href="' . $productlink . '"><b>' . $post_info->post_title . '</b></a>'; |
|
1512 | + $listingLink = '<a href="'.$productlink.'"><b>'.$post_info->post_title.'</b></a>'; |
|
1513 | 1513 | $loginurl = geodir_login_url(); |
1514 | - $loginurl_link = '<a href="' . $loginurl . '">login</a>'; |
|
1514 | + $loginurl_link = '<a href="'.$loginurl.'">login</a>'; |
|
1515 | 1515 | $siteurl = home_url(); |
1516 | - $siteurl_link = '<a href="' . $siteurl . '">' . $fromEmailName . '</a>'; |
|
1516 | + $siteurl_link = '<a href="'.$siteurl.'">'.$fromEmailName.'</a>'; |
|
1517 | 1517 | $user_info = get_userdata($user_id); |
1518 | 1518 | $user_email = $user_info->user_email; |
1519 | 1519 | $display_name = geodir_get_client_name($user_id); |
@@ -1527,14 +1527,14 @@ discard block |
||
1527 | 1527 | } else { |
1528 | 1528 | $post_type = 'listing'; |
1529 | 1529 | } |
1530 | - $renew_link = '<a href="' . $siteurl . '?ptype=post_' . $post_type . '&renew=1&pid=' . $page_id . '">' . RENEW_LINK . '</a>'; |
|
1530 | + $renew_link = '<a href="'.$siteurl.'?ptype=post_'.$post_type.'&renew=1&pid='.$page_id.'">'.RENEW_LINK.'</a>'; |
|
1531 | 1531 | $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#]'); |
1532 | 1532 | $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); |
1533 | 1533 | $client_message = str_replace($search_array, $replace_array, $client_message); |
1534 | 1534 | $subject = str_replace($search_array, $replace_array, $subject); |
1535 | - $headers = 'MIME-Version: 1.0' . "\r\n"; |
|
1536 | - $headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n"; |
|
1537 | - $headers .= 'From: ' . $fromEmailName . ' <' . $fromEmail . '>' . "\r\n"; |
|
1535 | + $headers = 'MIME-Version: 1.0'."\r\n"; |
|
1536 | + $headers .= 'Content-type: text/html; charset=UTF-8'."\r\n"; |
|
1537 | + $headers .= 'From: '.$fromEmailName.' <'.$fromEmail.'>'."\r\n"; |
|
1538 | 1538 | |
1539 | 1539 | $to = $fromEmail; |
1540 | 1540 | $message = $client_message; |
@@ -1551,7 +1551,7 @@ discard block |
||
1551 | 1551 | * @param string $message_type Can be 'expiration','post_submited','renew','upgrade','claim_approved','claim_rejected','claim_requested','auto_claim','payment_success','payment_fail'. |
1552 | 1552 | * @param string $custom_1 Custom data to be sent. |
1553 | 1553 | */ |
1554 | - $to = apply_filters('geodir_adminEmail_to',$to,$page_id, $user_id, $message_type, $custom_1 ); |
|
1554 | + $to = apply_filters('geodir_adminEmail_to', $to, $page_id, $user_id, $message_type, $custom_1); |
|
1555 | 1555 | /** |
1556 | 1556 | * Filter the admin email subject. |
1557 | 1557 | * |
@@ -1563,7 +1563,7 @@ discard block |
||
1563 | 1563 | * @param string $message_type Can be 'expiration','post_submited','renew','upgrade','claim_approved','claim_rejected','claim_requested','auto_claim','payment_success','payment_fail'. |
1564 | 1564 | * @param string $custom_1 Custom data to be sent. |
1565 | 1565 | */ |
1566 | - $subject = apply_filters('geodir_adminEmail_subject',$subject,$page_id, $user_id, $message_type, $custom_1); |
|
1566 | + $subject = apply_filters('geodir_adminEmail_subject', $subject, $page_id, $user_id, $message_type, $custom_1); |
|
1567 | 1567 | /** |
1568 | 1568 | * Filter the admin email message. |
1569 | 1569 | * |
@@ -1575,7 +1575,7 @@ discard block |
||
1575 | 1575 | * @param string $message_type Can be 'expiration','post_submited','renew','upgrade','claim_approved','claim_rejected','claim_requested','auto_claim','payment_success','payment_fail'. |
1576 | 1576 | * @param string $custom_1 Custom data to be sent. |
1577 | 1577 | */ |
1578 | - $message = apply_filters('geodir_adminEmail_message',$message,$page_id, $user_id, $message_type, $custom_1); |
|
1578 | + $message = apply_filters('geodir_adminEmail_message', $message, $page_id, $user_id, $message_type, $custom_1); |
|
1579 | 1579 | /** |
1580 | 1580 | * Filter the admin email headers. |
1581 | 1581 | * |
@@ -1587,23 +1587,23 @@ discard block |
||
1587 | 1587 | * @param string $message_type Can be 'expiration','post_submited','renew','upgrade','claim_approved','claim_rejected','claim_requested','auto_claim','payment_success','payment_fail'. |
1588 | 1588 | * @param string $custom_1 Custom data to be sent. |
1589 | 1589 | */ |
1590 | - $headers = apply_filters('geodir_adminEmail_headers',$headers,$page_id, $user_id, $message_type, $custom_1); |
|
1590 | + $headers = apply_filters('geodir_adminEmail_headers', $headers, $page_id, $user_id, $message_type, $custom_1); |
|
1591 | 1591 | |
1592 | 1592 | |
1593 | 1593 | |
1594 | 1594 | $sent = wp_mail($to, $subject, $message, $headers); |
1595 | - if( ! $sent ) { |
|
1596 | - if ( is_array( $to ) ) { |
|
1597 | - $to = implode( ',', $to ); |
|
1595 | + if (!$sent) { |
|
1596 | + if (is_array($to)) { |
|
1597 | + $to = implode(',', $to); |
|
1598 | 1598 | } |
1599 | 1599 | $log_message = sprintf( |
1600 | - __( "Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory' ), |
|
1600 | + __("Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory'), |
|
1601 | 1601 | $message_type, |
1602 | - date_i18n( 'F j Y H:i:s', current_time( 'timestamp' ) ), |
|
1602 | + date_i18n('F j Y H:i:s', current_time('timestamp')), |
|
1603 | 1603 | $to, |
1604 | 1604 | $subject |
1605 | 1605 | ); |
1606 | - geodir_error_log( $log_message ); |
|
1606 | + geodir_error_log($log_message); |
|
1607 | 1607 | } |
1608 | 1608 | } |
1609 | 1609 | } |
@@ -1629,18 +1629,18 @@ discard block |
||
1629 | 1629 | { |
1630 | 1630 | $login_details = ''; |
1631 | 1631 | if ($message_type == 'send_friend') { |
1632 | - $subject = stripslashes(__(get_option('email_friend_subject'),'geodirectory')); |
|
1633 | - $message = stripslashes(__(get_option('email_friend_content'),'geodirectory')); |
|
1632 | + $subject = stripslashes(__(get_option('email_friend_subject'), 'geodirectory')); |
|
1633 | + $message = stripslashes(__(get_option('email_friend_content'), 'geodirectory')); |
|
1634 | 1634 | } elseif ($message_type == 'send_enquiry') { |
1635 | - $subject = __(get_option('email_enquiry_subject'),'geodirectory'); |
|
1636 | - $message = __(get_option('email_enquiry_content'),'geodirectory'); |
|
1635 | + $subject = __(get_option('email_enquiry_subject'), 'geodirectory'); |
|
1636 | + $message = __(get_option('email_enquiry_content'), 'geodirectory'); |
|
1637 | 1637 | } elseif ($message_type == 'forgot_password') { |
1638 | - $subject = __(get_option('forgot_password_subject'),'geodirectory'); |
|
1639 | - $message = __(get_option('forgot_password_content'),'geodirectory'); |
|
1638 | + $subject = __(get_option('forgot_password_subject'), 'geodirectory'); |
|
1639 | + $message = __(get_option('forgot_password_content'), 'geodirectory'); |
|
1640 | 1640 | $login_details = $to_message; |
1641 | 1641 | } elseif ($message_type == 'registration') { |
1642 | - $subject = __(get_option('registration_success_email_subject'),'geodirectory'); |
|
1643 | - $message = __(get_option('registration_success_email_content'),'geodirectory'); |
|
1642 | + $subject = __(get_option('registration_success_email_subject'), 'geodirectory'); |
|
1643 | + $message = __(get_option('registration_success_email_content'), 'geodirectory'); |
|
1644 | 1644 | $login_details = $to_message; |
1645 | 1645 | } |
1646 | 1646 | $to_message = nl2br($to_message); |
@@ -1648,11 +1648,11 @@ discard block |
||
1648 | 1648 | $sitefromEmailName = get_site_emailName(); |
1649 | 1649 | $productlink = get_permalink($post_id); |
1650 | 1650 | $post_info = get_post($post_id); |
1651 | - $listingLink = '<a href="' . $productlink . '"><b>' . $post_info->post_title . '</b></a>'; |
|
1651 | + $listingLink = '<a href="'.$productlink.'"><b>'.$post_info->post_title.'</b></a>'; |
|
1652 | 1652 | $siteurl = home_url(); |
1653 | - $siteurl_link = '<a href="' . $siteurl . '">' . $siteurl . '</a>'; |
|
1653 | + $siteurl_link = '<a href="'.$siteurl.'">'.$siteurl.'</a>'; |
|
1654 | 1654 | $loginurl = geodir_login_url(); |
1655 | - $loginurl_link = '<a href="' . $loginurl . '">login</a>'; |
|
1655 | + $loginurl_link = '<a href="'.$loginurl.'">login</a>'; |
|
1656 | 1656 | if ($fromEmail == '') { |
1657 | 1657 | $fromEmail = get_option('site_email'); |
1658 | 1658 | } |
@@ -1666,26 +1666,26 @@ discard block |
||
1666 | 1666 | $search_array = array('[#listing_link#]', '[#site_name_url#]', '[#post_id#]', '[#site_name#]', '[#to_name#]', '[#from_name#]', '[#subject#]', '[#client_name#]'); |
1667 | 1667 | $replace_array = array($listingLink, $siteurl_link, $post_id, $sitefromEmailName, $toEmailName, $fromEmailName, $to_subject, $toEmailName); |
1668 | 1668 | $subject = str_replace($search_array, $replace_array, $subject); |
1669 | - $headers = 'MIME-Version: 1.0' . "\r\n"; |
|
1670 | - $headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n"; |
|
1671 | - $headers .= "Reply-To: " . $fromEmail . "\r\n"; |
|
1672 | - $headers .= 'From: ' . $sitefromEmailName . ' <' . $sitefromEmail . '>' . "\r\n"; |
|
1669 | + $headers = 'MIME-Version: 1.0'."\r\n"; |
|
1670 | + $headers .= 'Content-type: text/html; charset=UTF-8'."\r\n"; |
|
1671 | + $headers .= "Reply-To: ".$fromEmail."\r\n"; |
|
1672 | + $headers .= 'From: '.$sitefromEmailName.' <'.$sitefromEmail.'>'."\r\n"; |
|
1673 | 1673 | |
1674 | 1674 | $to = $toEmail; |
1675 | 1675 | |
1676 | 1676 | $sent = wp_mail($to, $subject, $message, $headers); |
1677 | - if( ! $sent ) { |
|
1678 | - if ( is_array( $to ) ) { |
|
1679 | - $to = implode( ',', $to ); |
|
1677 | + if (!$sent) { |
|
1678 | + if (is_array($to)) { |
|
1679 | + $to = implode(',', $to); |
|
1680 | 1680 | } |
1681 | 1681 | $log_message = sprintf( |
1682 | - __( "Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory' ), |
|
1682 | + __("Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory'), |
|
1683 | 1683 | $message_type, |
1684 | - date_i18n( 'F j Y H:i:s', current_time( 'timestamp' ) ), |
|
1684 | + date_i18n('F j Y H:i:s', current_time('timestamp')), |
|
1685 | 1685 | $to, |
1686 | 1686 | $subject |
1687 | 1687 | ); |
1688 | - geodir_error_log( $log_message ); |
|
1688 | + geodir_error_log($log_message); |
|
1689 | 1689 | } |
1690 | 1690 | |
1691 | 1691 | ///////// ADMIN BCC EMIALS |
@@ -1693,7 +1693,7 @@ discard block |
||
1693 | 1693 | if ($message_type == 'registration') { |
1694 | 1694 | $message_raw = explode(__("Password:", 'geodirectory'), $message); |
1695 | 1695 | $message_raw2 = explode("</p>", $message_raw[1], 2); |
1696 | - $message = $message_raw[0] . __('Password:', 'geodirectory') . ' **********</p>' . $message_raw2[1]; |
|
1696 | + $message = $message_raw[0].__('Password:', 'geodirectory').' **********</p>'.$message_raw2[1]; |
|
1697 | 1697 | } |
1698 | 1698 | $adminEmail = get_bloginfo('admin_email'); |
1699 | 1699 | $to = $adminEmail; |
@@ -1711,20 +1711,20 @@ discard block |
||
1711 | 1711 | $admin_bcc = true; |
1712 | 1712 | } |
1713 | 1713 | |
1714 | - if($admin_bcc === true){ |
|
1714 | + if ($admin_bcc === true) { |
|
1715 | 1715 | $sent = wp_mail($to, $subject, $message, $headers); |
1716 | - if( ! $sent ) { |
|
1717 | - if ( is_array( $to ) ) { |
|
1718 | - $to = implode( ',', $to ); |
|
1716 | + if (!$sent) { |
|
1717 | + if (is_array($to)) { |
|
1718 | + $to = implode(',', $to); |
|
1719 | 1719 | } |
1720 | 1720 | $log_message = sprintf( |
1721 | - __( "Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory' ), |
|
1721 | + __("Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory'), |
|
1722 | 1722 | $message_type, |
1723 | - date_i18n( 'F j Y H:i:s', current_time( 'timestamp' ) ), |
|
1723 | + date_i18n('F j Y H:i:s', current_time('timestamp')), |
|
1724 | 1724 | $to, |
1725 | 1725 | $subject |
1726 | 1726 | ); |
1727 | - geodir_error_log( $log_message ); |
|
1727 | + geodir_error_log($log_message); |
|
1728 | 1728 | } |
1729 | 1729 | } |
1730 | 1730 | |
@@ -1772,7 +1772,7 @@ discard block |
||
1772 | 1772 | function geodir_custom_posts_body_class($classes) { |
1773 | 1773 | global $wpdb, $wp; |
1774 | 1774 | $post_types = geodir_get_posttypes('object'); |
1775 | - if (!empty($post_types) && count((array)$post_types) > 1) { |
|
1775 | + if (!empty($post_types) && count((array) $post_types) > 1) { |
|
1776 | 1776 | $classes[] = 'geodir_custom_posts'; |
1777 | 1777 | } |
1778 | 1778 | |
@@ -1832,7 +1832,7 @@ discard block |
||
1832 | 1832 | $geodir_option = get_option($geodir_option_name); |
1833 | 1833 | |
1834 | 1834 | if (!empty($geodir_option)) { |
1835 | - add_option($geodir_option_name . '_' . $version_date, $geodir_option); |
|
1835 | + add_option($geodir_option_name.'_'.$version_date, $geodir_option); |
|
1836 | 1836 | } |
1837 | 1837 | } |
1838 | 1838 | |
@@ -1938,36 +1938,36 @@ discard block |
||
1938 | 1938 | |
1939 | 1939 | $query_args = $gd_query_args_widgets; |
1940 | 1940 | if (empty($query_args) || empty($query_args['is_geodir_loop'])) { |
1941 | - return $wpdb->posts . ".post_date DESC, "; |
|
1941 | + return $wpdb->posts.".post_date DESC, "; |
|
1942 | 1942 | } |
1943 | 1943 | |
1944 | 1944 | $post_type = empty($query_args['post_type']) ? 'gd_place' : $query_args['post_type']; |
1945 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
1945 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
1946 | 1946 | |
1947 | 1947 | $sort_by = !empty($query_args['order_by']) ? $query_args['order_by'] : ''; |
1948 | 1948 | |
1949 | 1949 | switch ($sort_by) { |
1950 | 1950 | case 'latest': |
1951 | 1951 | case 'newest': |
1952 | - $orderby = $wpdb->posts . ".post_date DESC, "; |
|
1952 | + $orderby = $wpdb->posts.".post_date DESC, "; |
|
1953 | 1953 | break; |
1954 | 1954 | case 'featured': |
1955 | - $orderby = $table . ".is_featured ASC, "; |
|
1955 | + $orderby = $table.".is_featured ASC, "; |
|
1956 | 1956 | break; |
1957 | 1957 | case 'az': |
1958 | - $orderby = $wpdb->posts . ".post_title ASC, "; |
|
1958 | + $orderby = $wpdb->posts.".post_title ASC, "; |
|
1959 | 1959 | break; |
1960 | 1960 | case 'high_review': |
1961 | - $orderby = $table . ".rating_count DESC, " . $table . ".overall_rating DESC, "; |
|
1961 | + $orderby = $table.".rating_count DESC, ".$table.".overall_rating DESC, "; |
|
1962 | 1962 | break; |
1963 | 1963 | case 'high_rating': |
1964 | - $orderby = "( " . $table . ".overall_rating ) DESC, "; |
|
1964 | + $orderby = "( ".$table.".overall_rating ) DESC, "; |
|
1965 | 1965 | break; |
1966 | 1966 | case 'random': |
1967 | 1967 | $orderby = "RAND(), "; |
1968 | 1968 | break; |
1969 | 1969 | default: |
1970 | - $orderby = $wpdb->posts . ".post_title ASC, "; |
|
1970 | + $orderby = $wpdb->posts.".post_title ASC, "; |
|
1971 | 1971 | break; |
1972 | 1972 | } |
1973 | 1973 | |
@@ -1994,9 +1994,9 @@ discard block |
||
1994 | 1994 | $gd_query_args_widgets = $query_args; |
1995 | 1995 | |
1996 | 1996 | $post_type = empty($query_args['post_type']) ? 'gd_place' : $query_args['post_type']; |
1997 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
1997 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
1998 | 1998 | |
1999 | - $fields = $wpdb->posts . ".*, " . $table . ".*"; |
|
1999 | + $fields = $wpdb->posts.".*, ".$table.".*"; |
|
2000 | 2000 | /** |
2001 | 2001 | * Filter widget listing fields string part that is being used for query. |
2002 | 2002 | * |
@@ -2007,7 +2007,7 @@ discard block |
||
2007 | 2007 | */ |
2008 | 2008 | $fields = apply_filters('geodir_filter_widget_listings_fields', $fields, $table, $post_type); |
2009 | 2009 | |
2010 | - $join = "INNER JOIN " . $table . " ON (" . $table . ".post_id = " . $wpdb->posts . ".ID)"; |
|
2010 | + $join = "INNER JOIN ".$table." ON (".$table.".post_id = ".$wpdb->posts.".ID)"; |
|
2011 | 2011 | |
2012 | 2012 | ########### WPML ########### |
2013 | 2013 | |
@@ -2015,7 +2015,7 @@ discard block |
||
2015 | 2015 | global $sitepress; |
2016 | 2016 | $lang_code = ICL_LANGUAGE_CODE; |
2017 | 2017 | if ($lang_code) { |
2018 | - $join .= " JOIN " . $table_prefix . "icl_translations icl_t ON icl_t.element_id = " . $table_prefix . "posts.ID"; |
|
2018 | + $join .= " JOIN ".$table_prefix."icl_translations icl_t ON icl_t.element_id = ".$table_prefix."posts.ID"; |
|
2019 | 2019 | } |
2020 | 2020 | } |
2021 | 2021 | |
@@ -2030,9 +2030,9 @@ discard block |
||
2030 | 2030 | */ |
2031 | 2031 | $join = apply_filters('geodir_filter_widget_listings_join', $join, $post_type); |
2032 | 2032 | |
2033 | - $post_status = is_super_admin() ? " OR " . $wpdb->posts . ".post_status = 'private'" : ''; |
|
2033 | + $post_status = is_super_admin() ? " OR ".$wpdb->posts.".post_status = 'private'" : ''; |
|
2034 | 2034 | |
2035 | - $where = " AND ( " . $wpdb->posts . ".post_status = 'publish' " . $post_status . " ) AND " . $wpdb->posts . ".post_type = '" . $post_type . "'"; |
|
2035 | + $where = " AND ( ".$wpdb->posts.".post_status = 'publish' ".$post_status." ) AND ".$wpdb->posts.".post_type = '".$post_type."'"; |
|
2036 | 2036 | |
2037 | 2037 | ########### WPML ########### |
2038 | 2038 | if (function_exists('icl_object_id')) { |
@@ -2049,7 +2049,7 @@ discard block |
||
2049 | 2049 | * @param string $post_type Post type. |
2050 | 2050 | */ |
2051 | 2051 | $where = apply_filters('geodir_filter_widget_listings_where', $where, $post_type); |
2052 | - $where = $where != '' ? " WHERE 1=1 " . $where : ''; |
|
2052 | + $where = $where != '' ? " WHERE 1=1 ".$where : ''; |
|
2053 | 2053 | |
2054 | 2054 | $groupby = " GROUP BY $wpdb->posts.ID "; |
2055 | 2055 | /** |
@@ -2062,10 +2062,10 @@ discard block |
||
2062 | 2062 | $groupby = apply_filters('geodir_filter_widget_listings_groupby', $groupby, $post_type); |
2063 | 2063 | |
2064 | 2064 | if ($count_only) { |
2065 | - $sql = "SELECT COUNT(" . $wpdb->posts . ".ID) AS total FROM " . $wpdb->posts . " |
|
2066 | - " . $join . " |
|
2065 | + $sql = "SELECT COUNT(".$wpdb->posts.".ID) AS total FROM ".$wpdb->posts." |
|
2066 | + " . $join." |
|
2067 | 2067 | " . $where; |
2068 | - $rows = (int)$wpdb->get_var($sql); |
|
2068 | + $rows = (int) $wpdb->get_var($sql); |
|
2069 | 2069 | } else { |
2070 | 2070 | $orderby = geodir_widget_listings_get_order($query_args); |
2071 | 2071 | /** |
@@ -2077,8 +2077,8 @@ discard block |
||
2077 | 2077 | * @param string $post_type Post type. |
2078 | 2078 | */ |
2079 | 2079 | $orderby = apply_filters('geodir_filter_widget_listings_orderby', $orderby, $table, $post_type); |
2080 | - $orderby .= $wpdb->posts . ".post_title ASC"; |
|
2081 | - $orderby = $orderby != '' ? " ORDER BY " . $orderby : ''; |
|
2080 | + $orderby .= $wpdb->posts.".post_title ASC"; |
|
2081 | + $orderby = $orderby != '' ? " ORDER BY ".$orderby : ''; |
|
2082 | 2082 | |
2083 | 2083 | $limit = !empty($query_args['posts_per_page']) ? $query_args['posts_per_page'] : 5; |
2084 | 2084 | /** |
@@ -2091,16 +2091,16 @@ discard block |
||
2091 | 2091 | $limit = apply_filters('geodir_filter_widget_listings_limit', $limit, $post_type); |
2092 | 2092 | |
2093 | 2093 | $page = !empty($query_args['pageno']) ? absint($query_args['pageno']) : 1; |
2094 | - if ( !$page ) |
|
2094 | + if (!$page) |
|
2095 | 2095 | $page = 1; |
2096 | 2096 | |
2097 | - $limit = (int)$limit > 0 ? " LIMIT " . absint( ( $page - 1 ) * (int)$limit ) . ", " . (int)$limit : ""; |
|
2097 | + $limit = (int) $limit > 0 ? " LIMIT ".absint(($page - 1) * (int) $limit).", ".(int) $limit : ""; |
|
2098 | 2098 | |
2099 | - $sql = "SELECT SQL_CALC_FOUND_ROWS " . $fields . " FROM " . $wpdb->posts . " |
|
2100 | - " . $join . " |
|
2101 | - " . $where . " |
|
2102 | - " . $groupby . " |
|
2103 | - " . $orderby . " |
|
2099 | + $sql = "SELECT SQL_CALC_FOUND_ROWS ".$fields." FROM ".$wpdb->posts." |
|
2100 | + " . $join." |
|
2101 | + " . $where." |
|
2102 | + " . $groupby." |
|
2103 | + " . $orderby." |
|
2104 | 2104 | " . $limit; |
2105 | 2105 | $rows = $wpdb->get_results($sql); |
2106 | 2106 | } |
@@ -2153,10 +2153,10 @@ discard block |
||
2153 | 2153 | } |
2154 | 2154 | |
2155 | 2155 | $post_type = empty($query_args['post_type']) ? 'gd_place' : $query_args['post_type']; |
2156 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
2156 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
2157 | 2157 | |
2158 | 2158 | if (!empty($query_args['with_pics_only'])) { |
2159 | - $join .= " LEFT JOIN " . GEODIR_ATTACHMENT_TABLE . " ON ( " . GEODIR_ATTACHMENT_TABLE . ".post_id=" . $table . ".post_id AND " . GEODIR_ATTACHMENT_TABLE . ".mime_type LIKE '%image%' )"; |
|
2159 | + $join .= " LEFT JOIN ".GEODIR_ATTACHMENT_TABLE." ON ( ".GEODIR_ATTACHMENT_TABLE.".post_id=".$table.".post_id AND ".GEODIR_ATTACHMENT_TABLE.".mime_type LIKE '%image%' )"; |
|
2160 | 2160 | } |
2161 | 2161 | |
2162 | 2162 | if (!empty($query_args['tax_query'])) { |
@@ -2188,7 +2188,7 @@ discard block |
||
2188 | 2188 | return $where; |
2189 | 2189 | } |
2190 | 2190 | $post_type = empty($query_args['post_type']) ? 'gd_place' : $query_args['post_type']; |
2191 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
2191 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
2192 | 2192 | |
2193 | 2193 | if (!empty($query_args)) { |
2194 | 2194 | if (!empty($query_args['gd_location']) && function_exists('geodir_default_location_where')) { |
@@ -2196,27 +2196,27 @@ discard block |
||
2196 | 2196 | } |
2197 | 2197 | |
2198 | 2198 | if (!empty($query_args['post_author'])) { |
2199 | - $where .= " AND " . $wpdb->posts . ".post_author = " . (int)$query_args['post_author']; |
|
2199 | + $where .= " AND ".$wpdb->posts.".post_author = ".(int) $query_args['post_author']; |
|
2200 | 2200 | } |
2201 | 2201 | |
2202 | 2202 | if (!empty($query_args['show_featured_only'])) { |
2203 | - $where .= " AND " . $table . ".is_featured = '1'"; |
|
2203 | + $where .= " AND ".$table.".is_featured = '1'"; |
|
2204 | 2204 | } |
2205 | 2205 | |
2206 | 2206 | if (!empty($query_args['show_special_only'])) { |
2207 | - $where .= " AND ( " . $table . ".geodir_special_offers != '' AND " . $table . ".geodir_special_offers IS NOT NULL )"; |
|
2207 | + $where .= " AND ( ".$table.".geodir_special_offers != '' AND ".$table.".geodir_special_offers IS NOT NULL )"; |
|
2208 | 2208 | } |
2209 | 2209 | |
2210 | 2210 | if (!empty($query_args['with_pics_only'])) { |
2211 | - $where .= " AND " . GEODIR_ATTACHMENT_TABLE . ".ID IS NOT NULL "; |
|
2211 | + $where .= " AND ".GEODIR_ATTACHMENT_TABLE.".ID IS NOT NULL "; |
|
2212 | 2212 | } |
2213 | 2213 | |
2214 | 2214 | if (!empty($query_args['featured_image_only'])) { |
2215 | - $where .= " AND " . $table . ".featured_image IS NOT NULL AND " . $table . ".featured_image!='' "; |
|
2215 | + $where .= " AND ".$table.".featured_image IS NOT NULL AND ".$table.".featured_image!='' "; |
|
2216 | 2216 | } |
2217 | 2217 | |
2218 | 2218 | if (!empty($query_args['with_videos_only'])) { |
2219 | - $where .= " AND ( " . $table . ".geodir_video != '' AND " . $table . ".geodir_video IS NOT NULL )"; |
|
2219 | + $where .= " AND ( ".$table.".geodir_video != '' AND ".$table.".geodir_video IS NOT NULL )"; |
|
2220 | 2220 | } |
2221 | 2221 | |
2222 | 2222 | if (!empty($query_args['tax_query'])) { |
@@ -2273,7 +2273,7 @@ discard block |
||
2273 | 2273 | } |
2274 | 2274 | |
2275 | 2275 | if (!empty($query_args) && !empty($query_args['posts_per_page'])) { |
2276 | - $limit = (int)$query_args['posts_per_page']; |
|
2276 | + $limit = (int) $query_args['posts_per_page']; |
|
2277 | 2277 | } |
2278 | 2278 | |
2279 | 2279 | return $limit; |
@@ -2416,9 +2416,9 @@ discard block |
||
2416 | 2416 | add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2); |
2417 | 2417 | } |
2418 | 2418 | $home_url = str_replace("www.", "", $home_url); |
2419 | - 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')) ) { |
|
2419 | + 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'))) { |
|
2420 | 2420 | return true; |
2421 | - }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')){ |
|
2421 | + }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')) { |
|
2422 | 2422 | return true; |
2423 | 2423 | } else { |
2424 | 2424 | return false; |
@@ -2501,19 +2501,19 @@ discard block |
||
2501 | 2501 | |
2502 | 2502 | $gd_post_type = geodir_get_current_posttype(); |
2503 | 2503 | |
2504 | - $category_limit = isset($instance['category_limit']) && $instance['category_limit'] > 0 ? (int)$instance['category_limit'] : 15; |
|
2505 | - if(!empty($gd_post_type)){ |
|
2504 | + $category_limit = isset($instance['category_limit']) && $instance['category_limit'] > 0 ? (int) $instance['category_limit'] : 15; |
|
2505 | + if (!empty($gd_post_type)) { |
|
2506 | 2506 | $default_post_type = $gd_post_type; |
2507 | - }elseif(isset($instance['default_post_type']) && gdsc_is_post_type_valid($instance['default_post_type']) ){ |
|
2507 | + }elseif (isset($instance['default_post_type']) && gdsc_is_post_type_valid($instance['default_post_type'])) { |
|
2508 | 2508 | $default_post_type = $instance['default_post_type']; |
2509 | - }else{ |
|
2509 | + } else { |
|
2510 | 2510 | $all_gd_post_type = geodir_get_posttypes(); |
2511 | 2511 | $default_post_type = (isset($all_gd_post_type[0])) ? $all_gd_post_type[0] : ''; |
2512 | 2512 | } |
2513 | 2513 | |
2514 | 2514 | $taxonomy = array(); |
2515 | 2515 | if (!empty($gd_post_type)) { |
2516 | - $taxonomy[] = $gd_post_type . "category"; |
|
2516 | + $taxonomy[] = $gd_post_type."category"; |
|
2517 | 2517 | } else { |
2518 | 2518 | $taxonomy = geodir_get_taxonomies($gd_post_type); |
2519 | 2519 | } |
@@ -2533,7 +2533,7 @@ discard block |
||
2533 | 2533 | $b_terms[$b_key] = geodir_sort_terms($b_val, 'count'); |
2534 | 2534 | } |
2535 | 2535 | |
2536 | - $default_taxonomy = $default_post_type != '' && isset($b_terms[$default_post_type . 'category']) ? $default_post_type . 'category' : ''; |
|
2536 | + $default_taxonomy = $default_post_type != '' && isset($b_terms[$default_post_type.'category']) ? $default_post_type.'category' : ''; |
|
2537 | 2537 | |
2538 | 2538 | $tax_change_output = ''; |
2539 | 2539 | if (count($b_terms) > 1) { |
@@ -2541,20 +2541,20 @@ discard block |
||
2541 | 2541 | foreach ($b_terms as $key => $val) { |
2542 | 2542 | $ptype = get_post_type_object(str_replace("category", "", $key)); |
2543 | 2543 | $cpt_name = __($ptype->labels->singular_name, 'geodirectory'); |
2544 | - $tax_change_output .= "<option value='$key' ". selected($key, $default_taxonomy, false) .">" . sprintf(__('%s Categories', 'geodirectory'),$cpt_name) . "</option>"; |
|
2544 | + $tax_change_output .= "<option value='$key' ".selected($key, $default_taxonomy, false).">".sprintf(__('%s Categories', 'geodirectory'), $cpt_name)."</option>"; |
|
2545 | 2545 | } |
2546 | 2546 | $tax_change_output .= "</select>"; |
2547 | 2547 | } |
2548 | 2548 | |
2549 | 2549 | if (!empty($b_terms)) { |
2550 | - $terms = $default_taxonomy != '' && isset($b_terms[$default_taxonomy]) ? $b_terms[$default_taxonomy] : reset($b_terms);// get the first array |
|
2551 | - global $cat_count;//make global so we can change via function |
|
2550 | + $terms = $default_taxonomy != '' && isset($b_terms[$default_taxonomy]) ? $b_terms[$default_taxonomy] : reset($b_terms); // get the first array |
|
2551 | + global $cat_count; //make global so we can change via function |
|
2552 | 2552 | $cat_count = 0; |
2553 | 2553 | ?> |
2554 | 2554 | <div class="geodir-category-list-in clearfix"> |
2555 | 2555 | <div class="geodir-cat-list clearfix"> |
2556 | 2556 | <?php |
2557 | - echo $before_title . __($title) . $after_title; |
|
2557 | + echo $before_title.__($title).$after_title; |
|
2558 | 2558 | |
2559 | 2559 | echo $tax_change_output; |
2560 | 2560 | |
@@ -2571,8 +2571,8 @@ discard block |
||
2571 | 2571 | $hide = 'style="display:none;"'; |
2572 | 2572 | } |
2573 | 2573 | echo "<div class='geodir-cat-list-more' $hide >"; |
2574 | - echo '<a href="javascript:void(0)" class="geodir-morecat geodir-showcat">' . __('More Categories', 'geodirectory') . '</a>'; |
|
2575 | - echo '<a href="javascript:void(0)" class="geodir-morecat geodir-hidecat geodir-hide">' . __('Less Categories', 'geodirectory') . '</a>'; |
|
2574 | + echo '<a href="javascript:void(0)" class="geodir-morecat geodir-showcat">'.__('More Categories', 'geodirectory').'</a>'; |
|
2575 | + echo '<a href="javascript:void(0)" class="geodir-morecat geodir-hidecat geodir-hide">'.__('Less Categories', 'geodirectory').'</a>'; |
|
2576 | 2576 | echo "</div>"; |
2577 | 2577 | /* add scripts */ |
2578 | 2578 | add_action('wp_footer', 'geodir_popular_category_add_scripts', 100); |
@@ -2612,7 +2612,7 @@ discard block |
||
2612 | 2612 | $class_row = $cat_count > $category_limit ? 'geodir-pcat-hide geodir-hide' : 'geodir-pcat-show'; |
2613 | 2613 | $total_post = $cat->count; |
2614 | 2614 | |
2615 | - $term_link = get_term_link( $cat, $cat->taxonomy ); |
|
2615 | + $term_link = get_term_link($cat, $cat->taxonomy); |
|
2616 | 2616 | /** |
2617 | 2617 | * Filer the category term link. |
2618 | 2618 | * |
@@ -2621,10 +2621,10 @@ discard block |
||
2621 | 2621 | * @param int $cat->term_id The term id. |
2622 | 2622 | * @param string $post_type Wordpress post type. |
2623 | 2623 | */ |
2624 | - $term_link = apply_filters( 'geodir_category_term_link', $term_link, $cat->term_id, $post_type ); |
|
2624 | + $term_link = apply_filters('geodir_category_term_link', $term_link, $cat->term_id, $post_type); |
|
2625 | 2625 | |
2626 | - echo '<li class="' . $class_row . '"><a href="' . $term_link . '">'; |
|
2627 | - 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> '; |
|
2626 | + echo '<li class="'.$class_row.'"><a href="'.$term_link.'">'; |
|
2627 | + 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> '; |
|
2628 | 2628 | echo '</a></li>'; |
2629 | 2629 | } |
2630 | 2630 | } |
@@ -2755,29 +2755,29 @@ discard block |
||
2755 | 2755 | itemWidth: 75, |
2756 | 2756 | itemMargin: 5, |
2757 | 2757 | asNavFor: '#geodir_widget_slider', |
2758 | - rtl: <?php echo ( is_rtl() ? 'true' : 'false' ); /* fix rtl issue */ ?> |
|
2758 | + rtl: <?php echo (is_rtl() ? 'true' : 'false'); /* fix rtl issue */ ?> |
|
2759 | 2759 | }); |
2760 | 2760 | |
2761 | 2761 | jQuery('#geodir_widget_slider').flexslider({ |
2762 | - animation: "<?php echo $animation;?>", |
|
2762 | + animation: "<?php echo $animation; ?>", |
|
2763 | 2763 | selector: ".geodir-slides > li", |
2764 | 2764 | namespace: "geodir-", |
2765 | 2765 | controlNav: true, |
2766 | - animationLoop: <?php echo $animationLoop;?>, |
|
2767 | - slideshow: <?php echo $slideshow;?>, |
|
2768 | - slideshowSpeed: <?php echo $slideshowSpeed;?>, |
|
2769 | - animationSpeed: <?php echo $animationSpeed;?>, |
|
2770 | - directionNav: <?php echo $directionNav;?>, |
|
2771 | - maxItems: <?php echo $max_show;?>, |
|
2766 | + animationLoop: <?php echo $animationLoop; ?>, |
|
2767 | + slideshow: <?php echo $slideshow; ?>, |
|
2768 | + slideshowSpeed: <?php echo $slideshowSpeed; ?>, |
|
2769 | + animationSpeed: <?php echo $animationSpeed; ?>, |
|
2770 | + directionNav: <?php echo $directionNav; ?>, |
|
2771 | + maxItems: <?php echo $max_show; ?>, |
|
2772 | 2772 | move: 1, |
2773 | - <?php if($slide_width){ echo "itemWidth: ".$slide_width.",";}?> |
|
2773 | + <?php if ($slide_width) { echo "itemWidth: ".$slide_width.","; }?> |
|
2774 | 2774 | sync: "#geodir_widget_carousel", |
2775 | 2775 | start: function (slider) { |
2776 | 2776 | jQuery('.geodir-listing-flex-loader').hide(); |
2777 | 2777 | jQuery('#geodir_widget_slider').css({'visibility': 'visible'}); |
2778 | 2778 | jQuery('#geodir_widget_carousel').css({'visibility': 'visible'}); |
2779 | 2779 | }, |
2780 | - rtl: <?php echo ( is_rtl() ? 'true' : 'false' ); /* fix rtl issue */ ?> |
|
2780 | + rtl: <?php echo (is_rtl() ? 'true' : 'false'); /* fix rtl issue */ ?> |
|
2781 | 2781 | }); |
2782 | 2782 | }); |
2783 | 2783 | </script> |
@@ -2813,12 +2813,12 @@ discard block |
||
2813 | 2813 | $widget_listings = geodir_get_widget_listings($query_args); |
2814 | 2814 | if (!empty($widget_listings) || (isset($with_no_results) && $with_no_results)) { |
2815 | 2815 | if ($title) { |
2816 | - echo $before_title . $title . $after_title; |
|
2816 | + echo $before_title.$title.$after_title; |
|
2817 | 2817 | } |
2818 | 2818 | |
2819 | 2819 | global $post; |
2820 | 2820 | |
2821 | - $current_post = $post;// keep current post info |
|
2821 | + $current_post = $post; // keep current post info |
|
2822 | 2822 | |
2823 | 2823 | $widget_main_slides = ''; |
2824 | 2824 | $nav_slides = ''; |
@@ -2836,11 +2836,11 @@ discard block |
||
2836 | 2836 | $widget_spacer_height = ((200 - $widget_image->height) / 2); |
2837 | 2837 | } |
2838 | 2838 | |
2839 | - $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" />'; |
|
2839 | + $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" />'; |
|
2840 | 2840 | |
2841 | 2841 | $title = ''; |
2842 | 2842 | if ($show_title) { |
2843 | - $title_html = '<div class="geodir-slider-title"><a href="' . get_permalink($post->ID) . '">' . get_the_title($post->ID) . '</a></div>'; |
|
2843 | + $title_html = '<div class="geodir-slider-title"><a href="'.get_permalink($post->ID).'">'.get_the_title($post->ID).'</a></div>'; |
|
2844 | 2844 | $post_id = $post->ID; |
2845 | 2845 | $post_permalink = get_permalink($post->ID); |
2846 | 2846 | $post_title = get_the_title($post->ID); |
@@ -2853,11 +2853,11 @@ discard block |
||
2853 | 2853 | * @param string $post_permalink The post permalink url. |
2854 | 2854 | * @param string $post_title The post title text. |
2855 | 2855 | */ |
2856 | - $title = apply_filters('geodir_listing_slider_title',$title_html,$post_id,$post_permalink,$post_title); |
|
2856 | + $title = apply_filters('geodir_listing_slider_title', $title_html, $post_id, $post_permalink, $post_title); |
|
2857 | 2857 | } |
2858 | 2858 | |
2859 | - $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>'; |
|
2860 | - $nav_slides .= '<li><img src="' . $widget_image->src . '" alt="' . $widget_image->title . '" title="' . $widget_image->title . '" style="max-height:48px;margin:0 auto;" /></li>'; |
|
2859 | + $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>'; |
|
2860 | + $nav_slides .= '<li><img src="'.$widget_image->src.'" alt="'.$widget_image->title.'" title="'.$widget_image->title.'" style="max-height:48px;margin:0 auto;" /></li>'; |
|
2861 | 2861 | $widget_slides++; |
2862 | 2862 | } |
2863 | 2863 | } |
@@ -2901,7 +2901,7 @@ discard block |
||
2901 | 2901 | $title = empty($instance['title']) ? __('My Dashboard', 'geodirectory') : apply_filters('widget_title', __($instance['title'], 'geodirectory')); |
2902 | 2902 | |
2903 | 2903 | echo $before_widget; |
2904 | - echo $before_title . $title . $after_title; |
|
2904 | + echo $before_title.$title.$after_title; |
|
2905 | 2905 | |
2906 | 2906 | if (is_user_logged_in()) { |
2907 | 2907 | global $current_user; |
@@ -2943,7 +2943,7 @@ discard block |
||
2943 | 2943 | */ |
2944 | 2944 | $add_link = apply_filters('geodir_dashboard_link_add_listing', $add_link, $key, $current_user->ID); |
2945 | 2945 | |
2946 | - $addlisting_links .= '<option ' . $selected . ' value="' . $add_link . '">' . __(ucfirst($name), 'geodirectory') . '</option>'; |
|
2946 | + $addlisting_links .= '<option '.$selected.' value="'.$add_link.'">'.__(ucfirst($name), 'geodirectory').'</option>'; |
|
2947 | 2947 | |
2948 | 2948 | } |
2949 | 2949 | } |
@@ -2989,7 +2989,7 @@ discard block |
||
2989 | 2989 | */ |
2990 | 2990 | $post_type_link = apply_filters('geodir_dashboard_link_favorite_listing', $post_type_link, $key, $current_user->ID); |
2991 | 2991 | |
2992 | - $favourite_links .= '<option ' . $selected . ' value="' . $post_type_link . '">' . __(ucfirst($name), 'geodirectory') . '</option>'; |
|
2992 | + $favourite_links .= '<option '.$selected.' value="'.$post_type_link.'">'.__(ucfirst($name), 'geodirectory').'</option>'; |
|
2993 | 2993 | } |
2994 | 2994 | } |
2995 | 2995 | |
@@ -3034,7 +3034,7 @@ discard block |
||
3034 | 3034 | */ |
3035 | 3035 | $listing_link = apply_filters('geodir_dashboard_link_my_listing', $listing_link, $key, $current_user->ID); |
3036 | 3036 | |
3037 | - $listing_links .= '<option ' . $selected . ' value="' . $listing_link . '">' . __(ucfirst($name), 'geodirectory') . '</option>'; |
|
3037 | + $listing_links .= '<option '.$selected.' value="'.$listing_link.'">'.__(ucfirst($name), 'geodirectory').'</option>'; |
|
3038 | 3038 | } |
3039 | 3039 | } |
3040 | 3040 | |
@@ -3217,7 +3217,7 @@ discard block |
||
3217 | 3217 | } |
3218 | 3218 | |
3219 | 3219 | if (empty($title) || $title == 'All') { |
3220 | - $title .= ' ' . __(get_post_type_plural_label($post_type), 'geodirectory'); |
|
3220 | + $title .= ' '.__(get_post_type_plural_label($post_type), 'geodirectory'); |
|
3221 | 3221 | } |
3222 | 3222 | |
3223 | 3223 | $location_url = array(); |
@@ -3271,7 +3271,7 @@ discard block |
||
3271 | 3271 | $geodir_add_location_url = '1'; |
3272 | 3272 | } |
3273 | 3273 | |
3274 | - $viewall_url = get_term_link((int)$category[0], $post_type . 'category'); |
|
3274 | + $viewall_url = get_term_link((int) $category[0], $post_type.'category'); |
|
3275 | 3275 | |
3276 | 3276 | $geodir_add_location_url = NULL; |
3277 | 3277 | } |
@@ -3279,7 +3279,7 @@ discard block |
||
3279 | 3279 | $gd_session->set('gd_multi_location', 1); |
3280 | 3280 | } |
3281 | 3281 | |
3282 | - if(is_wp_error( $viewall_url )){$viewall_url = '';} |
|
3282 | + if (is_wp_error($viewall_url)) {$viewall_url = ''; } |
|
3283 | 3283 | |
3284 | 3284 | $query_args = array( |
3285 | 3285 | 'posts_per_page' => $post_number, |
@@ -3345,7 +3345,7 @@ discard block |
||
3345 | 3345 | */ |
3346 | 3346 | do_action('geodir_before_view_all_link_in_widget'); ?> |
3347 | 3347 | <div class="geodir_list_heading clearfix"> |
3348 | - <?php echo $before_title . $title . $after_title; ?> |
|
3348 | + <?php echo $before_title.$title.$after_title; ?> |
|
3349 | 3349 | <a href="<?php echo $viewall_url; ?>" |
3350 | 3350 | class="geodir-viewall"><?php _e('View all', 'geodirectory'); ?></a> |
3351 | 3351 | </div> |
@@ -3431,9 +3431,9 @@ discard block |
||
3431 | 3431 | { |
3432 | 3432 | global $wpdb, $plugin_prefix; |
3433 | 3433 | |
3434 | - $detail_table = $plugin_prefix . $post_type . '_detail'; |
|
3434 | + $detail_table = $plugin_prefix.$post_type.'_detail'; |
|
3435 | 3435 | |
3436 | - $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 . ")"; |
|
3436 | + $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.")"; |
|
3437 | 3437 | |
3438 | 3438 | /** |
3439 | 3439 | * Filter count review sql query. |
@@ -3472,7 +3472,7 @@ discard block |
||
3472 | 3472 | * @param bool $force_update Force update option value?. Default.false. |
3473 | 3473 | * @param int $post_ID The post id to update if any. |
3474 | 3474 | */ |
3475 | - $option_data = apply_filters('geodir_count_reviews_by_terms_before', '', $force_update,$post_ID); |
|
3475 | + $option_data = apply_filters('geodir_count_reviews_by_terms_before', '', $force_update, $post_ID); |
|
3476 | 3476 | if (!empty($option_data)) { |
3477 | 3477 | return $option_data; |
3478 | 3478 | } |
@@ -3480,11 +3480,11 @@ discard block |
||
3480 | 3480 | $option_data = get_option('geodir_global_review_count'); |
3481 | 3481 | |
3482 | 3482 | if (!$option_data || $force_update) { |
3483 | - if ((int)$post_ID > 0) { // Update reviews count for specific post categories only. |
|
3483 | + if ((int) $post_ID > 0) { // Update reviews count for specific post categories only. |
|
3484 | 3484 | global $gd_session; |
3485 | - $term_array = (array)$option_data; |
|
3485 | + $term_array = (array) $option_data; |
|
3486 | 3486 | $post_type = get_post_type($post_ID); |
3487 | - $taxonomy = $post_type . 'category'; |
|
3487 | + $taxonomy = $post_type.'category'; |
|
3488 | 3488 | $terms = wp_get_object_terms($post_ID, $taxonomy, array('fields' => 'ids')); |
3489 | 3489 | |
3490 | 3490 | if (!empty($terms) && !is_wp_error($terms)) { |
@@ -3499,9 +3499,9 @@ discard block |
||
3499 | 3499 | |
3500 | 3500 | $terms = array(); |
3501 | 3501 | if (isset($_POST['post_category'][$taxonomy])) { |
3502 | - $terms = (array)$_POST['post_category'][$taxonomy]; |
|
3502 | + $terms = (array) $_POST['post_category'][$taxonomy]; |
|
3503 | 3503 | } else if (!empty($session_listing) && isset($session_listing['post_category'][$taxonomy])) { |
3504 | - $terms = (array)$session_listing['post_category'][$taxonomy]; |
|
3504 | + $terms = (array) $session_listing['post_category'][$taxonomy]; |
|
3505 | 3505 | } |
3506 | 3506 | |
3507 | 3507 | if (!empty($terms)) { |
@@ -3589,7 +3589,7 @@ discard block |
||
3589 | 3589 | return true; |
3590 | 3590 | } |
3591 | 3591 | |
3592 | -function geodir_term_review_count_force_update_single_post($post_id){ |
|
3592 | +function geodir_term_review_count_force_update_single_post($post_id) { |
|
3593 | 3593 | geodir_count_reviews_by_terms(true, $post_id); |
3594 | 3594 | } |
3595 | 3595 | |
@@ -3726,17 +3726,17 @@ discard block |
||
3726 | 3726 | */ |
3727 | 3727 | $locale = apply_filters('plugin_locale', get_locale(), 'geodirectory'); |
3728 | 3728 | |
3729 | - load_textdomain('geodirectory', WP_LANG_DIR . '/' . 'geodirectory' . '/' . 'geodirectory' . '-' . $locale . '.mo'); |
|
3730 | - load_plugin_textdomain('geodirectory', false, plugin_basename(dirname(dirname(__FILE__))) . '/geodirectory-languages'); |
|
3729 | + load_textdomain('geodirectory', WP_LANG_DIR.'/'.'geodirectory'.'/'.'geodirectory'.'-'.$locale.'.mo'); |
|
3730 | + load_plugin_textdomain('geodirectory', false, plugin_basename(dirname(dirname(__FILE__))).'/geodirectory-languages'); |
|
3731 | 3731 | |
3732 | 3732 | /** |
3733 | 3733 | * Define language constants. |
3734 | 3734 | * |
3735 | 3735 | * @since 1.0.0 |
3736 | 3736 | */ |
3737 | - require_once(geodir_plugin_path() . '/language.php'); |
|
3737 | + require_once(geodir_plugin_path().'/language.php'); |
|
3738 | 3738 | |
3739 | - $language_file = geodir_plugin_path() . '/db-language.php'; |
|
3739 | + $language_file = geodir_plugin_path().'/db-language.php'; |
|
3740 | 3740 | |
3741 | 3741 | // Load language string file if not created yet |
3742 | 3742 | if (!file_exists($language_file)) { |
@@ -3751,8 +3751,8 @@ discard block |
||
3751 | 3751 | */ |
3752 | 3752 | try { |
3753 | 3753 | require_once($language_file); |
3754 | - } catch(Exception $e) { |
|
3755 | - error_log('Language Error: ' . $e->getMessage()); |
|
3754 | + } catch (Exception $e) { |
|
3755 | + error_log('Language Error: '.$e->getMessage()); |
|
3756 | 3756 | } |
3757 | 3757 | } |
3758 | 3758 | } |
@@ -3769,18 +3769,18 @@ discard block |
||
3769 | 3769 | */ |
3770 | 3770 | function geodirectory_load_db_language() { |
3771 | 3771 | global $wp_filesystem; |
3772 | - if( empty( $wp_filesystem ) ) { |
|
3773 | - require_once( ABSPATH .'/wp-admin/includes/file.php' ); |
|
3772 | + if (empty($wp_filesystem)) { |
|
3773 | + require_once(ABSPATH.'/wp-admin/includes/file.php'); |
|
3774 | 3774 | WP_Filesystem(); |
3775 | 3775 | global $wp_filesystem; |
3776 | 3776 | } |
3777 | 3777 | |
3778 | - $language_file = geodir_plugin_path() . '/db-language.php'; |
|
3778 | + $language_file = geodir_plugin_path().'/db-language.php'; |
|
3779 | 3779 | |
3780 | - if(is_file($language_file) && !is_writable($language_file)) |
|
3780 | + if (is_file($language_file) && !is_writable($language_file)) |
|
3781 | 3781 | return false; // Not possible to create. |
3782 | 3782 | |
3783 | - if(!is_file($language_file) && !is_writable(dirname($language_file))) |
|
3783 | + if (!is_file($language_file) && !is_writable(dirname($language_file))) |
|
3784 | 3784 | return false; // Not possible to create. |
3785 | 3785 | |
3786 | 3786 | $contents_strings = array(); |
@@ -3814,17 +3814,17 @@ discard block |
||
3814 | 3814 | $contents = implode(PHP_EOL, $contents_head); |
3815 | 3815 | |
3816 | 3816 | if (!empty($contents_strings)) { |
3817 | - foreach ( $contents_strings as $string ) { |
|
3817 | + foreach ($contents_strings as $string) { |
|
3818 | 3818 | if (is_scalar($string) && $string != '') { |
3819 | 3819 | $string = str_replace("'", "\'", $string); |
3820 | - $contents .= PHP_EOL . "__('" . $string . "', 'geodirectory');"; |
|
3820 | + $contents .= PHP_EOL."__('".$string."', 'geodirectory');"; |
|
3821 | 3821 | } |
3822 | 3822 | } |
3823 | 3823 | } |
3824 | 3824 | |
3825 | 3825 | $contents .= implode(PHP_EOL, $contents_foot); |
3826 | 3826 | |
3827 | - if($wp_filesystem->put_contents( $language_file, $contents, FS_CHMOD_FILE)) |
|
3827 | + if ($wp_filesystem->put_contents($language_file, $contents, FS_CHMOD_FILE)) |
|
3828 | 3828 | return false; // Failure; could not write file. |
3829 | 3829 | |
3830 | 3830 | return true; |
@@ -3846,11 +3846,11 @@ discard block |
||
3846 | 3846 | global $wpdb; |
3847 | 3847 | |
3848 | 3848 | // Custom fields table |
3849 | - $sql = "SELECT admin_title, admin_desc, site_title, clabels, required_msg, default_value, option_values FROM " . GEODIR_CUSTOM_FIELDS_TABLE; |
|
3849 | + $sql = "SELECT admin_title, admin_desc, site_title, clabels, required_msg, default_value, option_values FROM ".GEODIR_CUSTOM_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->admin_title)) |
3855 | 3855 | $translation_texts[] = stripslashes_deep($row->admin_title); |
3856 | 3856 | |
@@ -3884,11 +3884,11 @@ discard block |
||
3884 | 3884 | } |
3885 | 3885 | |
3886 | 3886 | // Custom sorting fields table |
3887 | - $sql = "SELECT site_title, asc_title, desc_title FROM " . GEODIR_CUSTOM_SORT_FIELDS_TABLE; |
|
3887 | + $sql = "SELECT site_title, asc_title, desc_title FROM ".GEODIR_CUSTOM_SORT_FIELDS_TABLE; |
|
3888 | 3888 | $rows = $wpdb->get_results($sql); |
3889 | 3889 | |
3890 | 3890 | if (!empty($rows)) { |
3891 | - foreach($rows as $row) { |
|
3891 | + foreach ($rows as $row) { |
|
3892 | 3892 | if (!empty($row->site_title)) |
3893 | 3893 | $translation_texts[] = stripslashes_deep($row->site_title); |
3894 | 3894 | |
@@ -3902,11 +3902,11 @@ discard block |
||
3902 | 3902 | |
3903 | 3903 | // Advance search filter fields table |
3904 | 3904 | if (defined('GEODIR_ADVANCE_SEARCH_TABLE')) { |
3905 | - $sql = "SELECT field_site_name, front_search_title, field_desc FROM " . GEODIR_ADVANCE_SEARCH_TABLE; |
|
3905 | + $sql = "SELECT field_site_name, front_search_title, field_desc FROM ".GEODIR_ADVANCE_SEARCH_TABLE; |
|
3906 | 3906 | $rows = $wpdb->get_results($sql); |
3907 | 3907 | |
3908 | 3908 | if (!empty($rows)) { |
3909 | - foreach($rows as $row) { |
|
3909 | + foreach ($rows as $row) { |
|
3910 | 3910 | if (!empty($row->field_site_name)) |
3911 | 3911 | $translation_texts[] = stripslashes_deep($row->field_site_name); |
3912 | 3912 | |
@@ -3941,7 +3941,7 @@ discard block |
||
3941 | 3941 | * |
3942 | 3942 | * @param array $geodir_allowed_mime_types and file extensions. |
3943 | 3943 | */ |
3944 | - return apply_filters( 'geodir_allowed_mime_types', array( |
|
3944 | + return apply_filters('geodir_allowed_mime_types', array( |
|
3945 | 3945 | 'Image' => array( // Image formats. |
3946 | 3946 | 'jpg' => 'image/jpeg', |
3947 | 3947 | 'jpe' => 'image/jpeg', |
@@ -4030,13 +4030,13 @@ discard block |
||
4030 | 4030 | |
4031 | 4031 | |
4032 | 4032 | |
4033 | -add_filter('wpseo_replacements','geodir_wpseo_replacements',10,1); |
|
4033 | +add_filter('wpseo_replacements', 'geodir_wpseo_replacements', 10, 1); |
|
4034 | 4034 | /* |
4035 | 4035 | * Add location variables to wpseo replacements. |
4036 | 4036 | * |
4037 | 4037 | * @since 1.5.4 |
4038 | 4038 | */ |
4039 | -function geodir_wpseo_replacements($vars){ |
|
4039 | +function geodir_wpseo_replacements($vars) { |
|
4040 | 4040 | |
4041 | 4041 | global $wp; |
4042 | 4042 | $title = ''; |
@@ -4051,12 +4051,12 @@ discard block |
||
4051 | 4051 | * @param array $location_array The array of location variables. |
4052 | 4052 | * @param array $vars The page title variables. |
4053 | 4053 | */ |
4054 | - $location_array = apply_filters('geodir_filter_title_variables_location_arr_seo',$location_array, $vars); |
|
4054 | + $location_array = apply_filters('geodir_filter_title_variables_location_arr_seo', $location_array, $vars); |
|
4055 | 4055 | $location_titles = array(); |
4056 | - if(get_query_var( 'gd_country_full' )){ |
|
4057 | - if(get_query_var( 'gd_country_full' )){$location_array['gd_country'] = get_query_var( 'gd_country_full' );} |
|
4058 | - if(get_query_var( 'gd_region_full' )){$location_array['gd_region'] = get_query_var( 'gd_region_full' );} |
|
4059 | - if(get_query_var( 'gd_city_full' )){$location_array['gd_city'] = get_query_var( 'gd_city_full' );} |
|
4056 | + if (get_query_var('gd_country_full')) { |
|
4057 | + if (get_query_var('gd_country_full')) {$location_array['gd_country'] = get_query_var('gd_country_full'); } |
|
4058 | + if (get_query_var('gd_region_full')) {$location_array['gd_region'] = get_query_var('gd_region_full'); } |
|
4059 | + if (get_query_var('gd_city_full')) {$location_array['gd_city'] = get_query_var('gd_city_full'); } |
|
4060 | 4060 | } |
4061 | 4061 | $location_single = ''; |
4062 | 4062 | $gd_country = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : ''; |
@@ -4128,23 +4128,23 @@ discard block |
||
4128 | 4128 | } |
4129 | 4129 | |
4130 | 4130 | |
4131 | - if(!empty($location_titles)) { |
|
4131 | + if (!empty($location_titles)) { |
|
4132 | 4132 | $vars['%%location%%'] = implode(", ", $location_titles); |
4133 | 4133 | } |
4134 | 4134 | |
4135 | 4135 | |
4136 | - if(!empty($location_titles)) { |
|
4137 | - $vars['%%in_location%%'] = __('in ', 'geodirectory') . implode(", ", $location_titles); |
|
4136 | + if (!empty($location_titles)) { |
|
4137 | + $vars['%%in_location%%'] = __('in ', 'geodirectory').implode(", ", $location_titles); |
|
4138 | 4138 | } |
4139 | 4139 | |
4140 | 4140 | |
4141 | 4141 | |
4142 | - if($location_single) { |
|
4143 | - $vars['%%in_location_single%%'] = __('in', 'geodirectory') . ' ' .$location_single; |
|
4142 | + if ($location_single) { |
|
4143 | + $vars['%%in_location_single%%'] = __('in', 'geodirectory').' '.$location_single; |
|
4144 | 4144 | } |
4145 | 4145 | |
4146 | 4146 | |
4147 | - if($location_single) { |
|
4147 | + if ($location_single) { |
|
4148 | 4148 | $vars['%%location_single%%'] = $location_single; |
4149 | 4149 | } |
4150 | 4150 | |
@@ -4156,17 +4156,17 @@ discard block |
||
4156 | 4156 | * @param string $vars The title with variables. |
4157 | 4157 | * @param array $location_array The array of location variables. |
4158 | 4158 | */ |
4159 | - return apply_filters('geodir_wpseo_replacements_vars',$vars,$location_array); |
|
4159 | + return apply_filters('geodir_wpseo_replacements_vars', $vars, $location_array); |
|
4160 | 4160 | } |
4161 | 4161 | |
4162 | 4162 | |
4163 | -add_filter('geodir_seo_meta_title','geodir_filter_title_variables',10,3); |
|
4164 | -add_filter('geodir_seo_page_title','geodir_filter_title_variables',10,2); |
|
4165 | -add_filter('geodir_seo_meta_description_pre','geodir_filter_title_variables',10,3); |
|
4166 | -function geodir_filter_title_variables($title, $gd_page, $sep=''){ |
|
4163 | +add_filter('geodir_seo_meta_title', 'geodir_filter_title_variables', 10, 3); |
|
4164 | +add_filter('geodir_seo_page_title', 'geodir_filter_title_variables', 10, 2); |
|
4165 | +add_filter('geodir_seo_meta_description_pre', 'geodir_filter_title_variables', 10, 3); |
|
4166 | +function geodir_filter_title_variables($title, $gd_page, $sep = '') { |
|
4167 | 4167 | |
4168 | 4168 | |
4169 | - if(!$gd_page || !$title){return $title;}// if no a GD page then bail. |
|
4169 | + if (!$gd_page || !$title) {return $title; }// if no a GD page then bail. |
|
4170 | 4170 | global $post; |
4171 | 4171 | //print_r($post); |
4172 | 4172 | /* |
@@ -4208,123 +4208,123 @@ discard block |
||
4208 | 4208 | } |
4209 | 4209 | |
4210 | 4210 | |
4211 | - if(strpos($title,'%%title%%') !== false){ |
|
4212 | - $title = str_replace("%%title%%",$post->post_title,$title); |
|
4211 | + if (strpos($title, '%%title%%') !== false) { |
|
4212 | + $title = str_replace("%%title%%", $post->post_title, $title); |
|
4213 | 4213 | } |
4214 | 4214 | |
4215 | - if(strpos($title,'%%sitename%%') !== false){ |
|
4216 | - $title = str_replace("%%sitename%%",get_bloginfo('name'),$title); |
|
4215 | + if (strpos($title, '%%sitename%%') !== false) { |
|
4216 | + $title = str_replace("%%sitename%%", get_bloginfo('name'), $title); |
|
4217 | 4217 | } |
4218 | 4218 | |
4219 | - if(strpos($title,'%%sitedesc%%') !== false){ |
|
4220 | - $title = str_replace("%%sitedesc%%",get_bloginfo('description'),$title); |
|
4219 | + if (strpos($title, '%%sitedesc%%') !== false) { |
|
4220 | + $title = str_replace("%%sitedesc%%", get_bloginfo('description'), $title); |
|
4221 | 4221 | } |
4222 | 4222 | |
4223 | - if(strpos($title,'%%excerpt%%') !== false){ |
|
4224 | - $title = str_replace("%%excerpt%%",strip_tags(get_the_excerpt()),$title); |
|
4223 | + if (strpos($title, '%%excerpt%%') !== false) { |
|
4224 | + $title = str_replace("%%excerpt%%", strip_tags(get_the_excerpt()), $title); |
|
4225 | 4225 | } |
4226 | 4226 | |
4227 | - if(strpos($title,'%%pt_single%%') !== false){ |
|
4227 | + if (strpos($title, '%%pt_single%%') !== false) { |
|
4228 | 4228 | $single_name = ''; |
4229 | - if($gd_page=='search' || $gd_page=='author'){ |
|
4229 | + if ($gd_page == 'search' || $gd_page == 'author') { |
|
4230 | 4230 | $geodir_post_types = get_option('geodir_post_types'); |
4231 | 4231 | $spt = esc_attr($_REQUEST['stype']); |
4232 | - if(isset($geodir_post_types[$spt]['labels']['singular_name'])){ |
|
4233 | - $single_name = __($geodir_post_types[$spt]['labels']['singular_name'],'geodirectory'); |
|
4232 | + if (isset($geodir_post_types[$spt]['labels']['singular_name'])) { |
|
4233 | + $single_name = __($geodir_post_types[$spt]['labels']['singular_name'], 'geodirectory'); |
|
4234 | 4234 | } |
4235 | - }elseif($gd_page=='add-listing'){ |
|
4235 | + }elseif ($gd_page == 'add-listing') { |
|
4236 | 4236 | $geodir_post_types = get_option('geodir_post_types'); |
4237 | 4237 | $spt = isset($_REQUEST['listing_type']) ? esc_attr($_REQUEST['listing_type']) : ''; |
4238 | - if(!$spt && isset($_REQUEST['pid'])){ |
|
4239 | - $spt = get_post_type( $_REQUEST['pid'] ); |
|
4238 | + if (!$spt && isset($_REQUEST['pid'])) { |
|
4239 | + $spt = get_post_type($_REQUEST['pid']); |
|
4240 | 4240 | } |
4241 | - if(!$spt){$spt='gd_place';} |
|
4242 | - if(isset($geodir_post_types[$spt]['labels']['singular_name'])){ |
|
4243 | - $single_name = __($geodir_post_types[$spt]['labels']['singular_name'],'geodirectory'); |
|
4241 | + if (!$spt) {$spt = 'gd_place'; } |
|
4242 | + if (isset($geodir_post_types[$spt]['labels']['singular_name'])) { |
|
4243 | + $single_name = __($geodir_post_types[$spt]['labels']['singular_name'], 'geodirectory'); |
|
4244 | 4244 | } |
4245 | 4245 | } |
4246 | - elseif($post->post_type){ |
|
4246 | + elseif ($post->post_type) { |
|
4247 | 4247 | $geodir_post_types = get_option('geodir_post_types'); |
4248 | - if(isset($geodir_post_types[$post->post_type]['labels']['singular_name'])){ |
|
4249 | - $single_name = __($geodir_post_types[$post->post_type]['labels']['singular_name'],'geodirectory'); |
|
4248 | + if (isset($geodir_post_types[$post->post_type]['labels']['singular_name'])) { |
|
4249 | + $single_name = __($geodir_post_types[$post->post_type]['labels']['singular_name'], 'geodirectory'); |
|
4250 | 4250 | } |
4251 | 4251 | |
4252 | 4252 | |
4253 | 4253 | } |
4254 | - $title = str_replace("%%pt_single%%",$single_name,$title); |
|
4254 | + $title = str_replace("%%pt_single%%", $single_name, $title); |
|
4255 | 4255 | } |
4256 | 4256 | |
4257 | - if(strpos($title,'%%pt_plural%%') !== false){ |
|
4257 | + if (strpos($title, '%%pt_plural%%') !== false) { |
|
4258 | 4258 | $plural_name = ''; |
4259 | - if($gd_page=='search' || $gd_page=='author'){ |
|
4259 | + if ($gd_page == 'search' || $gd_page == 'author') { |
|
4260 | 4260 | $geodir_post_types = get_option('geodir_post_types'); |
4261 | 4261 | $spt = esc_attr($_REQUEST['stype']); |
4262 | - if(isset($geodir_post_types[$spt]['labels']['name'])){ |
|
4263 | - $plural_name = __($geodir_post_types[$spt]['labels']['name'],'geodirectory'); |
|
4262 | + if (isset($geodir_post_types[$spt]['labels']['name'])) { |
|
4263 | + $plural_name = __($geodir_post_types[$spt]['labels']['name'], 'geodirectory'); |
|
4264 | 4264 | } |
4265 | - }elseif($gd_page=='add-listing'){ |
|
4265 | + }elseif ($gd_page == 'add-listing') { |
|
4266 | 4266 | $geodir_post_types = get_option('geodir_post_types'); |
4267 | 4267 | $spt = sanitize_text_field($_REQUEST['listing_type']); |
4268 | - if(!$spt){$spt='gd_place';} |
|
4269 | - if(isset($geodir_post_types[$spt]['labels']['name'])){ |
|
4270 | - $plural_name = __($geodir_post_types[$spt]['labels']['name'],'geodirectory'); |
|
4268 | + if (!$spt) {$spt = 'gd_place'; } |
|
4269 | + if (isset($geodir_post_types[$spt]['labels']['name'])) { |
|
4270 | + $plural_name = __($geodir_post_types[$spt]['labels']['name'], 'geodirectory'); |
|
4271 | 4271 | } |
4272 | 4272 | } |
4273 | - elseif(isset($post->post_type) && $post->post_type){ |
|
4273 | + elseif (isset($post->post_type) && $post->post_type) { |
|
4274 | 4274 | $geodir_post_types = get_option('geodir_post_types'); |
4275 | - if(isset($geodir_post_types[$post->post_type]['labels']['name'])){ |
|
4276 | - $plural_name = __($geodir_post_types[$post->post_type]['labels']['name'],'geodirectory'); |
|
4275 | + if (isset($geodir_post_types[$post->post_type]['labels']['name'])) { |
|
4276 | + $plural_name = __($geodir_post_types[$post->post_type]['labels']['name'], 'geodirectory'); |
|
4277 | 4277 | } |
4278 | 4278 | |
4279 | 4279 | } |
4280 | - $title = str_replace("%%pt_plural%%",$plural_name,$title); |
|
4280 | + $title = str_replace("%%pt_plural%%", $plural_name, $title); |
|
4281 | 4281 | } |
4282 | 4282 | |
4283 | 4283 | |
4284 | 4284 | |
4285 | - if(strpos($title,'%%category%%') !== false){ |
|
4285 | + if (strpos($title, '%%category%%') !== false) { |
|
4286 | 4286 | $cat_name = ''; |
4287 | 4287 | |
4288 | - if($gd_page=='detail') { |
|
4288 | + if ($gd_page == 'detail') { |
|
4289 | 4289 | if ($post->default_category) { |
4290 | - $cat = get_term($post->default_category, $post->post_type . 'category'); |
|
4290 | + $cat = get_term($post->default_category, $post->post_type.'category'); |
|
4291 | 4291 | $cat_name = (isset($cat->name)) ? $cat->name : ''; |
4292 | 4292 | } |
4293 | - }elseif($gd_page=='listing'){ |
|
4293 | + }elseif ($gd_page == 'listing') { |
|
4294 | 4294 | $queried_object = get_queried_object(); |
4295 | - if(isset($queried_object->name)){ |
|
4295 | + if (isset($queried_object->name)) { |
|
4296 | 4296 | $cat_name = $queried_object->name; |
4297 | 4297 | } |
4298 | 4298 | } |
4299 | - $title = str_replace("%%category%%",$cat_name,$title); |
|
4299 | + $title = str_replace("%%category%%", $cat_name, $title); |
|
4300 | 4300 | } |
4301 | 4301 | |
4302 | - if(strpos($title,'%%tag%%') !== false){ |
|
4302 | + if (strpos($title, '%%tag%%') !== false) { |
|
4303 | 4303 | $cat_name = ''; |
4304 | 4304 | |
4305 | - if($gd_page=='detail') { |
|
4305 | + if ($gd_page == 'detail') { |
|
4306 | 4306 | if ($post->default_category) { |
4307 | - $cat = get_term($post->default_category, $post->post_type . 'category'); |
|
4307 | + $cat = get_term($post->default_category, $post->post_type.'category'); |
|
4308 | 4308 | $cat_name = (isset($cat->name)) ? $cat->name : ''; |
4309 | 4309 | } |
4310 | - }elseif($gd_page=='listing'){ |
|
4310 | + }elseif ($gd_page == 'listing') { |
|
4311 | 4311 | $queried_object = get_queried_object(); |
4312 | - if(isset($queried_object->name)){ |
|
4312 | + if (isset($queried_object->name)) { |
|
4313 | 4313 | $cat_name = $queried_object->name; |
4314 | 4314 | } |
4315 | 4315 | } |
4316 | - $title = str_replace("%%tag%%",$cat_name,$title); |
|
4316 | + $title = str_replace("%%tag%%", $cat_name, $title); |
|
4317 | 4317 | } |
4318 | 4318 | |
4319 | 4319 | |
4320 | 4320 | |
4321 | - if(strpos($title,'%%id%%') !== false){ |
|
4321 | + if (strpos($title, '%%id%%') !== false) { |
|
4322 | 4322 | $ID = (isset($post->ID)) ? $post->ID : ''; |
4323 | - $title = str_replace("%%id%%",$ID,$title); |
|
4323 | + $title = str_replace("%%id%%", $ID, $title); |
|
4324 | 4324 | } |
4325 | 4325 | |
4326 | - if(strpos($title,'%%sep%%') !== false){ |
|
4327 | - $title = str_replace("%%sep%%",$sep,$title); |
|
4326 | + if (strpos($title, '%%sep%%') !== false) { |
|
4327 | + $title = str_replace("%%sep%%", $sep, $title); |
|
4328 | 4328 | } |
4329 | 4329 | |
4330 | 4330 | |
@@ -4342,12 +4342,12 @@ discard block |
||
4342 | 4342 | * @param string $gd_page The page being filtered. |
4343 | 4343 | * @param string $sep The separator, default: `|`. |
4344 | 4344 | */ |
4345 | - $location_array = apply_filters('geodir_filter_title_variables_location_arr',$location_array,$title, $gd_page, $sep); |
|
4345 | + $location_array = apply_filters('geodir_filter_title_variables_location_arr', $location_array, $title, $gd_page, $sep); |
|
4346 | 4346 | $location_titles = array(); |
4347 | - if($gd_page=='location' && get_query_var( 'gd_country_full' )){ |
|
4348 | - if(get_query_var( 'gd_country_full' )){$location_array['gd_country'] = get_query_var( 'gd_country_full' );} |
|
4349 | - if(get_query_var( 'gd_region_full' )){$location_array['gd_region'] = get_query_var( 'gd_region_full' );} |
|
4350 | - if(get_query_var( 'gd_city_full' )){$location_array['gd_city'] = get_query_var( 'gd_city_full' );} |
|
4347 | + if ($gd_page == 'location' && get_query_var('gd_country_full')) { |
|
4348 | + if (get_query_var('gd_country_full')) {$location_array['gd_country'] = get_query_var('gd_country_full'); } |
|
4349 | + if (get_query_var('gd_region_full')) {$location_array['gd_region'] = get_query_var('gd_region_full'); } |
|
4350 | + if (get_query_var('gd_city_full')) {$location_array['gd_city'] = get_query_var('gd_city_full'); } |
|
4351 | 4351 | } |
4352 | 4352 | $location_single = ''; |
4353 | 4353 | $gd_country = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : ''; |
@@ -4419,51 +4419,51 @@ discard block |
||
4419 | 4419 | } |
4420 | 4420 | |
4421 | 4421 | |
4422 | - if(strpos($title,'%%location%%') !== false){ |
|
4422 | + if (strpos($title, '%%location%%') !== false) { |
|
4423 | 4423 | $location = ''; |
4424 | - if($location_titles) { |
|
4424 | + if ($location_titles) { |
|
4425 | 4425 | $location = implode(", ", $location_titles); |
4426 | 4426 | } |
4427 | - $title = str_replace("%%location%%",$location,$title); |
|
4427 | + $title = str_replace("%%location%%", $location, $title); |
|
4428 | 4428 | } |
4429 | 4429 | |
4430 | - if(strpos($title,'%%in_location%%') !== false){ |
|
4430 | + if (strpos($title, '%%in_location%%') !== false) { |
|
4431 | 4431 | $location = ''; |
4432 | - if($location_titles) { |
|
4433 | - $location = __('in ', 'geodirectory') . implode(", ", $location_titles); |
|
4432 | + if ($location_titles) { |
|
4433 | + $location = __('in ', 'geodirectory').implode(", ", $location_titles); |
|
4434 | 4434 | } |
4435 | - $title = str_replace("%%in_location%%",$location,$title); |
|
4435 | + $title = str_replace("%%in_location%%", $location, $title); |
|
4436 | 4436 | } |
4437 | 4437 | |
4438 | - if(strpos($title,'%%in_location_single%%') !== false){ |
|
4439 | - if($location_single) { |
|
4440 | - $location_single = __('in', 'geodirectory') . ' ' .$location_single; |
|
4438 | + if (strpos($title, '%%in_location_single%%') !== false) { |
|
4439 | + if ($location_single) { |
|
4440 | + $location_single = __('in', 'geodirectory').' '.$location_single; |
|
4441 | 4441 | } |
4442 | - $title = str_replace("%%in_location_single%%",$location_single,$title); |
|
4442 | + $title = str_replace("%%in_location_single%%", $location_single, $title); |
|
4443 | 4443 | } |
4444 | 4444 | |
4445 | - if(strpos($title,'%%location_single%%') !== false){ |
|
4446 | - $title = str_replace("%%location_single%%",$location_single,$title); |
|
4445 | + if (strpos($title, '%%location_single%%') !== false) { |
|
4446 | + $title = str_replace("%%location_single%%", $location_single, $title); |
|
4447 | 4447 | } |
4448 | 4448 | |
4449 | 4449 | |
4450 | - if(strpos($title,'%%search_term%%') !== false){ |
|
4450 | + if (strpos($title, '%%search_term%%') !== false) { |
|
4451 | 4451 | $search_term = ''; |
4452 | - if(isset($_REQUEST['s'])){ |
|
4452 | + if (isset($_REQUEST['s'])) { |
|
4453 | 4453 | $search_term = esc_attr($_REQUEST['s']); |
4454 | 4454 | } |
4455 | - $title = str_replace("%%search_term%%",$search_term,$title); |
|
4455 | + $title = str_replace("%%search_term%%", $search_term, $title); |
|
4456 | 4456 | } |
4457 | 4457 | |
4458 | - if(strpos($title,'%%search_near%%') !== false){ |
|
4458 | + if (strpos($title, '%%search_near%%') !== false) { |
|
4459 | 4459 | $search_term = ''; |
4460 | - if(isset($_REQUEST['snear'])){ |
|
4460 | + if (isset($_REQUEST['snear'])) { |
|
4461 | 4461 | $search_term = esc_attr($_REQUEST['snear']); |
4462 | 4462 | } |
4463 | - $title = str_replace("%%search_near%%",$search_term,$title); |
|
4463 | + $title = str_replace("%%search_near%%", $search_term, $title); |
|
4464 | 4464 | } |
4465 | 4465 | |
4466 | - if(strpos($title,'%%name%%') !== false){ |
|
4466 | + if (strpos($title, '%%name%%') !== false) { |
|
4467 | 4467 | $author_name = get_the_author(); |
4468 | 4468 | if (!$author_name || $author_name === '') { |
4469 | 4469 | $queried_object = get_queried_object(); |
@@ -4488,9 +4488,9 @@ discard block |
||
4488 | 4488 | $title = str_replace("%%pagetotal%%", $pagetotal, $title); |
4489 | 4489 | } |
4490 | 4490 | |
4491 | - $title = wptexturize( $title ); |
|
4492 | - $title = convert_chars( $title ); |
|
4493 | - $title = esc_html( $title ); |
|
4491 | + $title = wptexturize($title); |
|
4492 | + $title = convert_chars($title); |
|
4493 | + $title = esc_html($title); |
|
4494 | 4494 | |
4495 | 4495 | /** |
4496 | 4496 | * Filter the title variables after standard ones have been filtered. |
@@ -4503,7 +4503,7 @@ discard block |
||
4503 | 4503 | * @param string $sep The separator, default: `|`. |
4504 | 4504 | */ |
4505 | 4505 | |
4506 | - return apply_filters('geodir_filter_title_variables_vars',$title,$location_array, $gd_page, $sep); |
|
4506 | + return apply_filters('geodir_filter_title_variables_vars', $title, $location_array, $gd_page, $sep); |
|
4507 | 4507 | } |
4508 | 4508 | |
4509 | 4509 | /** |
@@ -4626,7 +4626,7 @@ discard block |
||
4626 | 4626 | } |
4627 | 4627 | |
4628 | 4628 | $action = isset($_REQUEST['action']) ? sanitize_text_field($_REQUEST['action']) : ''; |
4629 | - $is_admin = is_admin() && ( !defined('DOING_AJAX' ) || ( defined('DOING_AJAX') && !DOING_AJAX ) ) ? true : false; |
|
4629 | + $is_admin = is_admin() && (!defined('DOING_AJAX') || (defined('DOING_AJAX') && !DOING_AJAX)) ? true : false; |
|
4630 | 4630 | $inline_save = $action == 'inline-save' ? true : false; |
4631 | 4631 | |
4632 | 4632 | if (empty($post->post_type) || $is_admin || $inline_save || (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)) { |
@@ -4637,7 +4637,7 @@ discard block |
||
4637 | 4637 | return; |
4638 | 4638 | } |
4639 | 4639 | |
4640 | - $user_id = (int)get_current_user_id(); |
|
4640 | + $user_id = (int) get_current_user_id(); |
|
4641 | 4641 | |
4642 | 4642 | if ($user_id > 0 && get_option('geodir_notify_post_edited') && !wp_is_post_revision($post_ID) && in_array($post->post_type, geodir_get_posttypes())) { |
4643 | 4643 | $author_id = !empty($post->post_author) ? $post->post_author : 0; |
@@ -4681,7 +4681,7 @@ discard block |
||
4681 | 4681 | $nr = geodir_title_meta_pagenumbering('nr'); |
4682 | 4682 | |
4683 | 4683 | if ($max > 1 && $nr > 1) { |
4684 | - $replacement = sprintf($sep . ' ' . __('Page %1$d of %2$d', 'geodirectory'), $nr, $max); |
|
4684 | + $replacement = sprintf($sep.' '.__('Page %1$d of %2$d', 'geodirectory'), $nr, $max); |
|
4685 | 4685 | } |
4686 | 4686 | |
4687 | 4687 | return $replacement; |
@@ -4700,7 +4700,7 @@ discard block |
||
4700 | 4700 | |
4701 | 4701 | $nr = geodir_title_meta_pagenumbering('nr'); |
4702 | 4702 | if (isset($nr) && $nr > 0) { |
4703 | - $replacement = (string)$nr; |
|
4703 | + $replacement = (string) $nr; |
|
4704 | 4704 | } |
4705 | 4705 | |
4706 | 4706 | return $replacement; |
@@ -4719,7 +4719,7 @@ discard block |
||
4719 | 4719 | |
4720 | 4720 | $max = geodir_title_meta_pagenumbering('max'); |
4721 | 4721 | if (isset($max) && $max > 0) { |
4722 | - $replacement = (string)$max; |
|
4722 | + $replacement = (string) $max; |
|
4723 | 4723 | } |
4724 | 4724 | |
4725 | 4725 | return $replacement; |
@@ -4761,7 +4761,7 @@ discard block |
||
4761 | 4761 | } |
4762 | 4762 | |
4763 | 4763 | if (isset($post->post_content)) { |
4764 | - $max_num_pages = (substr_count($post->post_content, '<!--nextpage-->' ) + 1); |
|
4764 | + $max_num_pages = (substr_count($post->post_content, '<!--nextpage-->') + 1); |
|
4765 | 4765 | } |
4766 | 4766 | } |
4767 | 4767 |