@@ -26,11 +26,11 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | if (!isset($default_cat) || empty($default_cat)) {
|
| 28 | 28 | $default_cat = isset($post_cat_array[0]) ? $post_cat_array[0] : ''; |
| 29 | - }else{
|
|
| 30 | - if(!is_int($default_cat)){
|
|
| 29 | + } else {
|
|
| 30 | + if (!is_int($default_cat)) {
|
|
| 31 | 31 | $category = get_term_by('name', $default_cat, $taxonomy);
|
| 32 | - if(isset($category->term_id)){
|
|
| 33 | - $default_cat = $category->term_id; |
|
| 32 | + if (isset($category->term_id)) {
|
|
| 33 | + $default_cat = $category->term_id; |
|
| 34 | 34 | } |
| 35 | 35 | } |
| 36 | 36 | |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | |
| 59 | 59 | if ($default_pos === false) {
|
| 60 | 60 | |
| 61 | - $change_cat_str = str_replace($default_cat . ',y:', $default_cat . ',y,d:', $change_cat_str); |
|
| 61 | + $change_cat_str = str_replace($default_cat.',y:', $default_cat.',y,d:', $change_cat_str); |
|
| 62 | 62 | |
| 63 | 63 | } |
| 64 | 64 | |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | |
| 146 | 146 | $gd_post = $post; |
| 147 | 147 | if (!empty($gd_post) && is_array($gd_post)) {
|
| 148 | - $gd_post = (object)$post; |
|
| 148 | + $gd_post = (object) $post; |
|
| 149 | 149 | |
| 150 | 150 | // Fix WPML duplicate. |
| 151 | 151 | if (geodir_is_wpml() && !empty($request_info['action']) && $request_info['action'] == 'editpost' && !empty($request_info['icl_trid']) && !isset($post['post_date'])) {
|
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | $send_post_submit_mail = false; |
| 240 | 240 | |
| 241 | 241 | // unhook this function so it doesn't loop infinitely |
| 242 | - remove_action('save_post', 'geodir_post_information_save',10,2);
|
|
| 242 | + remove_action('save_post', 'geodir_post_information_save', 10, 2);
|
|
| 243 | 243 | |
| 244 | 244 | if (isset($request_info['pid']) && $request_info['pid'] != '') {
|
| 245 | 245 | $post['ID'] = $request_info['pid']; |
@@ -263,13 +263,13 @@ discard block |
||
| 263 | 263 | } |
| 264 | 264 | |
| 265 | 265 | // re-hook this function |
| 266 | - add_action('save_post', 'geodir_post_information_save',10,2);
|
|
| 266 | + add_action('save_post', 'geodir_post_information_save', 10, 2);
|
|
| 267 | 267 | |
| 268 | 268 | $post_tags = ''; |
| 269 | 269 | if (!isset($request_info['post_tags'])) {
|
| 270 | 270 | |
| 271 | 271 | $post_type = $request_info['listing_type']; |
| 272 | - $post_tags = implode(",", wp_get_object_terms($last_post_id, $post_type . '_tags', array('fields' => 'names')));
|
|
| 272 | + $post_tags = implode(",", wp_get_object_terms($last_post_id, $post_type.'_tags', array('fields' => 'names')));
|
|
| 273 | 273 | |
| 274 | 274 | } |
| 275 | 275 | |
@@ -287,13 +287,13 @@ discard block |
||
| 287 | 287 | $payment_info = array(); |
| 288 | 288 | $package_info = array(); |
| 289 | 289 | |
| 290 | - $package_info = (array)geodir_post_package_info($package_info, $post); |
|
| 290 | + $package_info = (array) geodir_post_package_info($package_info, $post); |
|
| 291 | 291 | |
| 292 | 292 | $post_package_id = geodir_get_post_meta($last_post_id, 'package_id'); |
| 293 | 293 | |
| 294 | 294 | if (!empty($package_info) && !$post_package_id) {
|
| 295 | 295 | if (isset($package_info['days']) && $package_info['days'] != 0) {
|
| 296 | - $payment_info['expire_date'] = date('Y-m-d', strtotime("+" . $package_info['days'] . " days"));
|
|
| 296 | + $payment_info['expire_date'] = date('Y-m-d', strtotime("+".$package_info['days']." days"));
|
|
| 297 | 297 | } else {
|
| 298 | 298 | $payment_info['expire_date'] = 'Never'; |
| 299 | 299 | } |
@@ -314,8 +314,8 @@ discard block |
||
| 314 | 314 | $extrafields = $val['extra_fields']; |
| 315 | 315 | |
| 316 | 316 | if (trim($type) == 'address') {
|
| 317 | - $prefix = $name . '_'; |
|
| 318 | - $address = $prefix . 'address'; |
|
| 317 | + $prefix = $name.'_'; |
|
| 318 | + $address = $prefix.'address'; |
|
| 319 | 319 | |
| 320 | 320 | if (isset($request_info[$address]) && $request_info[$address] != '') {
|
| 321 | 321 | $gd_post_info[$address] = wp_slash($request_info[$address]); |
@@ -325,59 +325,59 @@ discard block |
||
| 325 | 325 | $extrafields = unserialize($extrafields); |
| 326 | 326 | |
| 327 | 327 | |
| 328 | - if (!isset($request_info[$prefix . 'city']) || $request_info[$prefix . 'city'] == '') {
|
|
| 328 | + if (!isset($request_info[$prefix.'city']) || $request_info[$prefix.'city'] == '') {
|
|
| 329 | 329 | |
| 330 | 330 | $location_result = geodir_get_default_location(); |
| 331 | 331 | |
| 332 | - $gd_post_info[$prefix . 'city'] = $location_result->city; |
|
| 333 | - $gd_post_info[$prefix . 'region'] = $location_result->region; |
|
| 334 | - $gd_post_info[$prefix . 'country'] = $location_result->country; |
|
| 332 | + $gd_post_info[$prefix.'city'] = $location_result->city; |
|
| 333 | + $gd_post_info[$prefix.'region'] = $location_result->region; |
|
| 334 | + $gd_post_info[$prefix.'country'] = $location_result->country; |
|
| 335 | 335 | |
| 336 | - $gd_post_info['post_locations'] = '[' . $location_result->city_slug . '],[' . $location_result->region_slug . '],[' . $location_result->country_slug . ']'; // set all overall post location |
|
| 336 | + $gd_post_info['post_locations'] = '['.$location_result->city_slug.'],['.$location_result->region_slug.'],['.$location_result->country_slug.']'; // set all overall post location |
|
| 337 | 337 | |
| 338 | 338 | } else {
|
| 339 | 339 | |
| 340 | - $gd_post_info[$prefix . 'city'] = $request_info[$prefix . 'city']; |
|
| 341 | - $gd_post_info[$prefix . 'region'] = $request_info[$prefix . 'region']; |
|
| 342 | - $gd_post_info[$prefix . 'country'] = $request_info[$prefix . 'country']; |
|
| 340 | + $gd_post_info[$prefix.'city'] = $request_info[$prefix.'city']; |
|
| 341 | + $gd_post_info[$prefix.'region'] = $request_info[$prefix.'region']; |
|
| 342 | + $gd_post_info[$prefix.'country'] = $request_info[$prefix.'country']; |
|
| 343 | 343 | |
| 344 | 344 | //----------set post locations when import dummy data------- |
| 345 | 345 | $location_result = geodir_get_default_location(); |
| 346 | 346 | |
| 347 | - $gd_post_info['post_locations'] = '[' . $location_result->city_slug . '],[' . $location_result->region_slug . '],[' . $location_result->country_slug . ']'; // set all overall post location |
|
| 347 | + $gd_post_info['post_locations'] = '['.$location_result->city_slug.'],['.$location_result->region_slug.'],['.$location_result->country_slug.']'; // set all overall post location |
|
| 348 | 348 | //----------------------------------------------------------------- |
| 349 | 349 | |
| 350 | 350 | } |
| 351 | 351 | |
| 352 | 352 | |
| 353 | - if (isset($extrafields['show_zip']) && $extrafields['show_zip'] && isset($request_info[$prefix . 'zip'])) {
|
|
| 354 | - $gd_post_info[$prefix . 'zip'] = $request_info[$prefix . 'zip']; |
|
| 353 | + if (isset($extrafields['show_zip']) && $extrafields['show_zip'] && isset($request_info[$prefix.'zip'])) {
|
|
| 354 | + $gd_post_info[$prefix.'zip'] = $request_info[$prefix.'zip']; |
|
| 355 | 355 | } |
| 356 | 356 | |
| 357 | 357 | |
| 358 | 358 | if (isset($extrafields['show_map']) && $extrafields['show_map']) {
|
| 359 | 359 | |
| 360 | - if (isset($request_info[$prefix . 'latitude']) && $request_info[$prefix . 'latitude'] != '') {
|
|
| 361 | - $gd_post_info[$prefix . 'latitude'] = $request_info[$prefix . 'latitude']; |
|
| 360 | + if (isset($request_info[$prefix.'latitude']) && $request_info[$prefix.'latitude'] != '') {
|
|
| 361 | + $gd_post_info[$prefix.'latitude'] = $request_info[$prefix.'latitude']; |
|
| 362 | 362 | } |
| 363 | 363 | |
| 364 | - if (isset($request_info[$prefix . 'longitude']) && $request_info[$prefix . 'longitude'] != '') {
|
|
| 365 | - $gd_post_info[$prefix . 'longitude'] = $request_info[$prefix . 'longitude']; |
|
| 364 | + if (isset($request_info[$prefix.'longitude']) && $request_info[$prefix.'longitude'] != '') {
|
|
| 365 | + $gd_post_info[$prefix.'longitude'] = $request_info[$prefix.'longitude']; |
|
| 366 | 366 | } |
| 367 | 367 | |
| 368 | - if (isset($request_info[$prefix . 'mapview']) && $request_info[$prefix . 'mapview'] != '') {
|
|
| 369 | - $gd_post_info[$prefix . 'mapview'] = $request_info[$prefix . 'mapview']; |
|
| 368 | + if (isset($request_info[$prefix.'mapview']) && $request_info[$prefix.'mapview'] != '') {
|
|
| 369 | + $gd_post_info[$prefix.'mapview'] = $request_info[$prefix.'mapview']; |
|
| 370 | 370 | } |
| 371 | 371 | |
| 372 | - if (isset($request_info[$prefix . 'mapzoom']) && $request_info[$prefix . 'mapzoom'] != '') {
|
|
| 373 | - $gd_post_info[$prefix . 'mapzoom'] = $request_info[$prefix . 'mapzoom']; |
|
| 372 | + if (isset($request_info[$prefix.'mapzoom']) && $request_info[$prefix.'mapzoom'] != '') {
|
|
| 373 | + $gd_post_info[$prefix.'mapzoom'] = $request_info[$prefix.'mapzoom']; |
|
| 374 | 374 | } |
| 375 | 375 | |
| 376 | 376 | } |
| 377 | 377 | |
| 378 | 378 | // show lat lng |
| 379 | - if (isset($extrafields['show_latlng']) && $extrafields['show_latlng'] && isset($request_info[$prefix . 'latlng'])) {
|
|
| 380 | - $gd_post_info[$prefix . 'latlng'] = $request_info[$prefix . 'latlng']; |
|
| 379 | + if (isset($extrafields['show_latlng']) && $extrafields['show_latlng'] && isset($request_info[$prefix.'latlng'])) {
|
|
| 380 | + $gd_post_info[$prefix.'latlng'] = $request_info[$prefix.'latlng']; |
|
| 381 | 381 | } |
| 382 | 382 | } |
| 383 | 383 | |
@@ -403,16 +403,16 @@ discard block |
||
| 403 | 403 | |
| 404 | 404 | // check if we need to change the format or not |
| 405 | 405 | $date_format_len = strlen(str_replace(' ', '', $date_format));
|
| 406 | - if($date_format_len>5){// if greater then 5 then it's the old style format.
|
|
| 406 | + if ($date_format_len > 5) {// if greater then 5 then it's the old style format.
|
|
| 407 | 407 | |
| 408 | - $search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format
|
|
| 409 | - $replace = array('d','j','l','m','n','F','Y');//PHP date format
|
|
| 408 | + $search = array('dd', 'd', 'DD', 'mm', 'm', 'MM', 'yy'); //jQuery UI datepicker format
|
|
| 409 | + $replace = array('d', 'j', 'l', 'm', 'n', 'F', 'Y'); //PHP date format
|
|
| 410 | 410 | |
| 411 | 411 | $date_format = str_replace($search, $replace, $date_format); |
| 412 | 412 | |
| 413 | 413 | $post_htmlvar_value = $date_format == 'd/m/Y' ? str_replace('/', '-', $request_info[$name]) : $request_info[$name];
|
| 414 | 414 | |
| 415 | - }else{
|
|
| 415 | + } else {
|
|
| 416 | 416 | $post_htmlvar_value = $request_info[$name]; |
| 417 | 417 | } |
| 418 | 418 | |
@@ -426,7 +426,7 @@ discard block |
||
| 426 | 426 | if (isset($request_info[$name])) {
|
| 427 | 427 | $gd_post_info[$name] = $request_info[$name]; |
| 428 | 428 | } else {
|
| 429 | - if (isset($request_info['gd_field_' . $name])) {
|
|
| 429 | + if (isset($request_info['gd_field_'.$name])) {
|
|
| 430 | 430 | $gd_post_info[$name] = ''; /* fix de-select for multiselect */ |
| 431 | 431 | } |
| 432 | 432 | } |
@@ -486,7 +486,7 @@ discard block |
||
| 486 | 486 | } |
| 487 | 487 | |
| 488 | 488 | if (is_array($post_tags)) {
|
| 489 | - $taxonomy = $request_info['listing_type'] . '_tags'; |
|
| 489 | + $taxonomy = $request_info['listing_type'].'_tags'; |
|
| 490 | 490 | wp_set_object_terms($last_post_id, $post_tags, $taxonomy); |
| 491 | 491 | } |
| 492 | 492 | |
@@ -498,7 +498,7 @@ discard block |
||
| 498 | 498 | $tmpimgArr = trim($request_info['post_images'], ","); |
| 499 | 499 | $tmpimgArr = explode(",", $tmpimgArr);
|
| 500 | 500 | geodir_save_post_images($last_post_id, $tmpimgArr, $dummy); |
| 501 | - } else{
|
|
| 501 | + } else {
|
|
| 502 | 502 | geodir_save_post_images($last_post_id, $request_info['post_images'], $dummy); |
| 503 | 503 | } |
| 504 | 504 | |
@@ -579,7 +579,7 @@ discard block |
||
| 579 | 579 | if (!in_array($post_type, $all_postypes)) |
| 580 | 580 | return false; |
| 581 | 581 | |
| 582 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
| 582 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
| 583 | 583 | |
| 584 | 584 | /** |
| 585 | 585 | * Apply Filter to change Post info |
@@ -589,7 +589,7 @@ discard block |
||
| 589 | 589 | * @since 1.0.0 |
| 590 | 590 | * @package GeoDirectory |
| 591 | 591 | */ |
| 592 | - $query = apply_filters('geodir_post_info_query', $wpdb->prepare("SELECT p.*,pd.* FROM " . $wpdb->posts . " p," . $table . " pd
|
|
| 592 | + $query = apply_filters('geodir_post_info_query', $wpdb->prepare("SELECT p.*,pd.* FROM ".$wpdb->posts." p,".$table." pd
|
|
| 593 | 593 | WHERE p.ID = pd.post_id |
| 594 | 594 | AND pd.post_id = %d", $post_id)); |
| 595 | 595 | |
@@ -652,7 +652,7 @@ discard block |
||
| 652 | 652 | |
| 653 | 653 | $post_type = get_post_type($post_id); |
| 654 | 654 | |
| 655 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
| 655 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
| 656 | 656 | |
| 657 | 657 | /** |
| 658 | 658 | * Filter to change Post info |
@@ -673,7 +673,7 @@ discard block |
||
| 673 | 673 | |
| 674 | 674 | $columns = $wpdb->get_col("show columns from $table");
|
| 675 | 675 | foreach ($postmeta as $mkey => $mval) {
|
| 676 | - if(in_array($mkey,$columns)) {
|
|
| 676 | + if (in_array($mkey, $columns)) {
|
|
| 677 | 677 | if (is_array($mval)) {
|
| 678 | 678 | $mval = implode(",", $mval);
|
| 679 | 679 | } |
@@ -702,12 +702,12 @@ discard block |
||
| 702 | 702 | */ |
| 703 | 703 | do_action('geodir_before_save_listinginfo', $postinfo_array, $post_id);
|
| 704 | 704 | |
| 705 | - if ($wpdb->get_var($wpdb->prepare("SELECT post_id from " . $table . " where post_id = %d", array($post_id)))) {
|
|
| 705 | + if ($wpdb->get_var($wpdb->prepare("SELECT post_id from ".$table." where post_id = %d", array($post_id)))) {
|
|
| 706 | 706 | |
| 707 | 707 | $query_string_array[] = $post_id; |
| 708 | 708 | $wpdb->query( |
| 709 | 709 | $wpdb->prepare( |
| 710 | - "UPDATE " . $table . " SET " . $query_string_escaped . " where post_id =%d", |
|
| 710 | + "UPDATE ".$table." SET ".$query_string_escaped." where post_id =%d", |
|
| 711 | 711 | $query_string_array |
| 712 | 712 | ) |
| 713 | 713 | ); |
@@ -718,7 +718,7 @@ discard block |
||
| 718 | 718 | array_unshift($query_string_array, $post_id); |
| 719 | 719 | $wpdb->query( |
| 720 | 720 | $wpdb->prepare( |
| 721 | - "INSERT INTO " . $table . " SET post_id = %d," . $query_string_escaped, |
|
| 721 | + "INSERT INTO ".$table." SET post_id = %d,".$query_string_escaped, |
|
| 722 | 722 | $query_string_array |
| 723 | 723 | ) |
| 724 | 724 | ); |
@@ -764,7 +764,7 @@ discard block |
||
| 764 | 764 | |
| 765 | 765 | $post_type = get_post_type($post_id); |
| 766 | 766 | |
| 767 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
| 767 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
| 768 | 768 | |
| 769 | 769 | if ($postmeta != '' && geodir_column_exist($table, $postmeta) && $post_id) {
|
| 770 | 770 | |
@@ -772,11 +772,11 @@ discard block |
||
| 772 | 772 | $meta_value = implode(",", $meta_value);
|
| 773 | 773 | } |
| 774 | 774 | |
| 775 | - if ($wpdb->get_var($wpdb->prepare("SELECT post_id from " . $table . " where post_id = %d", array($post_id)))) {
|
|
| 775 | + if ($wpdb->get_var($wpdb->prepare("SELECT post_id from ".$table." where post_id = %d", array($post_id)))) {
|
|
| 776 | 776 | |
| 777 | 777 | $wpdb->query( |
| 778 | 778 | $wpdb->prepare( |
| 779 | - "UPDATE " . $table . " SET " . $postmeta . " = '" . $meta_value . "' where post_id =%d", |
|
| 779 | + "UPDATE ".$table." SET ".$postmeta." = '".$meta_value."' where post_id =%d", |
|
| 780 | 780 | array($post_id) |
| 781 | 781 | ) |
| 782 | 782 | ); |
@@ -785,7 +785,7 @@ discard block |
||
| 785 | 785 | |
| 786 | 786 | $wpdb->query( |
| 787 | 787 | $wpdb->prepare( |
| 788 | - "INSERT INTO " . $table . " SET post_id = %d, " . $postmeta . " = '" . $meta_value . "'", |
|
| 788 | + "INSERT INTO ".$table." SET post_id = %d, ".$postmeta." = '".$meta_value."'", |
|
| 789 | 789 | array($post_id) |
| 790 | 790 | ) |
| 791 | 791 | ); |
@@ -818,14 +818,14 @@ discard block |
||
| 818 | 818 | |
| 819 | 819 | $post_type = get_post_type($post_id); |
| 820 | 820 | |
| 821 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
| 821 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
| 822 | 822 | |
| 823 | 823 | if (is_array($postmeta) && !empty($postmeta) && $post_id) {
|
| 824 | 824 | $post_meta_set_query = ''; |
| 825 | 825 | |
| 826 | 826 | foreach ($postmeta as $mkey) {
|
| 827 | 827 | if ($mval != '') |
| 828 | - $post_meta_set_query .= $mkey . " = '', "; |
|
| 828 | + $post_meta_set_query .= $mkey." = '', "; |
|
| 829 | 829 | } |
| 830 | 830 | |
| 831 | 831 | $post_meta_set_query = trim($post_meta_set_query, ", "); |
@@ -834,11 +834,11 @@ discard block |
||
| 834 | 834 | return false; |
| 835 | 835 | } |
| 836 | 836 | |
| 837 | - if ($wpdb->get_var("SHOW COLUMNS FROM " . $table . " WHERE field = '" . $postmeta . "'") != '') {
|
|
| 837 | + if ($wpdb->get_var("SHOW COLUMNS FROM ".$table." WHERE field = '".$postmeta."'") != '') {
|
|
| 838 | 838 | |
| 839 | 839 | $wpdb->query( |
| 840 | 840 | $wpdb->prepare( |
| 841 | - "UPDATE " . $table . " SET " . $post_meta_set_query . " where post_id = %d", |
|
| 841 | + "UPDATE ".$table." SET ".$post_meta_set_query." where post_id = %d", |
|
| 842 | 842 | array($post_id) |
| 843 | 843 | ) |
| 844 | 844 | ); |
@@ -847,11 +847,11 @@ discard block |
||
| 847 | 847 | } |
| 848 | 848 | |
| 849 | 849 | } elseif ($postmeta != '' && $post_id) {
|
| 850 | - if ($wpdb->get_var("SHOW COLUMNS FROM " . $table . " WHERE field = '" . $postmeta . "'") != '') {
|
|
| 850 | + if ($wpdb->get_var("SHOW COLUMNS FROM ".$table." WHERE field = '".$postmeta."'") != '') {
|
|
| 851 | 851 | |
| 852 | 852 | $wpdb->query( |
| 853 | 853 | $wpdb->prepare( |
| 854 | - "UPDATE " . $table . " SET " . $postmeta . "= '' where post_id = %d", |
|
| 854 | + "UPDATE ".$table." SET ".$postmeta."= '' where post_id = %d", |
|
| 855 | 855 | array($post_id) |
| 856 | 856 | ) |
| 857 | 857 | ); |
@@ -893,10 +893,10 @@ discard block |
||
| 893 | 893 | if (!in_array($post_type, $all_postypes)) |
| 894 | 894 | return false; |
| 895 | 895 | |
| 896 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
| 896 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
| 897 | 897 | |
| 898 | - if ($wpdb->get_var("SHOW COLUMNS FROM " . $table . " WHERE field = '" . $meta_key . "'") != '') {
|
|
| 899 | - $meta_value = $wpdb->get_var($wpdb->prepare("SELECT " . $meta_key . " from " . $table . " where post_id = %d", array($post_id)));
|
|
| 898 | + if ($wpdb->get_var("SHOW COLUMNS FROM ".$table." WHERE field = '".$meta_key."'") != '') {
|
|
| 899 | + $meta_value = $wpdb->get_var($wpdb->prepare("SELECT ".$meta_key." from ".$table." where post_id = %d", array($post_id)));
|
|
| 900 | 900 | |
| 901 | 901 | if ($meta_value && $meta_value !== '') {
|
| 902 | 902 | $meta_value = maybe_serialize($meta_value); |
@@ -915,7 +915,7 @@ discard block |
||
| 915 | 915 | * @param string $meta_key The meta key to retrieve. |
| 916 | 916 | * @param bool $single Optional. Whether to return a single value. Default false. |
| 917 | 917 | */ |
| 918 | - return apply_filters( 'geodir_get_post_meta', $meta_value, $post_id, $meta_key, $single ); |
|
| 918 | + return apply_filters('geodir_get_post_meta', $meta_value, $post_id, $meta_key, $single);
|
|
| 919 | 919 | } |
| 920 | 920 | } |
| 921 | 921 | |
@@ -941,13 +941,13 @@ discard block |
||
| 941 | 941 | |
| 942 | 942 | $post_type = get_post_type($post_id); |
| 943 | 943 | |
| 944 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
| 944 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
| 945 | 945 | |
| 946 | 946 | $post_images = geodir_get_images($post_id); |
| 947 | 947 | |
| 948 | 948 | $wpdb->query( |
| 949 | 949 | $wpdb->prepare( |
| 950 | - "UPDATE " . $table . " SET featured_image = '' where post_id =%d", |
|
| 950 | + "UPDATE ".$table." SET featured_image = '' where post_id =%d", |
|
| 951 | 951 | array($post_id) |
| 952 | 952 | ) |
| 953 | 953 | ); |
@@ -977,12 +977,12 @@ discard block |
||
| 977 | 977 | $file_path = ''; |
| 978 | 978 | /* --------- start ------- */ |
| 979 | 979 | |
| 980 | - $split_img_path = explode(str_replace(array('http://','https://'),'',$uploads['baseurl']), str_replace(array('http://','https://'),'',$post_image[$m]));
|
|
| 980 | + $split_img_path = explode(str_replace(array('http://', 'https://'), '', $uploads['baseurl']), str_replace(array('http://', 'https://'), '', $post_image[$m]));
|
|
| 981 | 981 | |
| 982 | 982 | $split_img_file_path = isset($split_img_path[1]) ? $split_img_path[1] : ''; |
| 983 | 983 | |
| 984 | 984 | |
| 985 | - if (!$find_image = $wpdb->get_var($wpdb->prepare("SELECT ID FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE file=%s AND post_id = %d", array($split_img_file_path, $post_id)))) {
|
|
| 985 | + if (!$find_image = $wpdb->get_var($wpdb->prepare("SELECT ID FROM ".GEODIR_ATTACHMENT_TABLE." WHERE file=%s AND post_id = %d", array($split_img_file_path, $post_id)))) {
|
|
| 986 | 986 | |
| 987 | 987 | /* --------- end ------- */ |
| 988 | 988 | $curr_img_url = $post_image[$m]; |
@@ -1026,7 +1026,7 @@ discard block |
||
| 1026 | 1026 | // If the uploaded file is the right format |
| 1027 | 1027 | if (in_array($uploaded_file_type, $allowed_file_types)) {
|
| 1028 | 1028 | if (!function_exists('wp_handle_upload')) {
|
| 1029 | - require_once(ABSPATH . 'wp-admin/includes/file.php'); |
|
| 1029 | + require_once(ABSPATH.'wp-admin/includes/file.php'); |
|
| 1030 | 1030 | } |
| 1031 | 1031 | |
| 1032 | 1032 | if (!is_dir($geodir_uploadpath)) {
|
@@ -1034,41 +1034,41 @@ discard block |
||
| 1034 | 1034 | } |
| 1035 | 1035 | |
| 1036 | 1036 | $external_img = false; |
| 1037 | - if (strpos( str_replace( array('http://','https://'),'',$curr_img_url ), str_replace(array('http://','https://'),'',$uploads['baseurl'] ) ) !== false) {
|
|
| 1037 | + if (strpos(str_replace(array('http://', 'https://'), '', $curr_img_url), str_replace(array('http://', 'https://'), '', $uploads['baseurl'])) !== false) {
|
|
| 1038 | 1038 | } else {
|
| 1039 | 1039 | $external_img = true; |
| 1040 | 1040 | } |
| 1041 | 1041 | |
| 1042 | 1042 | if ($dummy || $external_img) {
|
| 1043 | 1043 | $uploaded_file = array(); |
| 1044 | - $uploaded = (array)fetch_remote_file($curr_img_url); |
|
| 1044 | + $uploaded = (array) fetch_remote_file($curr_img_url); |
|
| 1045 | 1045 | |
| 1046 | 1046 | if (isset($uploaded['error']) && empty($uploaded['error'])) {
|
| 1047 | 1047 | $new_name = basename($uploaded['file']); |
| 1048 | 1048 | $uploaded_file = $uploaded; |
| 1049 | - }else{
|
|
| 1050 | - print_r($uploaded);exit; |
|
| 1049 | + } else {
|
|
| 1050 | + print_r($uploaded); exit; |
|
| 1051 | 1051 | } |
| 1052 | 1052 | $external_img = false; |
| 1053 | 1053 | } else {
|
| 1054 | - $new_name = $post_id . '_' . $file_name; |
|
| 1054 | + $new_name = $post_id.'_'.$file_name; |
|
| 1055 | 1055 | |
| 1056 | 1056 | if ($curr_img_dir == $sub_dir) {
|
| 1057 | - $img_path = $geodir_uploadpath . '/' . $filename; |
|
| 1058 | - $img_url = $geodir_uploadurl . '/' . $filename; |
|
| 1057 | + $img_path = $geodir_uploadpath.'/'.$filename; |
|
| 1058 | + $img_url = $geodir_uploadurl.'/'.$filename; |
|
| 1059 | 1059 | } else {
|
| 1060 | - $img_path = $uploads_dir . '/temp_' . $current_user->data->ID . '/' . $filename; |
|
| 1061 | - $img_url = $uploads['url'] . '/temp_' . $current_user->data->ID . '/' . $filename; |
|
| 1060 | + $img_path = $uploads_dir.'/temp_'.$current_user->data->ID.'/'.$filename; |
|
| 1061 | + $img_url = $uploads['url'].'/temp_'.$current_user->data->ID.'/'.$filename; |
|
| 1062 | 1062 | } |
| 1063 | 1063 | |
| 1064 | 1064 | $uploaded_file = ''; |
| 1065 | 1065 | |
| 1066 | 1066 | if (file_exists($img_path)) {
|
| 1067 | - $uploaded_file = copy($img_path, $geodir_uploadpath . '/' . $new_name); |
|
| 1067 | + $uploaded_file = copy($img_path, $geodir_uploadpath.'/'.$new_name); |
|
| 1068 | 1068 | $file_path = ''; |
| 1069 | - } else if (file_exists($uploads['basedir'] . $curr_img_dir . $filename)) {
|
|
| 1069 | + } else if (file_exists($uploads['basedir'].$curr_img_dir.$filename)) {
|
|
| 1070 | 1070 | $uploaded_file = true; |
| 1071 | - $file_path = $curr_img_dir . '/' . $filename; |
|
| 1071 | + $file_path = $curr_img_dir.'/'.$filename; |
|
| 1072 | 1072 | } |
| 1073 | 1073 | |
| 1074 | 1074 | if ($curr_img_dir != $geodir_uploaddir && file_exists($img_path)) |
@@ -1077,14 +1077,14 @@ discard block |
||
| 1077 | 1077 | |
| 1078 | 1078 | if (!empty($uploaded_file)) {
|
| 1079 | 1079 | if (!isset($file_path) || !$file_path) {
|
| 1080 | - $file_path = $sub_dir . '/' . $new_name; |
|
| 1080 | + $file_path = $sub_dir.'/'.$new_name; |
|
| 1081 | 1081 | } |
| 1082 | 1082 | |
| 1083 | - $postcurr_images[] = str_replace(array('http://','https://'),'',$uploads['baseurl'] . $file_path);
|
|
| 1083 | + $postcurr_images[] = str_replace(array('http://', 'https://'), '', $uploads['baseurl'].$file_path);
|
|
| 1084 | 1084 | |
| 1085 | 1085 | if ($menu_order == 1) {
|
| 1086 | 1086 | |
| 1087 | - $wpdb->query($wpdb->prepare("UPDATE " . $table . " SET featured_image = %s where post_id =%d", array($file_path, $post_id)));
|
|
| 1087 | + $wpdb->query($wpdb->prepare("UPDATE ".$table." SET featured_image = %s where post_id =%d", array($file_path, $post_id)));
|
|
| 1088 | 1088 | |
| 1089 | 1089 | } |
| 1090 | 1090 | |
@@ -1102,12 +1102,12 @@ discard block |
||
| 1102 | 1102 | |
| 1103 | 1103 | foreach ($attachment as $key => $val) {
|
| 1104 | 1104 | if ($val != '') |
| 1105 | - $attachment_set .= $key . " = '" . $val . "', "; |
|
| 1105 | + $attachment_set .= $key." = '".$val."', "; |
|
| 1106 | 1106 | } |
| 1107 | 1107 | |
| 1108 | 1108 | $attachment_set = trim($attachment_set, ", "); |
| 1109 | 1109 | |
| 1110 | - $wpdb->query("INSERT INTO " . GEODIR_ATTACHMENT_TABLE . " SET " . $attachment_set);
|
|
| 1110 | + $wpdb->query("INSERT INTO ".GEODIR_ATTACHMENT_TABLE." SET ".$attachment_set);
|
|
| 1111 | 1111 | |
| 1112 | 1112 | $valid_file_ids[] = $wpdb->insert_id; |
| 1113 | 1113 | } |
@@ -1118,17 +1118,17 @@ discard block |
||
| 1118 | 1118 | } else {
|
| 1119 | 1119 | $valid_file_ids[] = $find_image; |
| 1120 | 1120 | |
| 1121 | - $postcurr_images[] = str_replace(array('http://','https://'),'',$post_image[$m]);
|
|
| 1121 | + $postcurr_images[] = str_replace(array('http://', 'https://'), '', $post_image[$m]);
|
|
| 1122 | 1122 | |
| 1123 | 1123 | $wpdb->query( |
| 1124 | 1124 | $wpdb->prepare( |
| 1125 | - "UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order = %d where file =%s AND post_id =%d", |
|
| 1125 | + "UPDATE ".GEODIR_ATTACHMENT_TABLE." SET menu_order = %d where file =%s AND post_id =%d", |
|
| 1126 | 1126 | array($menu_order, $split_img_path[1], $post_id) |
| 1127 | 1127 | ) |
| 1128 | 1128 | ); |
| 1129 | 1129 | |
| 1130 | 1130 | if ($menu_order == 1) |
| 1131 | - $wpdb->query($wpdb->prepare("UPDATE " . $table . " SET featured_image = %s where post_id =%d", array($split_img_path[1], $post_id)));
|
|
| 1131 | + $wpdb->query($wpdb->prepare("UPDATE ".$table." SET featured_image = %s where post_id =%d", array($split_img_path[1], $post_id)));
|
|
| 1132 | 1132 | |
| 1133 | 1133 | } |
| 1134 | 1134 | |
@@ -1152,9 +1152,9 @@ discard block |
||
| 1152 | 1152 | |
| 1153 | 1153 | foreach ($post_images as $img) {
|
| 1154 | 1154 | |
| 1155 | - if (!in_array(str_replace(array('http://','https://'),'',$img->src), $postcurr_images)) {
|
|
| 1155 | + if (!in_array(str_replace(array('http://', 'https://'), '', $img->src), $postcurr_images)) {
|
|
| 1156 | 1156 | |
| 1157 | - $invalid_files[] = (object)array('src' => $img->src);
|
|
| 1157 | + $invalid_files[] = (object) array('src' => $img->src);
|
|
| 1158 | 1158 | |
| 1159 | 1159 | } |
| 1160 | 1160 | |
@@ -1162,12 +1162,12 @@ discard block |
||
| 1162 | 1162 | |
| 1163 | 1163 | } |
| 1164 | 1164 | |
| 1165 | - $invalid_files = (object)$invalid_files; |
|
| 1165 | + $invalid_files = (object) $invalid_files; |
|
| 1166 | 1166 | } |
| 1167 | 1167 | |
| 1168 | 1168 | $remove_files[] = $post_id; |
| 1169 | 1169 | |
| 1170 | - $wpdb->query($wpdb->prepare("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE " . $valid_files_condition . " post_id = %d", $remove_files));
|
|
| 1170 | + $wpdb->query($wpdb->prepare("DELETE FROM ".GEODIR_ATTACHMENT_TABLE." WHERE ".$valid_files_condition." post_id = %d", $remove_files));
|
|
| 1171 | 1171 | |
| 1172 | 1172 | if (!empty($invalid_files)) |
| 1173 | 1173 | geodir_remove_attachments($invalid_files); |
@@ -1207,7 +1207,7 @@ discard block |
||
| 1207 | 1207 | rmdir($dirPath); |
| 1208 | 1208 | } */ |
| 1209 | 1209 | |
| 1210 | - $dirname = $uploads_dir . '/temp_' . $current_user->ID; |
|
| 1210 | + $dirname = $uploads_dir.'/temp_'.$current_user->ID; |
|
| 1211 | 1211 | geodir_delete_directory($dirname); |
| 1212 | 1212 | } |
| 1213 | 1213 | |
@@ -1229,10 +1229,10 @@ discard block |
||
| 1229 | 1229 | return false; |
| 1230 | 1230 | while ($file = readdir($dir_handle)) {
|
| 1231 | 1231 | if ($file != "." && $file != "..") {
|
| 1232 | - if (!is_dir($dirname . "/" . $file)) |
|
| 1233 | - unlink($dirname . "/" . $file); |
|
| 1232 | + if (!is_dir($dirname."/".$file)) |
|
| 1233 | + unlink($dirname."/".$file); |
|
| 1234 | 1234 | else |
| 1235 | - geodir_delete_directory($dirname . '/' . $file); |
|
| 1235 | + geodir_delete_directory($dirname.'/'.$file); |
|
| 1236 | 1236 | } |
| 1237 | 1237 | } |
| 1238 | 1238 | closedir($dir_handle); |
@@ -1261,8 +1261,8 @@ discard block |
||
| 1261 | 1261 | foreach ($postcurr_images as $postimg) {
|
| 1262 | 1262 | $image_name_arr = explode('/', $postimg->src);
|
| 1263 | 1263 | $filename = end($image_name_arr); |
| 1264 | - if (file_exists($uploads_dir . '/' . $filename)) |
|
| 1265 | - unlink($uploads_dir . '/' . $filename); |
|
| 1264 | + if (file_exists($uploads_dir.'/'.$filename)) |
|
| 1265 | + unlink($uploads_dir.'/'.$filename); |
|
| 1266 | 1266 | } |
| 1267 | 1267 | |
| 1268 | 1268 | } // endif |
@@ -1303,7 +1303,7 @@ discard block |
||
| 1303 | 1303 | } |
| 1304 | 1304 | |
| 1305 | 1305 | if (!in_array($post_type, geodir_get_posttypes())) {
|
| 1306 | - return false;// if not a GD CPT return; |
|
| 1306 | + return false; // if not a GD CPT return; |
|
| 1307 | 1307 | } |
| 1308 | 1308 | |
| 1309 | 1309 | |
@@ -1311,22 +1311,22 @@ discard block |
||
| 1311 | 1311 | * Filter to force the list images to be smaller. |
| 1312 | 1312 | * @since 1.6.18 |
| 1313 | 1313 | */ |
| 1314 | - if( $size=='list-thumb' && apply_filters('geodir_use_small_list_img',false) ){
|
|
| 1315 | - $fimg = get_the_post_thumbnail_url($post_id,'medium'); |
|
| 1316 | - if($fimg){
|
|
| 1314 | + if ($size == 'list-thumb' && apply_filters('geodir_use_small_list_img', false)) {
|
|
| 1315 | + $fimg = get_the_post_thumbnail_url($post_id, 'medium'); |
|
| 1316 | + if ($fimg) {
|
|
| 1317 | 1317 | $uploads = wp_upload_dir(); |
| 1318 | 1318 | $uploads_baseurl = $uploads['baseurl']; |
| 1319 | - $file = str_replace($uploads_baseurl,'',$fimg); |
|
| 1319 | + $file = str_replace($uploads_baseurl, '', $fimg); |
|
| 1320 | 1320 | } |
| 1321 | 1321 | } |
| 1322 | 1322 | |
| 1323 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
| 1323 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
| 1324 | 1324 | |
| 1325 | 1325 | if (!$file) {
|
| 1326 | 1326 | if (isset($post->featured_image)) {
|
| 1327 | 1327 | $file = $post->featured_image; |
| 1328 | 1328 | } else {
|
| 1329 | - $file = $wpdb->get_var($wpdb->prepare("SELECT featured_image FROM " . $table . " WHERE post_id = %d", array($post_id)));
|
|
| 1329 | + $file = $wpdb->get_var($wpdb->prepare("SELECT featured_image FROM ".$table." WHERE post_id = %d", array($post_id)));
|
|
| 1330 | 1330 | } |
| 1331 | 1331 | } |
| 1332 | 1332 | |
@@ -1345,7 +1345,7 @@ discard block |
||
| 1345 | 1345 | |
| 1346 | 1346 | $file_name = $file_info['basename']; |
| 1347 | 1347 | |
| 1348 | - $uploads_url = $uploads_baseurl . $sub_dir; |
|
| 1348 | + $uploads_url = $uploads_baseurl.$sub_dir; |
|
| 1349 | 1349 | /* |
| 1350 | 1350 | * Allows the filter of image src for such things as CDN change. |
| 1351 | 1351 | * |
@@ -1355,8 +1355,8 @@ discard block |
||
| 1355 | 1355 | * @param string $uploads_url The server upload directory url. |
| 1356 | 1356 | * @param string $uploads_baseurl The uploads dir base url. |
| 1357 | 1357 | */ |
| 1358 | - $img_arr['src'] = apply_filters('geodir_get_featured_image_src',$uploads_url . '/' . $file_name,$file_name,$uploads_url,$uploads_baseurl);
|
|
| 1359 | - $img_arr['path'] = $uploads_path . '/' . $file_name; |
|
| 1358 | + $img_arr['src'] = apply_filters('geodir_get_featured_image_src', $uploads_url.'/'.$file_name, $file_name, $uploads_url, $uploads_baseurl);
|
|
| 1359 | + $img_arr['path'] = $uploads_path.'/'.$file_name; |
|
| 1360 | 1360 | $width = 0; |
| 1361 | 1361 | $height = 0; |
| 1362 | 1362 | if (is_file($img_arr['path']) && file_exists($img_arr['path'])) {
|
@@ -1399,7 +1399,7 @@ discard block |
||
| 1399 | 1399 | $file_name = $file_info['basename']; |
| 1400 | 1400 | |
| 1401 | 1401 | $img_arr['src'] = $default_img; |
| 1402 | - $img_arr['path'] = $uploads_path . '/' . $file_name; |
|
| 1402 | + $img_arr['path'] = $uploads_path.'/'.$file_name; |
|
| 1403 | 1403 | |
| 1404 | 1404 | $width = 0; |
| 1405 | 1405 | $height = 0; |
@@ -1416,7 +1416,7 @@ discard block |
||
| 1416 | 1416 | } |
| 1417 | 1417 | |
| 1418 | 1418 | if (!empty($img_arr)) |
| 1419 | - return (object)$img_arr;//return (object)array( 'src' => $file_url, 'path' => $file_path ); |
|
| 1419 | + return (object) $img_arr; //return (object)array( 'src' => $file_url, 'path' => $file_path ); |
|
| 1420 | 1420 | else |
| 1421 | 1421 | return false; |
| 1422 | 1422 | } |
@@ -1479,7 +1479,7 @@ discard block |
||
| 1479 | 1479 | |
| 1480 | 1480 | $arrImages = $wpdb->get_results( |
| 1481 | 1481 | $wpdb->prepare( |
| 1482 | - "SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE mime_type like %s AND post_id = %d" . $not_featured . " ORDER BY menu_order ASC, ID DESC $limit_q ", |
|
| 1482 | + "SELECT * FROM ".GEODIR_ATTACHMENT_TABLE." WHERE mime_type like %s AND post_id = %d".$not_featured." ORDER BY menu_order ASC, ID DESC $limit_q ", |
|
| 1483 | 1483 | array('%image%', $post_id)
|
| 1484 | 1484 | ) |
| 1485 | 1485 | ); |
@@ -1505,7 +1505,7 @@ discard block |
||
| 1505 | 1505 | |
| 1506 | 1506 | $file_name = $file_info['basename']; |
| 1507 | 1507 | |
| 1508 | - $uploads_url = $uploads_baseurl . $sub_dir; |
|
| 1508 | + $uploads_url = $uploads_baseurl.$sub_dir; |
|
| 1509 | 1509 | /* |
| 1510 | 1510 | * Allows the filter of image src for such things as CDN change. |
| 1511 | 1511 | * |
@@ -1515,8 +1515,8 @@ discard block |
||
| 1515 | 1515 | * @param string $uploads_url The server upload directory url. |
| 1516 | 1516 | * @param string $uploads_baseurl The uploads dir base url. |
| 1517 | 1517 | */ |
| 1518 | - $img_arr['src'] = apply_filters('geodir_get_images_src',$uploads_url . '/' . $file_name,$file_name,$uploads_url,$uploads_baseurl);
|
|
| 1519 | - $img_arr['path'] = $uploads_path . '/' . $file_name; |
|
| 1518 | + $img_arr['src'] = apply_filters('geodir_get_images_src', $uploads_url.'/'.$file_name, $file_name, $uploads_url, $uploads_baseurl);
|
|
| 1519 | + $img_arr['path'] = $uploads_path.'/'.$file_name; |
|
| 1520 | 1520 | $width = 0; |
| 1521 | 1521 | $height = 0; |
| 1522 | 1522 | if (is_file($img_arr['path']) && file_exists($img_arr['path'])) {
|
@@ -1533,7 +1533,7 @@ discard block |
||
| 1533 | 1533 | $img_arr['content'] = $attechment->content; // add the description to the array |
| 1534 | 1534 | $img_arr['is_approved'] = isset($attechment->is_approved) ? $attechment->is_approved : ''; // used for user image moderation. For backward compatibility Default value is 1. |
| 1535 | 1535 | |
| 1536 | - $return_arr[] = (object)$img_arr; |
|
| 1536 | + $return_arr[] = (object) $img_arr; |
|
| 1537 | 1537 | |
| 1538 | 1538 | $counter++; |
| 1539 | 1539 | } |
@@ -1544,7 +1544,7 @@ discard block |
||
| 1544 | 1544 | * @since 1.6.20 |
| 1545 | 1545 | * @param array $return_arr The array of image objects. |
| 1546 | 1546 | */ |
| 1547 | - return apply_filters('geodir_get_images_arr',$return_arr);
|
|
| 1547 | + return apply_filters('geodir_get_images_arr', $return_arr);
|
|
| 1548 | 1548 | } else if ($no_images) {
|
| 1549 | 1549 | $default_img = ''; |
| 1550 | 1550 | $default_cat = geodir_get_post_meta($post_id, 'default_category', true); |
@@ -1583,7 +1583,7 @@ discard block |
||
| 1583 | 1583 | $img_arr['title'] = $file_info['filename']; // add the title to the array |
| 1584 | 1584 | $img_arr['content'] = $file_info['filename']; // add the description to the array |
| 1585 | 1585 | |
| 1586 | - $return_arr[] = (object)$img_arr; |
|
| 1586 | + $return_arr[] = (object) $img_arr; |
|
| 1587 | 1587 | |
| 1588 | 1588 | /** |
| 1589 | 1589 | * Filter the images array so things can be changed. |
@@ -1591,7 +1591,7 @@ discard block |
||
| 1591 | 1591 | * @since 1.6.20 |
| 1592 | 1592 | * @param array $return_arr The array of image objects. |
| 1593 | 1593 | */ |
| 1594 | - return apply_filters('geodir_get_images_arr',$return_arr);
|
|
| 1594 | + return apply_filters('geodir_get_images_arr', $return_arr);
|
|
| 1595 | 1595 | } else |
| 1596 | 1596 | return false; |
| 1597 | 1597 | } |
@@ -1616,8 +1616,8 @@ discard block |
||
| 1616 | 1616 | |
| 1617 | 1617 | $html = ''; |
| 1618 | 1618 | if (!empty($request)) {
|
| 1619 | - if (!is_object($request)){
|
|
| 1620 | - $request = (object)$request; |
|
| 1619 | + if (!is_object($request)) {
|
|
| 1620 | + $request = (object) $request; |
|
| 1621 | 1621 | } |
| 1622 | 1622 | |
| 1623 | 1623 | if (isset($request->src) && !isset($request->path)) {
|
@@ -1631,7 +1631,7 @@ discard block |
||
| 1631 | 1631 | $img_no_http = str_replace(array("http://", "https://"), "", $request->path);
|
| 1632 | 1632 | $upload_no_http = str_replace(array("http://", "https://"), "", $upload_dir['baseurl']);
|
| 1633 | 1633 | if (strpos($img_no_http, $upload_no_http) !== false) {
|
| 1634 | - $request->path = str_replace( $img_no_http,$upload_dir['basedir'], $request->path); |
|
| 1634 | + $request->path = str_replace($img_no_http, $upload_dir['basedir'], $request->path); |
|
| 1635 | 1635 | } |
| 1636 | 1636 | |
| 1637 | 1637 | $width = 0; |
@@ -1646,7 +1646,7 @@ discard block |
||
| 1646 | 1646 | $image->width = $width; |
| 1647 | 1647 | $image->height = $height; |
| 1648 | 1648 | |
| 1649 | - $max_size = (object)geodir_get_imagesize($size); |
|
| 1649 | + $max_size = (object) geodir_get_imagesize($size); |
|
| 1650 | 1650 | |
| 1651 | 1651 | if (!is_wp_error($max_size)) {
|
| 1652 | 1652 | if ($image->width) {
|
@@ -1658,15 +1658,15 @@ discard block |
||
| 1658 | 1658 | $width_per = 100; |
| 1659 | 1659 | } |
| 1660 | 1660 | |
| 1661 | - if (is_admin() && !isset($_REQUEST['geodir_ajax'])){
|
|
| 1662 | - $html = '<div class="geodir_thumbnail"><img style="max-height:' . $max_size->h . 'px;" alt="place image" src="' . $image->src . '" /></div>'; |
|
| 1661 | + if (is_admin() && !isset($_REQUEST['geodir_ajax'])) {
|
|
| 1662 | + $html = '<div class="geodir_thumbnail"><img style="max-height:'.$max_size->h.'px;" alt="place image" src="'.$image->src.'" /></div>'; |
|
| 1663 | 1663 | } else {
|
| 1664 | - if($size=='widget-thumb' || !get_option('geodir_lazy_load',1)){
|
|
| 1665 | - $html = '<div class="geodir_thumbnail" style="background-image:url(\'' . $image->src . '\');"></div>'; |
|
| 1666 | - }else{
|
|
| 1664 | + if ($size == 'widget-thumb' || !get_option('geodir_lazy_load', 1)) {
|
|
| 1665 | + $html = '<div class="geodir_thumbnail" style="background-image:url(\''.$image->src.'\');"></div>'; |
|
| 1666 | + } else {
|
|
| 1667 | 1667 | //$html = '<div class="geodir_thumbnail" style="background-image:url(\'' . $image->src . '\');"></div>'; |
| 1668 | 1668 | //$html = '<div data-src="'.$image->src.'" class="geodir_thumbnail" ></div>'; |
| 1669 | - $html = '<div data-src="'.str_replace(' ','%20',$image->src).'" class="geodir_thumbnail geodir_lazy_load_thumbnail" ></div>';
|
|
| 1669 | + $html = '<div data-src="'.str_replace(' ', '%20', $image->src).'" class="geodir_thumbnail geodir_lazy_load_thumbnail" ></div>';
|
|
| 1670 | 1670 | |
| 1671 | 1671 | } |
| 1672 | 1672 | |
@@ -1702,15 +1702,15 @@ discard block |
||
| 1702 | 1702 | |
| 1703 | 1703 | $post_type = get_post_type($post_id); |
| 1704 | 1704 | |
| 1705 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
| 1705 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
| 1706 | 1706 | |
| 1707 | 1707 | if (in_array($post_type, geodir_get_posttypes()) && !wp_is_post_revision($post_id)) {
|
| 1708 | 1708 | |
| 1709 | - if ($taxonomy == $post_type . '_tags') {
|
|
| 1709 | + if ($taxonomy == $post_type.'_tags') {
|
|
| 1710 | 1710 | if (isset($_POST['action']) && $_POST['action'] == 'inline-save') {
|
| 1711 | 1711 | geodir_save_post_meta($post_id, 'post_tags', $terms); |
| 1712 | 1712 | } |
| 1713 | - } elseif ($taxonomy == $post_type . 'category') {
|
|
| 1713 | + } elseif ($taxonomy == $post_type.'category') {
|
|
| 1714 | 1714 | $srcharr = array('"', '\\');
|
| 1715 | 1715 | $replarr = array(""", '');
|
| 1716 | 1716 | |
@@ -1732,7 +1732,7 @@ discard block |
||
| 1732 | 1732 | |
| 1733 | 1733 | $wpdb->get_var( |
| 1734 | 1734 | $wpdb->prepare( |
| 1735 | - "DELETE from " . GEODIR_ICON_TABLE . " WHERE cat_id NOT IN ($format) AND post_id = %d ", |
|
| 1735 | + "DELETE from ".GEODIR_ICON_TABLE." WHERE cat_id NOT IN ($format) AND post_id = %d ", |
|
| 1736 | 1736 | $cat_ids_array_del |
| 1737 | 1737 | ) |
| 1738 | 1738 | ); |
@@ -1740,7 +1740,7 @@ discard block |
||
| 1740 | 1740 | |
| 1741 | 1741 | $post_term = $wpdb->get_col( |
| 1742 | 1742 | $wpdb->prepare( |
| 1743 | - "SELECT term_id FROM " . $wpdb->term_taxonomy . " WHERE term_taxonomy_id IN($format) GROUP BY term_id", |
|
| 1743 | + "SELECT term_id FROM ".$wpdb->term_taxonomy." WHERE term_taxonomy_id IN($format) GROUP BY term_id", |
|
| 1744 | 1744 | $cat_ids_array |
| 1745 | 1745 | ) |
| 1746 | 1746 | ); |
@@ -1762,16 +1762,16 @@ discard block |
||
| 1762 | 1762 | $lat = geodir_get_post_meta($post_id, 'post_latitude', true); |
| 1763 | 1763 | $lng = geodir_get_post_meta($post_id, 'post_longitude', true); |
| 1764 | 1764 | |
| 1765 | - $timing = ' - ' . date('D M j, Y', strtotime(geodir_get_post_meta($post_id, 'st_date', true)));
|
|
| 1766 | - $timing .= ' - ' . geodir_get_post_meta($post_id, 'st_time', true); |
|
| 1765 | + $timing = ' - '.date('D M j, Y', strtotime(geodir_get_post_meta($post_id, 'st_date', true)));
|
|
| 1766 | + $timing .= ' - '.geodir_get_post_meta($post_id, 'st_time', true); |
|
| 1767 | 1767 | |
| 1768 | 1768 | $json = '{';
|
| 1769 | - $json .= '"id":"' . $post_id . '",'; |
|
| 1770 | - $json .= '"lat_pos": "' . $lat . '",'; |
|
| 1771 | - $json .= '"long_pos": "' . $lng . '",'; |
|
| 1772 | - $json .= '"marker_id":"' . $post_id . '_' . $cat_id . '",'; |
|
| 1773 | - $json .= '"icon":"' . $term_icon . '",'; |
|
| 1774 | - $json .= '"group":"catgroup' . $cat_id . '"'; |
|
| 1769 | + $json .= '"id":"'.$post_id.'",'; |
|
| 1770 | + $json .= '"lat_pos": "'.$lat.'",'; |
|
| 1771 | + $json .= '"long_pos": "'.$lng.'",'; |
|
| 1772 | + $json .= '"marker_id":"'.$post_id.'_'.$cat_id.'",'; |
|
| 1773 | + $json .= '"icon":"'.$term_icon.'",'; |
|
| 1774 | + $json .= '"group":"catgroup'.$cat_id.'"'; |
|
| 1775 | 1775 | $json .= '}'; |
| 1776 | 1776 | |
| 1777 | 1777 | |
@@ -1779,9 +1779,9 @@ discard block |
||
| 1779 | 1779 | $post_marker_json = $json; |
| 1780 | 1780 | |
| 1781 | 1781 | |
| 1782 | - if ($wpdb->get_var($wpdb->prepare("SELECT post_id from " . GEODIR_ICON_TABLE . " WHERE post_id = %d AND cat_id = %d", array($post_id, $cat_id)))) {
|
|
| 1782 | + if ($wpdb->get_var($wpdb->prepare("SELECT post_id from ".GEODIR_ICON_TABLE." WHERE post_id = %d AND cat_id = %d", array($post_id, $cat_id)))) {
|
|
| 1783 | 1783 | |
| 1784 | - $json_query = $wpdb->prepare("UPDATE " . GEODIR_ICON_TABLE . " SET
|
|
| 1784 | + $json_query = $wpdb->prepare("UPDATE ".GEODIR_ICON_TABLE." SET
|
|
| 1785 | 1785 | post_title = %s, |
| 1786 | 1786 | json = %s |
| 1787 | 1787 | WHERE post_id = %d AND cat_id = %d ", |
@@ -1789,7 +1789,7 @@ discard block |
||
| 1789 | 1789 | |
| 1790 | 1790 | } else {
|
| 1791 | 1791 | |
| 1792 | - $json_query = $wpdb->prepare("INSERT INTO " . GEODIR_ICON_TABLE . " SET
|
|
| 1792 | + $json_query = $wpdb->prepare("INSERT INTO ".GEODIR_ICON_TABLE." SET
|
|
| 1793 | 1793 | post_id = %d, |
| 1794 | 1794 | post_title = %s, |
| 1795 | 1795 | cat_id = %d, |
@@ -1807,17 +1807,17 @@ discard block |
||
| 1807 | 1807 | if (!empty($post_term) && is_array($post_term)) {
|
| 1808 | 1808 | $categories = implode(',', $post_term);
|
| 1809 | 1809 | |
| 1810 | - if ($categories != '' && $categories != 0) $categories = ',' . $categories . ','; |
|
| 1810 | + if ($categories != '' && $categories != 0) $categories = ','.$categories.','; |
|
| 1811 | 1811 | |
| 1812 | 1812 | if (empty($post_marker_json)) |
| 1813 | 1813 | $post_marker_json = isset($json) ? $json : ''; |
| 1814 | 1814 | |
| 1815 | - if ($wpdb->get_var($wpdb->prepare("SELECT post_id from " . $table . " where post_id = %d", array($post_id)))) {
|
|
| 1815 | + if ($wpdb->get_var($wpdb->prepare("SELECT post_id from ".$table." where post_id = %d", array($post_id)))) {
|
|
| 1816 | 1816 | |
| 1817 | 1817 | $wpdb->query( |
| 1818 | 1818 | $wpdb->prepare( |
| 1819 | - "UPDATE " . $table . " SET |
|
| 1820 | - " . $taxonomy . " = %s, |
|
| 1819 | + "UPDATE ".$table." SET |
|
| 1820 | + " . $taxonomy." = %s, |
|
| 1821 | 1821 | marker_json = %s |
| 1822 | 1822 | where post_id = %d", |
| 1823 | 1823 | array($categories, $post_marker_json, $post_id) |
@@ -1838,7 +1838,7 @@ discard block |
||
| 1838 | 1838 | |
| 1839 | 1839 | $wpdb->query( |
| 1840 | 1840 | $wpdb->prepare( |
| 1841 | - "UPDATE " . $table . " SET |
|
| 1841 | + "UPDATE ".$table." SET |
|
| 1842 | 1842 | default_category = %s |
| 1843 | 1843 | where post_id = %d", |
| 1844 | 1844 | array($categories[0], $post_id) |
@@ -1863,9 +1863,9 @@ discard block |
||
| 1863 | 1863 | |
| 1864 | 1864 | $wpdb->query( |
| 1865 | 1865 | $wpdb->prepare( |
| 1866 | - "INSERT INTO " . $table . " SET |
|
| 1866 | + "INSERT INTO ".$table." SET |
|
| 1867 | 1867 | post_id = %d, |
| 1868 | - " . $taxonomy . " = %s, |
|
| 1868 | + " . $taxonomy." = %s, |
|
| 1869 | 1869 | marker_json = %s ", |
| 1870 | 1870 | |
| 1871 | 1871 | array($post_id, $categories, $post_marker_json) |
@@ -1997,7 +1997,7 @@ discard block |
||
| 1997 | 1997 | } ?>"><img alt="bubble image" style="max-height:50px;" |
| 1998 | 1998 | src="<?php echo $post_images[0]; ?>"/></a></div> |
| 1999 | 1999 | <?php |
| 2000 | - }else{
|
|
| 2000 | + } else {
|
|
| 2001 | 2001 | echo '<div class="geodir-bubble_image"></div>'; |
| 2002 | 2002 | } |
| 2003 | 2003 | } else {
|
@@ -2005,7 +2005,7 @@ discard block |
||
| 2005 | 2005 | ?> |
| 2006 | 2006 | <div class="geodir-bubble_image"><a href="<?php echo $plink; ?>"><?php echo $image; ?></a></div> |
| 2007 | 2007 | <?php |
| 2008 | - }else{
|
|
| 2008 | + } else {
|
|
| 2009 | 2009 | echo '<div class="geodir-bubble_image"></div>'; |
| 2010 | 2010 | } |
| 2011 | 2011 | } |
@@ -2035,7 +2035,7 @@ discard block |
||
| 2035 | 2035 | * @param object $postinfo_obj The posts info as an object. |
| 2036 | 2036 | * @param bool|string $post_preview True if currently in post preview page. Empty string if not. * |
| 2037 | 2037 | */ |
| 2038 | - do_action('geodir_infowindow_meta_after',$postinfo_obj,$post_preview );
|
|
| 2038 | + do_action('geodir_infowindow_meta_after', $postinfo_obj, $post_preview);
|
|
| 2039 | 2039 | ?> |
| 2040 | 2040 | </div> |
| 2041 | 2041 | <?php |
@@ -2045,9 +2045,9 @@ discard block |
||
| 2045 | 2045 | <div class="geodir-bubble-meta-fade"></div> |
| 2046 | 2046 | <div class="geodir-bubble-meta-bottom"> |
| 2047 | 2047 | <?php if ($rating_star != '') { ?>
|
| 2048 | - <span class="geodir-bubble-rating"><?php echo $rating_star;?></span> |
|
| 2048 | + <span class="geodir-bubble-rating"><?php echo $rating_star; ?></span> |
|
| 2049 | 2049 | <?php } ?> |
| 2050 | - <span class="geodir-bubble-fav"><?php echo geodir_favourite_html($post_author, $ID);?></span> |
|
| 2050 | + <span class="geodir-bubble-fav"><?php echo geodir_favourite_html($post_author, $ID); ?></span> |
|
| 2051 | 2051 | <span class="geodir-bubble-reviews"> |
| 2052 | 2052 | <a href="<?php echo get_comments_link($ID); ?>" class="geodir-pcomments"><i class="fa fa-comments"></i> <?php echo get_comments_number($ID); ?></a> |
| 2053 | 2053 | </span> |
@@ -2109,11 +2109,11 @@ discard block |
||
| 2109 | 2109 | |
| 2110 | 2110 | $post_type = get_post_type($post_id); |
| 2111 | 2111 | |
| 2112 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
| 2112 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
| 2113 | 2113 | |
| 2114 | 2114 | $wpdb->query( |
| 2115 | 2115 | $wpdb->prepare( |
| 2116 | - "UPDATE " . $table . " SET post_status=%s WHERE post_id=%d", |
|
| 2116 | + "UPDATE ".$table." SET post_status=%s WHERE post_id=%d", |
|
| 2117 | 2117 | array($status, $post_id) |
| 2118 | 2118 | ) |
| 2119 | 2119 | ); |
@@ -2185,18 +2185,18 @@ discard block |
||
| 2185 | 2185 | |
| 2186 | 2186 | $post_type = get_post_type($post_id); |
| 2187 | 2187 | |
| 2188 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
| 2188 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
| 2189 | 2189 | |
| 2190 | 2190 | $wpdb->query( |
| 2191 | 2191 | $wpdb->prepare( |
| 2192 | - "UPDATE " . $table . " SET `post_id` = %d WHERE `post_id` = %d", |
|
| 2192 | + "UPDATE ".$table." SET `post_id` = %d WHERE `post_id` = %d", |
|
| 2193 | 2193 | array($updatingpost, $temppost) |
| 2194 | 2194 | ) |
| 2195 | 2195 | ); |
| 2196 | 2196 | |
| 2197 | 2197 | $wpdb->query( |
| 2198 | 2198 | $wpdb->prepare( |
| 2199 | - "UPDATE " . GEODIR_ICON_TABLE . " SET `post_id` = %d WHERE `post_id` = %d", |
|
| 2199 | + "UPDATE ".GEODIR_ICON_TABLE." SET `post_id` = %d WHERE `post_id` = %d", |
|
| 2200 | 2200 | array($updatingpost, $temppost) |
| 2201 | 2201 | ) |
| 2202 | 2202 | ); |
@@ -2205,7 +2205,7 @@ discard block |
||
| 2205 | 2205 | |
| 2206 | 2206 | $wpdb->query( |
| 2207 | 2207 | $wpdb->prepare( |
| 2208 | - "UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET `post_id` = %d WHERE `post_id` = %d", |
|
| 2208 | + "UPDATE ".GEODIR_ATTACHMENT_TABLE." SET `post_id` = %d WHERE `post_id` = %d", |
|
| 2209 | 2209 | array($updatingpost, $temppost) |
| 2210 | 2210 | ) |
| 2211 | 2211 | ); |
@@ -2243,12 +2243,12 @@ discard block |
||
| 2243 | 2243 | if (!in_array($post_type, $all_postypes)) |
| 2244 | 2244 | return false; |
| 2245 | 2245 | |
| 2246 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
| 2246 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
| 2247 | 2247 | |
| 2248 | 2248 | /* Delete custom post meta*/ |
| 2249 | 2249 | $wpdb->query( |
| 2250 | 2250 | $wpdb->prepare( |
| 2251 | - "DELETE FROM " . $table . " WHERE `post_id` = %d", |
|
| 2251 | + "DELETE FROM ".$table." WHERE `post_id` = %d", |
|
| 2252 | 2252 | array($deleted_postid) |
| 2253 | 2253 | ) |
| 2254 | 2254 | ); |
@@ -2257,7 +2257,7 @@ discard block |
||
| 2257 | 2257 | |
| 2258 | 2258 | $wpdb->query( |
| 2259 | 2259 | $wpdb->prepare( |
| 2260 | - "DELETE FROM " . GEODIR_ICON_TABLE . " WHERE `post_id` = %d", |
|
| 2260 | + "DELETE FROM ".GEODIR_ICON_TABLE." WHERE `post_id` = %d", |
|
| 2261 | 2261 | array($deleted_postid) |
| 2262 | 2262 | ) |
| 2263 | 2263 | ); |
@@ -2267,7 +2267,7 @@ discard block |
||
| 2267 | 2267 | |
| 2268 | 2268 | $wpdb->query( |
| 2269 | 2269 | $wpdb->prepare( |
| 2270 | - "DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE `post_id` = %d", |
|
| 2270 | + "DELETE FROM ".GEODIR_ATTACHMENT_TABLE." WHERE `post_id` = %d", |
|
| 2271 | 2271 | array($deleted_postid) |
| 2272 | 2272 | ) |
| 2273 | 2273 | ); |
@@ -2339,7 +2339,7 @@ discard block |
||
| 2339 | 2339 | */ |
| 2340 | 2340 | do_action('geodir_before_add_from_favorite', $post_id);
|
| 2341 | 2341 | |
| 2342 | - echo '<a href="javascript:void(0);" title="' . $remove_favourite_text . '" class="geodir-removetofav-icon" onclick="javascript:addToFavourite(\'' . $post_id . '\',\'remove\');"><i class="'. $favourite_icon .'"></i> ' . $unfavourite_text . '</a>'; |
|
| 2342 | + echo '<a href="javascript:void(0);" title="'.$remove_favourite_text.'" class="geodir-removetofav-icon" onclick="javascript:addToFavourite(\''.$post_id.'\',\'remove\');"><i class="'.$favourite_icon.'"></i> '.$unfavourite_text.'</a>'; |
|
| 2343 | 2343 | |
| 2344 | 2344 | /** |
| 2345 | 2345 | * Called after adding the post from favourites. |
@@ -2418,7 +2418,7 @@ discard block |
||
| 2418 | 2418 | */ |
| 2419 | 2419 | do_action('geodir_before_remove_from_favorite', $post_id);
|
| 2420 | 2420 | |
| 2421 | - echo '<a href="javascript:void(0);" title="' . $add_favourite_text . '" class="geodir-addtofav-icon" onclick="javascript:addToFavourite(\'' . $post_id . '\',\'add\');"><i class="'. $favourite_icon .'"></i> ' . $favourite_text . '</a>'; |
|
| 2421 | + echo '<a href="javascript:void(0);" title="'.$add_favourite_text.'" class="geodir-addtofav-icon" onclick="javascript:addToFavourite(\''.$post_id.'\',\'add\');"><i class="'.$favourite_icon.'"></i> '.$favourite_text.'</a>'; |
|
| 2422 | 2422 | |
| 2423 | 2423 | /** |
| 2424 | 2424 | * Called after removing the post from favourites. |
@@ -2513,24 +2513,24 @@ discard block |
||
| 2513 | 2513 | $user_meta_data = get_user_meta($current_user->data->ID, 'gd_user_favourite_post', true); |
| 2514 | 2514 | |
| 2515 | 2515 | if (!empty($user_meta_data) && in_array($post_id, $user_meta_data)) {
|
| 2516 | - ?><span class="geodir-addtofav favorite_property_<?php echo $post_id;?>" ><a |
|
| 2516 | + ?><span class="geodir-addtofav favorite_property_<?php echo $post_id; ?>" ><a |
|
| 2517 | 2517 | class="geodir-removetofav-icon" href="javascript:void(0);" |
| 2518 | - onclick="javascript:addToFavourite(<?php echo $post_id;?>,'remove');" |
|
| 2519 | - title="<?php echo $remove_favourite_text;?>"><i class="<?php echo $unfavourite_icon; ?>"></i> <?php echo $unfavourite_text;?> |
|
| 2518 | + onclick="javascript:addToFavourite(<?php echo $post_id; ?>,'remove');" |
|
| 2519 | + title="<?php echo $remove_favourite_text; ?>"><i class="<?php echo $unfavourite_icon; ?>"></i> <?php echo $unfavourite_text; ?> |
|
| 2520 | 2520 | </a> </span><?php |
| 2521 | 2521 | |
| 2522 | 2522 | } else {
|
| 2523 | 2523 | |
| 2524 | 2524 | if (!isset($current_user->data->ID) || $current_user->data->ID == '') {
|
| 2525 | - $script_text = 'javascript:window.location.href=\'' . geodir_login_url() . '\''; |
|
| 2525 | + $script_text = 'javascript:window.location.href=\''.geodir_login_url().'\''; |
|
| 2526 | 2526 | } else |
| 2527 | - $script_text = 'javascript:addToFavourite(' . $post_id . ',\'add\')';
|
|
| 2527 | + $script_text = 'javascript:addToFavourite('.$post_id.',\'add\')';
|
|
| 2528 | 2528 | |
| 2529 | - ?><span class="geodir-addtofav favorite_property_<?php echo $post_id;?>"><a class="geodir-addtofav-icon" |
|
| 2529 | + ?><span class="geodir-addtofav favorite_property_<?php echo $post_id; ?>"><a class="geodir-addtofav-icon" |
|
| 2530 | 2530 | href="javascript:void(0);" |
| 2531 | - onclick="<?php echo $script_text;?>" |
|
| 2532 | - title="<?php echo $add_favourite_text;?>"><i |
|
| 2533 | - class="<?php echo $favourite_icon; ?>"></i> <?php echo $favourite_text;?></a></span> |
|
| 2531 | + onclick="<?php echo $script_text; ?>" |
|
| 2532 | + title="<?php echo $add_favourite_text; ?>"><i |
|
| 2533 | + class="<?php echo $favourite_icon; ?>"></i> <?php echo $favourite_text; ?></a></span> |
|
| 2534 | 2534 | <?php } |
| 2535 | 2535 | } |
| 2536 | 2536 | } |
@@ -2560,7 +2560,7 @@ discard block |
||
| 2560 | 2560 | |
| 2561 | 2561 | $post_type = $taxonomy_obj->object_type[0]; |
| 2562 | 2562 | |
| 2563 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
| 2563 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
| 2564 | 2564 | |
| 2565 | 2565 | /** |
| 2566 | 2566 | * Filter to modify the 'join' query |
@@ -2583,8 +2583,8 @@ discard block |
||
| 2583 | 2583 | $where = apply_filters('geodir_cat_post_count_where', $where, $term);
|
| 2584 | 2584 | |
| 2585 | 2585 | $count_query = "SELECT count(post_id) FROM |
| 2586 | - " . $table . " as pd " . $join . " |
|
| 2587 | - WHERE pd.post_status='publish' AND FIND_IN_SET('" . $term->term_id . "'," . $term->taxonomy . ") " . $where;
|
|
| 2586 | + " . $table." as pd ".$join." |
|
| 2587 | + WHERE pd.post_status='publish' AND FIND_IN_SET('" . $term->term_id."',".$term->taxonomy.") ".$where;
|
|
| 2588 | 2588 | |
| 2589 | 2589 | $cat_post_count = $wpdb->get_var($count_query); |
| 2590 | 2590 | if (empty($cat_post_count) || is_wp_error($cat_post_count)) |
@@ -2667,7 +2667,7 @@ discard block |
||
| 2667 | 2667 | global $post; |
| 2668 | 2668 | $all_postypes = geodir_get_posttypes(); |
| 2669 | 2669 | if (is_array($all_postypes) && in_array($post->post_type, $all_postypes)) {
|
| 2670 | - return ' <a href="' . get_permalink($post->ID) . '">' . READ_MORE_TXT . '</a>'; |
|
| 2670 | + return ' <a href="'.get_permalink($post->ID).'">'.READ_MORE_TXT.'</a>'; |
|
| 2671 | 2671 | } |
| 2672 | 2672 | |
| 2673 | 2673 | return $more; |
@@ -2694,14 +2694,14 @@ discard block |
||
| 2694 | 2694 | if (is_array($gd_taxonomies) && in_array($taxonomy, $gd_taxonomies)) {
|
| 2695 | 2695 | |
| 2696 | 2696 | $geodir_post_type = geodir_get_taxonomy_posttype($taxonomy); |
| 2697 | - $table = $plugin_prefix . $geodir_post_type . '_detail'; |
|
| 2697 | + $table = $plugin_prefix.$geodir_post_type.'_detail'; |
|
| 2698 | 2698 | |
| 2699 | 2699 | $path_parts = pathinfo($_REQUEST['ct_cat_icon']['src']); |
| 2700 | - $term_icon = $path_parts['dirname'] . '/cat_icon_' . $term_id . '.png'; |
|
| 2700 | + $term_icon = $path_parts['dirname'].'/cat_icon_'.$term_id.'.png'; |
|
| 2701 | 2701 | |
| 2702 | 2702 | $posts = $wpdb->get_results( |
| 2703 | 2703 | $wpdb->prepare( |
| 2704 | - "SELECT post_id,post_title,post_latitude,post_longitude,default_category FROM " . $table . " WHERE FIND_IN_SET(%s,%1\$s ) ", |
|
| 2704 | + "SELECT post_id,post_title,post_latitude,post_longitude,default_category FROM ".$table." WHERE FIND_IN_SET(%s,%1\$s ) ", |
|
| 2705 | 2705 | array($term_id, $taxonomy) |
| 2706 | 2706 | ) |
| 2707 | 2707 | ); |
@@ -2713,19 +2713,19 @@ discard block |
||
| 2713 | 2713 | $lng = $post_obj->post_longitude; |
| 2714 | 2714 | |
| 2715 | 2715 | $json = '{';
|
| 2716 | - $json .= '"id":"' . $post_obj->post_id . '",'; |
|
| 2717 | - $json .= '"lat_pos": "' . $lat . '",'; |
|
| 2718 | - $json .= '"long_pos": "' . $lng . '",'; |
|
| 2719 | - $json .= '"marker_id":"' . $post_obj->post_id . '_' . $term_id . '",'; |
|
| 2720 | - $json .= '"icon":"' . $term_icon . '",'; |
|
| 2721 | - $json .= '"group":"catgroup' . $term_id . '"'; |
|
| 2716 | + $json .= '"id":"'.$post_obj->post_id.'",'; |
|
| 2717 | + $json .= '"lat_pos": "'.$lat.'",'; |
|
| 2718 | + $json .= '"long_pos": "'.$lng.'",'; |
|
| 2719 | + $json .= '"marker_id":"'.$post_obj->post_id.'_'.$term_id.'",'; |
|
| 2720 | + $json .= '"icon":"'.$term_icon.'",'; |
|
| 2721 | + $json .= '"group":"catgroup'.$term_id.'"'; |
|
| 2722 | 2722 | $json .= '}'; |
| 2723 | 2723 | |
| 2724 | 2724 | if ($post_obj->default_category == $term_id) {
|
| 2725 | 2725 | |
| 2726 | 2726 | $wpdb->query( |
| 2727 | 2727 | $wpdb->prepare( |
| 2728 | - "UPDATE " . $table . " SET marker_json = %s where post_id = %d", |
|
| 2728 | + "UPDATE ".$table." SET marker_json = %s where post_id = %d", |
|
| 2729 | 2729 | array($json, $post_obj->post_id) |
| 2730 | 2730 | ) |
| 2731 | 2731 | ); |
@@ -2733,7 +2733,7 @@ discard block |
||
| 2733 | 2733 | |
| 2734 | 2734 | $wpdb->query( |
| 2735 | 2735 | $wpdb->prepare( |
| 2736 | - "UPDATE " . GEODIR_ICON_TABLE . " SET json = %s WHERE post_id = %d AND cat_id = %d", |
|
| 2736 | + "UPDATE ".GEODIR_ICON_TABLE." SET json = %s WHERE post_id = %d AND cat_id = %d", |
|
| 2737 | 2737 | array($json, $post_obj->post_id, $term_id) |
| 2738 | 2738 | ) |
| 2739 | 2739 | ); |
@@ -2857,7 +2857,7 @@ discard block |
||
| 2857 | 2857 | // print_r($uploads ) ; |
| 2858 | 2858 | $post_first_image = $wpdb->get_results( |
| 2859 | 2859 | $wpdb->prepare( |
| 2860 | - "SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id = %d and menu_order = 1 ", array($post_id) |
|
| 2860 | + "SELECT * FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id = %d and menu_order = 1 ", array($post_id) |
|
| 2861 | 2861 | ) |
| 2862 | 2862 | ); |
| 2863 | 2863 | |
@@ -2878,9 +2878,9 @@ discard block |
||
| 2878 | 2878 | |
| 2879 | 2879 | $post_type = get_post_type($post_id); |
| 2880 | 2880 | |
| 2881 | - $table_name = $plugin_prefix . $post_type . '_detail'; |
|
| 2881 | + $table_name = $plugin_prefix.$post_type.'_detail'; |
|
| 2882 | 2882 | |
| 2883 | - $wpdb->query("UPDATE " . $table_name . " SET featured_image='" . $post_first_image[0]->file . "' WHERE post_id =" . $post_id);
|
|
| 2883 | + $wpdb->query("UPDATE ".$table_name." SET featured_image='".$post_first_image[0]->file."' WHERE post_id =".$post_id);
|
|
| 2884 | 2884 | |
| 2885 | 2885 | $new_attachment_name = basename($post_first_image[0]->file); |
| 2886 | 2886 | |
@@ -2893,11 +2893,11 @@ discard block |
||
| 2893 | 2893 | wp_delete_attachment($post_thumbnail_id); |
| 2894 | 2894 | |
| 2895 | 2895 | } |
| 2896 | - $filename = $uploads['basedir'] . $post_first_image[0]->file; |
|
| 2896 | + $filename = $uploads['basedir'].$post_first_image[0]->file; |
|
| 2897 | 2897 | |
| 2898 | 2898 | $attachment = array( |
| 2899 | 2899 | 'post_mime_type' => $post_first_image[0]->mime_type, |
| 2900 | - 'guid' => $uploads['baseurl'] . $post_first_image[0]->file, |
|
| 2900 | + 'guid' => $uploads['baseurl'].$post_first_image[0]->file, |
|
| 2901 | 2901 | 'post_parent' => $post_id, |
| 2902 | 2902 | 'post_title' => preg_replace('/\.[^.]+$/', '', $post_first_image[0]->title),
|
| 2903 | 2903 | 'post_content' => '' |
@@ -2910,7 +2910,7 @@ discard block |
||
| 2910 | 2910 | |
| 2911 | 2911 | set_post_thumbnail($post_id, $id); |
| 2912 | 2912 | |
| 2913 | - require_once(ABSPATH . 'wp-admin/includes/image.php'); |
|
| 2913 | + require_once(ABSPATH.'wp-admin/includes/image.php'); |
|
| 2914 | 2914 | wp_update_attachment_metadata($id, wp_generate_attachment_metadata($id, $filename)); |
| 2915 | 2915 | |
| 2916 | 2916 | } |
@@ -2943,35 +2943,35 @@ discard block |
||
| 2943 | 2943 | $post_id = absint($_POST['post_id']); |
| 2944 | 2944 | $upload_dir = wp_upload_dir(); |
| 2945 | 2945 | $post_type = get_post_type($_POST['post_id']); |
| 2946 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
| 2946 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
| 2947 | 2947 | |
| 2948 | 2948 | $post_arr = $wpdb->get_results($wpdb->prepare( |
| 2949 | - "SELECT * FROM $wpdb->posts p JOIN " . $table . " gd ON gd.post_id=p.ID WHERE p.ID=%d LIMIT 1", |
|
| 2949 | + "SELECT * FROM $wpdb->posts p JOIN ".$table." gd ON gd.post_id=p.ID WHERE p.ID=%d LIMIT 1", |
|
| 2950 | 2950 | array($post_id) |
| 2951 | 2951 | ) |
| 2952 | 2952 | , ARRAY_A); |
| 2953 | 2953 | |
| 2954 | 2954 | $arrImages = $wpdb->get_results( |
| 2955 | 2955 | $wpdb->prepare( |
| 2956 | - "SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE mime_type like %s AND post_id = %d ORDER BY menu_order ASC, ID DESC ", |
|
| 2956 | + "SELECT * FROM ".GEODIR_ATTACHMENT_TABLE." WHERE mime_type like %s AND post_id = %d ORDER BY menu_order ASC, ID DESC ", |
|
| 2957 | 2957 | array('%image%', $post_id)
|
| 2958 | 2958 | ) |
| 2959 | 2959 | ); |
| 2960 | 2960 | if ($arrImages) {
|
| 2961 | 2961 | $image_arr = array(); |
| 2962 | 2962 | foreach ($arrImages as $img) {
|
| 2963 | - $image_arr[] = $upload_dir['baseurl'] . $img->file; |
|
| 2963 | + $image_arr[] = $upload_dir['baseurl'].$img->file; |
|
| 2964 | 2964 | } |
| 2965 | 2965 | $comma_separated = implode(",", $image_arr);
|
| 2966 | 2966 | $post_arr[0]['post_images'] = $comma_separated; |
| 2967 | 2967 | } |
| 2968 | 2968 | |
| 2969 | 2969 | |
| 2970 | - $cats = $post_arr[0][$post_arr[0]['post_type'] . 'category']; |
|
| 2970 | + $cats = $post_arr[0][$post_arr[0]['post_type'].'category']; |
|
| 2971 | 2971 | $cat_arr = array_filter(explode(",", $cats));
|
| 2972 | 2972 | $trans_cat = array(); |
| 2973 | 2973 | foreach ($cat_arr as $cat) {
|
| 2974 | - $trans_cat[] = icl_object_id($cat, $post_arr[0]['post_type'] . 'category', false); |
|
| 2974 | + $trans_cat[] = icl_object_id($cat, $post_arr[0]['post_type'].'category', false); |
|
| 2975 | 2975 | } |
| 2976 | 2976 | |
| 2977 | 2977 | |
@@ -3013,7 +3013,7 @@ discard block |
||
| 3013 | 3013 | |
| 3014 | 3014 | $get_data = $wpdb->get_results( |
| 3015 | 3015 | $wpdb->prepare( |
| 3016 | - "SELECT htmlvar_name, field_type, extra_fields FROM " . GEODIR_CUSTOM_FIELDS_TABLE . " WHERE post_type=%s AND is_active='1'", |
|
| 3016 | + "SELECT htmlvar_name, field_type, extra_fields FROM ".GEODIR_CUSTOM_FIELDS_TABLE." WHERE post_type=%s AND is_active='1'", |
|
| 3017 | 3017 | array($listing_type) |
| 3018 | 3018 | ) |
| 3019 | 3019 | ); |
@@ -3026,12 +3026,12 @@ discard block |
||
| 3026 | 3026 | |
| 3027 | 3027 | $extra_fields = unserialize($data->extra_fields); |
| 3028 | 3028 | |
| 3029 | - $prefix = $data->htmlvar_name . '_'; |
|
| 3029 | + $prefix = $data->htmlvar_name.'_'; |
|
| 3030 | 3030 | |
| 3031 | - $fields_info[$prefix . 'address'] = $data->field_type; |
|
| 3031 | + $fields_info[$prefix.'address'] = $data->field_type; |
|
| 3032 | 3032 | |
| 3033 | 3033 | if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) |
| 3034 | - $fields_info[$prefix . 'zip'] = $data->field_type; |
|
| 3034 | + $fields_info[$prefix.'zip'] = $data->field_type; |
|
| 3035 | 3035 | |
| 3036 | 3036 | } else {
|
| 3037 | 3037 | |
@@ -3129,13 +3129,13 @@ discard block |
||
| 3129 | 3129 | * @since 1.4.9 |
| 3130 | 3130 | * @package GeoDirectory |
| 3131 | 3131 | */ |
| 3132 | -function geodir_fb_like_thumbnail(){
|
|
| 3132 | +function geodir_fb_like_thumbnail() {
|
|
| 3133 | 3133 | |
| 3134 | 3134 | // return if not a single post |
| 3135 | - if(!is_single()){return;}
|
|
| 3135 | + if (!is_single()) {return; }
|
|
| 3136 | 3136 | |
| 3137 | 3137 | global $post; |
| 3138 | - if(isset($post->featured_image) && $post->featured_image){
|
|
| 3138 | + if (isset($post->featured_image) && $post->featured_image) {
|
|
| 3139 | 3139 | $upload_dir = wp_upload_dir(); |
| 3140 | 3140 | $thumb = $upload_dir['baseurl'].$post->featured_image; |
| 3141 | 3141 | echo "\n\n<!-- GD Facebook Like Thumbnail -->\n<link rel=\"image_src\" href=\"$thumb\" />\n<!-- End GD Facebook Like Thumbnail -->\n\n"; |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | function geodir_add_column_if_not_exist($db, $column, $column_attr = "VARCHAR( 255 ) NOT NULL") |
| 50 | 50 | {
|
| 51 | 51 | global $wpdb; |
| 52 | - $result = 0;// no rows affected |
|
| 52 | + $result = 0; // no rows affected |
|
| 53 | 53 | if (!geodir_column_exist($db, $column)) {
|
| 54 | 54 | if (!empty($db) && !empty($column)) |
| 55 | 55 | $result = $wpdb->query("ALTER TABLE `$db` ADD `$column` $column_attr");
|
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | {
|
| 75 | 75 | global $wpdb, $geodir_post_custom_fields_cache; |
| 76 | 76 | |
| 77 | - $cache_stored = $post_type . '_' . $package_id . '_' . $default . '_' . $fields_location; |
|
| 77 | + $cache_stored = $post_type.'_'.$package_id.'_'.$default.'_'.$fields_location; |
|
| 78 | 78 | |
| 79 | 79 | if (array_key_exists($cache_stored, $geodir_post_custom_fields_cache)) {
|
| 80 | 80 | return $geodir_post_custom_fields_cache[$cache_stored]; |
@@ -88,14 +88,14 @@ discard block |
||
| 88 | 88 | $default_query .= " and is_admin = '0' "; |
| 89 | 89 | |
| 90 | 90 | if ($fields_location == 'none') {
|
| 91 | - } else{
|
|
| 92 | - $fields_location = esc_sql( $fields_location ); |
|
| 91 | + } else {
|
|
| 92 | + $fields_location = esc_sql($fields_location); |
|
| 93 | 93 | $default_query .= " and show_in LIKE '%%[$fields_location]%%' "; |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | $post_meta_info = $wpdb->get_results( |
| 97 | 97 | $wpdb->prepare( |
| 98 | - "select * from " . GEODIR_CUSTOM_FIELDS_TABLE . " where is_active = '1' and post_type = %s {$default_query} order by sort_order asc,admin_title asc",
|
|
| 98 | + "select * from ".GEODIR_CUSTOM_FIELDS_TABLE." where is_active = '1' and post_type = %s {$default_query} order by sort_order asc,admin_title asc",
|
|
| 99 | 99 | array($post_type) |
| 100 | 100 | ) |
| 101 | 101 | ); |
@@ -162,13 +162,13 @@ discard block |
||
| 162 | 162 | * @param string $field_ins_upd When set to "submit" displays form. |
| 163 | 163 | * @param string $field_type_key The key of the custom field. |
| 164 | 164 | */ |
| 165 | - function geodir_custom_field_adminhtml($field_type, $result_str, $field_ins_upd = '', $field_type_key ='') |
|
| 165 | + function geodir_custom_field_adminhtml($field_type, $result_str, $field_ins_upd = '', $field_type_key = '') |
|
| 166 | 166 | {
|
| 167 | 167 | global $wpdb; |
| 168 | 168 | $cf = $result_str; |
| 169 | 169 | if (!is_object($cf)) {
|
| 170 | 170 | |
| 171 | - $field_info = $wpdb->get_row($wpdb->prepare("select * from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id= %d", array($cf)));
|
|
| 171 | + $field_info = $wpdb->get_row($wpdb->prepare("select * from ".GEODIR_CUSTOM_FIELDS_TABLE." where id= %d", array($cf)));
|
|
| 172 | 172 | |
| 173 | 173 | } else {
|
| 174 | 174 | $field_info = $cf; |
@@ -202,14 +202,14 @@ discard block |
||
| 202 | 202 | if ($field_id != '') {
|
| 203 | 203 | $cf = trim($field_id, '_'); |
| 204 | 204 | |
| 205 | - if ($field = $wpdb->get_row($wpdb->prepare("select htmlvar_name,post_type,field_type from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id= %d", array($cf)))) {
|
|
| 206 | - $wpdb->query($wpdb->prepare("delete from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id= %d ", array($cf)));
|
|
| 205 | + if ($field = $wpdb->get_row($wpdb->prepare("select htmlvar_name,post_type,field_type from ".GEODIR_CUSTOM_FIELDS_TABLE." where id= %d", array($cf)))) {
|
|
| 206 | + $wpdb->query($wpdb->prepare("delete from ".GEODIR_CUSTOM_FIELDS_TABLE." where id= %d ", array($cf)));
|
|
| 207 | 207 | |
| 208 | 208 | $post_type = $field->post_type; |
| 209 | 209 | $htmlvar_name = $field->htmlvar_name; |
| 210 | 210 | |
| 211 | 211 | if ($post_type != '' && $htmlvar_name != '') {
|
| 212 | - $wpdb->query($wpdb->prepare("DELETE FROM " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " WHERE htmlvar_name=%s AND post_type=%s LIMIT 1", array($htmlvar_name, $post_type)));
|
|
| 212 | + $wpdb->query($wpdb->prepare("DELETE FROM ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." WHERE htmlvar_name=%s AND post_type=%s LIMIT 1", array($htmlvar_name, $post_type)));
|
|
| 213 | 213 | } |
| 214 | 214 | |
| 215 | 215 | /** |
@@ -223,18 +223,18 @@ discard block |
||
| 223 | 223 | do_action('geodir_after_custom_field_deleted', $cf, $field->htmlvar_name, $post_type);
|
| 224 | 224 | |
| 225 | 225 | if ($field->field_type == 'address') {
|
| 226 | - $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_address`");
|
|
| 227 | - $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_city`");
|
|
| 228 | - $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_region`");
|
|
| 229 | - $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_country`");
|
|
| 230 | - $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_zip`");
|
|
| 231 | - $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_latitude`");
|
|
| 232 | - $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_longitude`");
|
|
| 233 | - $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_mapview`");
|
|
| 234 | - $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_mapzoom`");
|
|
| 226 | + $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_address`");
|
|
| 227 | + $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_city`");
|
|
| 228 | + $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_region`");
|
|
| 229 | + $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_country`");
|
|
| 230 | + $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_zip`");
|
|
| 231 | + $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_latitude`");
|
|
| 232 | + $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_longitude`");
|
|
| 233 | + $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_mapview`");
|
|
| 234 | + $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_mapzoom`");
|
|
| 235 | 235 | } else {
|
| 236 | 236 | if ($field->field_type != 'fieldset') {
|
| 237 | - $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "`");
|
|
| 237 | + $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."`");
|
|
| 238 | 238 | } |
| 239 | 239 | } |
| 240 | 240 | |
@@ -305,7 +305,7 @@ discard block |
||
| 305 | 305 | $result_str = isset($request_field['field_id']) ? trim($request_field['field_id']) : ''; |
| 306 | 306 | |
| 307 | 307 | // some servers fail if a POST value is VARCHAR so we change it. |
| 308 | - if(isset($request_field['data_type']) && $request_field['data_type']=='XVARCHAR'){
|
|
| 308 | + if (isset($request_field['data_type']) && $request_field['data_type'] == 'XVARCHAR') {
|
|
| 309 | 309 | $request_field['data_type'] = 'VARCHAR'; |
| 310 | 310 | } |
| 311 | 311 | |
@@ -318,12 +318,12 @@ discard block |
||
| 318 | 318 | $post_type = $request_field['listing_type']; |
| 319 | 319 | |
| 320 | 320 | if ($request_field['field_type'] != 'address' && $request_field['field_type'] != 'taxonomy' && $request_field['field_type'] != 'fieldset') {
|
| 321 | - $cehhtmlvar_name = 'geodir_' . $cehhtmlvar_name; |
|
| 321 | + $cehhtmlvar_name = 'geodir_'.$cehhtmlvar_name; |
|
| 322 | 322 | } |
| 323 | 323 | |
| 324 | 324 | $check_html_variable = $wpdb->get_var( |
| 325 | 325 | $wpdb->prepare( |
| 326 | - "select htmlvar_name from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id <> %d and htmlvar_name = %s and post_type = %s ", |
|
| 326 | + "select htmlvar_name from ".GEODIR_CUSTOM_FIELDS_TABLE." where id <> %d and htmlvar_name = %s and post_type = %s ", |
|
| 327 | 327 | array($cf, $cehhtmlvar_name, $post_type) |
| 328 | 328 | ) |
| 329 | 329 | ); |
@@ -335,7 +335,7 @@ discard block |
||
| 335 | 335 | |
| 336 | 336 | $post_meta_info = $wpdb->get_row( |
| 337 | 337 | $wpdb->prepare( |
| 338 | - "select * from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id = %d", |
|
| 338 | + "select * from ".GEODIR_CUSTOM_FIELDS_TABLE." where id = %d", |
|
| 339 | 339 | array($cf) |
| 340 | 340 | ) |
| 341 | 341 | ); |
@@ -353,7 +353,7 @@ discard block |
||
| 353 | 353 | if ($post_type == '') $post_type = 'gd_place'; |
| 354 | 354 | |
| 355 | 355 | |
| 356 | - $detail_table = $plugin_prefix . $post_type . '_detail'; |
|
| 356 | + $detail_table = $plugin_prefix.$post_type.'_detail'; |
|
| 357 | 357 | |
| 358 | 358 | $admin_title = $request_field['admin_title']; |
| 359 | 359 | $site_title = $request_field['site_title']; |
@@ -381,12 +381,12 @@ discard block |
||
| 381 | 381 | $for_admin_use = isset($request_field['for_admin_use']) ? $request_field['for_admin_use'] : ''; |
| 382 | 382 | |
| 383 | 383 | |
| 384 | - if(is_array($show_in)){
|
|
| 384 | + if (is_array($show_in)) {
|
|
| 385 | 385 | $show_in = implode(",", $request_field['show_in']);
|
| 386 | 386 | } |
| 387 | 387 | |
| 388 | 388 | if ($field_type != 'address' && $field_type != 'taxonomy' && $field_type != 'fieldset') {
|
| 389 | - $htmlvar_name = 'geodir_' . $htmlvar_name; |
|
| 389 | + $htmlvar_name = 'geodir_'.$htmlvar_name; |
|
| 390 | 390 | } |
| 391 | 391 | |
| 392 | 392 | $option_values = ''; |
@@ -427,9 +427,9 @@ discard block |
||
| 427 | 427 | |
| 428 | 428 | if ($sort_order == '') {
|
| 429 | 429 | |
| 430 | - $last_order = $wpdb->get_var("SELECT MAX(sort_order) as last_order FROM " . GEODIR_CUSTOM_FIELDS_TABLE);
|
|
| 430 | + $last_order = $wpdb->get_var("SELECT MAX(sort_order) as last_order FROM ".GEODIR_CUSTOM_FIELDS_TABLE);
|
|
| 431 | 431 | |
| 432 | - $sort_order = (int)$last_order + 1; |
|
| 432 | + $sort_order = (int) $last_order + 1; |
|
| 433 | 433 | } |
| 434 | 434 | |
| 435 | 435 | $default_value_add = ''; |
@@ -441,15 +441,15 @@ discard block |
||
| 441 | 441 | case 'address': |
| 442 | 442 | |
| 443 | 443 | if ($htmlvar_name != '') {
|
| 444 | - $prefix = $htmlvar_name . '_'; |
|
| 444 | + $prefix = $htmlvar_name.'_'; |
|
| 445 | 445 | } |
| 446 | - $old_prefix = $old_html_variable . '_'; |
|
| 446 | + $old_prefix = $old_html_variable.'_'; |
|
| 447 | 447 | |
| 448 | 448 | |
| 449 | - $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "address` `" . $prefix . "address` VARCHAR( 254 ) NULL"; |
|
| 449 | + $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."address` `".$prefix."address` VARCHAR( 254 ) NULL"; |
|
| 450 | 450 | |
| 451 | 451 | if ($default_value != '') {
|
| 452 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 452 | + $meta_field_add .= " DEFAULT '".$default_value."'"; |
|
| 453 | 453 | } |
| 454 | 454 | |
| 455 | 455 | $wpdb->query($meta_field_add); |
@@ -458,12 +458,12 @@ discard block |
||
| 458 | 458 | |
| 459 | 459 | if (isset($extra_fields['show_city']) && $extra_fields['show_city']) {
|
| 460 | 460 | |
| 461 | - $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "city'");
|
|
| 461 | + $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."city'");
|
|
| 462 | 462 | if ($is_column) {
|
| 463 | - $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "city` `" . $prefix . "city` VARCHAR( 50 ) NULL"; |
|
| 463 | + $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."city` `".$prefix."city` VARCHAR( 50 ) NULL"; |
|
| 464 | 464 | |
| 465 | 465 | if ($default_value != '') {
|
| 466 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 466 | + $meta_field_add .= " DEFAULT '".$default_value."'"; |
|
| 467 | 467 | } |
| 468 | 468 | |
| 469 | 469 | $wpdb->query($meta_field_add); |
@@ -471,9 +471,9 @@ discard block |
||
| 471 | 471 | |
| 472 | 472 | $meta_field_add = "VARCHAR( 50 ) NULL"; |
| 473 | 473 | if ($default_value != '') {
|
| 474 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 474 | + $meta_field_add .= " DEFAULT '".$default_value."'"; |
|
| 475 | 475 | } |
| 476 | - geodir_add_column_if_not_exist($detail_table, $prefix . "city", $meta_field_add); |
|
| 476 | + geodir_add_column_if_not_exist($detail_table, $prefix."city", $meta_field_add); |
|
| 477 | 477 | |
| 478 | 478 | } |
| 479 | 479 | |
@@ -483,36 +483,36 @@ discard block |
||
| 483 | 483 | |
| 484 | 484 | if (isset($extra_fields['show_region']) && $extra_fields['show_region']) {
|
| 485 | 485 | |
| 486 | - $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "region'");
|
|
| 486 | + $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."region'");
|
|
| 487 | 487 | |
| 488 | 488 | if ($is_column) {
|
| 489 | - $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "region` `" . $prefix . "region` VARCHAR( 50 ) NULL"; |
|
| 489 | + $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."region` `".$prefix."region` VARCHAR( 50 ) NULL"; |
|
| 490 | 490 | |
| 491 | 491 | if ($default_value != '') {
|
| 492 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 492 | + $meta_field_add .= " DEFAULT '".$default_value."'"; |
|
| 493 | 493 | } |
| 494 | 494 | |
| 495 | 495 | $wpdb->query($meta_field_add); |
| 496 | 496 | } else {
|
| 497 | 497 | $meta_field_add = "VARCHAR( 50 ) NULL"; |
| 498 | 498 | if ($default_value != '') {
|
| 499 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 499 | + $meta_field_add .= " DEFAULT '".$default_value."'"; |
|
| 500 | 500 | } |
| 501 | 501 | |
| 502 | - geodir_add_column_if_not_exist($detail_table, $prefix . "region", $meta_field_add); |
|
| 502 | + geodir_add_column_if_not_exist($detail_table, $prefix."region", $meta_field_add); |
|
| 503 | 503 | } |
| 504 | 504 | |
| 505 | 505 | } |
| 506 | 506 | if (isset($extra_fields['show_country']) && $extra_fields['show_country']) {
|
| 507 | 507 | |
| 508 | - $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "country'");
|
|
| 508 | + $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."country'");
|
|
| 509 | 509 | |
| 510 | 510 | if ($is_column) {
|
| 511 | 511 | |
| 512 | - $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "country` `" . $prefix . "country` VARCHAR( 50 ) NULL"; |
|
| 512 | + $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."country` `".$prefix."country` VARCHAR( 50 ) NULL"; |
|
| 513 | 513 | |
| 514 | 514 | if ($default_value != '') {
|
| 515 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 515 | + $meta_field_add .= " DEFAULT '".$default_value."'"; |
|
| 516 | 516 | } |
| 517 | 517 | |
| 518 | 518 | $wpdb->query($meta_field_add); |
@@ -520,24 +520,24 @@ discard block |
||
| 520 | 520 | |
| 521 | 521 | $meta_field_add = "VARCHAR( 50 ) NULL"; |
| 522 | 522 | if ($default_value != '') {
|
| 523 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 523 | + $meta_field_add .= " DEFAULT '".$default_value."'"; |
|
| 524 | 524 | } |
| 525 | 525 | |
| 526 | - geodir_add_column_if_not_exist($detail_table, $prefix . "country", $meta_field_add); |
|
| 526 | + geodir_add_column_if_not_exist($detail_table, $prefix."country", $meta_field_add); |
|
| 527 | 527 | |
| 528 | 528 | } |
| 529 | 529 | |
| 530 | 530 | } |
| 531 | 531 | if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) {
|
| 532 | 532 | |
| 533 | - $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "zip'");
|
|
| 533 | + $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."zip'");
|
|
| 534 | 534 | |
| 535 | 535 | if ($is_column) {
|
| 536 | 536 | |
| 537 | - $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "zip` `" . $prefix . "zip` VARCHAR( 50 ) NULL"; |
|
| 537 | + $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."zip` `".$prefix."zip` VARCHAR( 50 ) NULL"; |
|
| 538 | 538 | |
| 539 | 539 | if ($default_value != '') {
|
| 540 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 540 | + $meta_field_add .= " DEFAULT '".$default_value."'"; |
|
| 541 | 541 | } |
| 542 | 542 | |
| 543 | 543 | $wpdb->query($meta_field_add); |
@@ -545,128 +545,128 @@ discard block |
||
| 545 | 545 | |
| 546 | 546 | $meta_field_add = "VARCHAR( 50 ) NULL"; |
| 547 | 547 | if ($default_value != '') {
|
| 548 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 548 | + $meta_field_add .= " DEFAULT '".$default_value."'"; |
|
| 549 | 549 | } |
| 550 | 550 | |
| 551 | - geodir_add_column_if_not_exist($detail_table, $prefix . "zip", $meta_field_add); |
|
| 551 | + geodir_add_column_if_not_exist($detail_table, $prefix."zip", $meta_field_add); |
|
| 552 | 552 | |
| 553 | 553 | } |
| 554 | 554 | |
| 555 | 555 | } |
| 556 | 556 | if (isset($extra_fields['show_map']) && $extra_fields['show_map']) {
|
| 557 | 557 | |
| 558 | - $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "latitude'");
|
|
| 558 | + $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."latitude'");
|
|
| 559 | 559 | if ($is_column) {
|
| 560 | 560 | |
| 561 | - $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "latitude` `" . $prefix . "latitude` VARCHAR( 20 ) NULL"; |
|
| 561 | + $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."latitude` `".$prefix."latitude` VARCHAR( 20 ) NULL"; |
|
| 562 | 562 | |
| 563 | 563 | if ($default_value != '') {
|
| 564 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 564 | + $meta_field_add .= " DEFAULT '".$default_value."'"; |
|
| 565 | 565 | } |
| 566 | 566 | |
| 567 | 567 | $wpdb->query($meta_field_add); |
| 568 | 568 | } else {
|
| 569 | 569 | |
| 570 | - $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "latitude` VARCHAR( 20 ) NULL"; |
|
| 570 | + $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."latitude` VARCHAR( 20 ) NULL"; |
|
| 571 | 571 | $meta_field_add = "VARCHAR( 20 ) NULL"; |
| 572 | 572 | if ($default_value != '') {
|
| 573 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 573 | + $meta_field_add .= " DEFAULT '".$default_value."'"; |
|
| 574 | 574 | } |
| 575 | 575 | |
| 576 | - geodir_add_column_if_not_exist($detail_table, $prefix . "latitude", $meta_field_add); |
|
| 576 | + geodir_add_column_if_not_exist($detail_table, $prefix."latitude", $meta_field_add); |
|
| 577 | 577 | |
| 578 | 578 | } |
| 579 | 579 | |
| 580 | 580 | |
| 581 | - $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "longitude'");
|
|
| 581 | + $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."longitude'");
|
|
| 582 | 582 | |
| 583 | 583 | if ($is_column) {
|
| 584 | - $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "longitude` `" . $prefix . "longitude` VARCHAR( 20 ) NULL"; |
|
| 584 | + $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."longitude` `".$prefix."longitude` VARCHAR( 20 ) NULL"; |
|
| 585 | 585 | |
| 586 | 586 | if ($default_value != '') {
|
| 587 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 587 | + $meta_field_add .= " DEFAULT '".$default_value."'"; |
|
| 588 | 588 | } |
| 589 | 589 | |
| 590 | 590 | $wpdb->query($meta_field_add); |
| 591 | 591 | } else {
|
| 592 | 592 | |
| 593 | - $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "longitude` VARCHAR( 20 ) NULL"; |
|
| 593 | + $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."longitude` VARCHAR( 20 ) NULL"; |
|
| 594 | 594 | $meta_field_add = "VARCHAR( 20 ) NULL"; |
| 595 | 595 | if ($default_value != '') {
|
| 596 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 596 | + $meta_field_add .= " DEFAULT '".$default_value."'"; |
|
| 597 | 597 | } |
| 598 | 598 | |
| 599 | - geodir_add_column_if_not_exist($detail_table, $prefix . "longitude", $meta_field_add); |
|
| 599 | + geodir_add_column_if_not_exist($detail_table, $prefix."longitude", $meta_field_add); |
|
| 600 | 600 | } |
| 601 | 601 | |
| 602 | 602 | } |
| 603 | 603 | if (isset($extra_fields['show_mapview']) && $extra_fields['show_mapview']) {
|
| 604 | 604 | |
| 605 | - $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "mapview'");
|
|
| 605 | + $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."mapview'");
|
|
| 606 | 606 | |
| 607 | 607 | if ($is_column) {
|
| 608 | - $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "mapview` `" . $prefix . "mapview` VARCHAR( 15 ) NULL"; |
|
| 608 | + $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."mapview` `".$prefix."mapview` VARCHAR( 15 ) NULL"; |
|
| 609 | 609 | |
| 610 | 610 | if ($default_value != '') {
|
| 611 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 611 | + $meta_field_add .= " DEFAULT '".$default_value."'"; |
|
| 612 | 612 | } |
| 613 | 613 | |
| 614 | 614 | $wpdb->query($meta_field_add); |
| 615 | 615 | } else {
|
| 616 | 616 | |
| 617 | - $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "mapview` VARCHAR( 15 ) NULL"; |
|
| 617 | + $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."mapview` VARCHAR( 15 ) NULL"; |
|
| 618 | 618 | |
| 619 | 619 | $meta_field_add = "VARCHAR( 15 ) NULL"; |
| 620 | 620 | if ($default_value != '') {
|
| 621 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 621 | + $meta_field_add .= " DEFAULT '".$default_value."'"; |
|
| 622 | 622 | } |
| 623 | 623 | |
| 624 | - geodir_add_column_if_not_exist($detail_table, $prefix . "mapview", $meta_field_add); |
|
| 624 | + geodir_add_column_if_not_exist($detail_table, $prefix."mapview", $meta_field_add); |
|
| 625 | 625 | } |
| 626 | 626 | |
| 627 | 627 | |
| 628 | 628 | } |
| 629 | 629 | if (isset($extra_fields['show_mapzoom']) && $extra_fields['show_mapzoom']) {
|
| 630 | 630 | |
| 631 | - $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "mapzoom'");
|
|
| 631 | + $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."mapzoom'");
|
|
| 632 | 632 | if ($is_column) {
|
| 633 | - $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "mapzoom` `" . $prefix . "mapzoom` VARCHAR( 3 ) NULL"; |
|
| 633 | + $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."mapzoom` `".$prefix."mapzoom` VARCHAR( 3 ) NULL"; |
|
| 634 | 634 | |
| 635 | 635 | if ($default_value != '') {
|
| 636 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 636 | + $meta_field_add .= " DEFAULT '".$default_value."'"; |
|
| 637 | 637 | } |
| 638 | 638 | |
| 639 | 639 | $wpdb->query($meta_field_add); |
| 640 | 640 | |
| 641 | 641 | } else {
|
| 642 | 642 | |
| 643 | - $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "mapzoom` VARCHAR( 3 ) NULL"; |
|
| 643 | + $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."mapzoom` VARCHAR( 3 ) NULL"; |
|
| 644 | 644 | |
| 645 | 645 | $meta_field_add = "VARCHAR( 3 ) NULL"; |
| 646 | 646 | if ($default_value != '') {
|
| 647 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 647 | + $meta_field_add .= " DEFAULT '".$default_value."'"; |
|
| 648 | 648 | } |
| 649 | 649 | |
| 650 | - geodir_add_column_if_not_exist($detail_table, $prefix . "mapzoom", $meta_field_add); |
|
| 650 | + geodir_add_column_if_not_exist($detail_table, $prefix."mapzoom", $meta_field_add); |
|
| 651 | 651 | } |
| 652 | 652 | |
| 653 | 653 | } |
| 654 | 654 | // show lat lng |
| 655 | 655 | if (isset($extra_fields['show_latlng']) && $extra_fields['show_latlng']) {
|
| 656 | - $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "latlng'");
|
|
| 656 | + $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."latlng'");
|
|
| 657 | 657 | |
| 658 | 658 | if ($is_column) {
|
| 659 | - $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "latlng` `" . $prefix . "latlng` VARCHAR( 3 ) NULL"; |
|
| 659 | + $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."latlng` `".$prefix."latlng` VARCHAR( 3 ) NULL"; |
|
| 660 | 660 | $meta_field_add .= " DEFAULT '1'"; |
| 661 | 661 | |
| 662 | 662 | $wpdb->query($meta_field_add); |
| 663 | 663 | } else {
|
| 664 | - $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "latlng` VARCHAR( 3 ) NULL"; |
|
| 664 | + $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."latlng` VARCHAR( 3 ) NULL"; |
|
| 665 | 665 | |
| 666 | 666 | $meta_field_add = "VARCHAR( 3 ) NULL"; |
| 667 | 667 | $meta_field_add .= " DEFAULT '1'"; |
| 668 | 668 | |
| 669 | - geodir_add_column_if_not_exist($detail_table, $prefix . "latlng", $meta_field_add); |
|
| 669 | + geodir_add_column_if_not_exist($detail_table, $prefix."latlng", $meta_field_add); |
|
| 670 | 670 | } |
| 671 | 671 | |
| 672 | 672 | } |
@@ -682,30 +682,30 @@ discard block |
||
| 682 | 682 | $op_size = '500'; |
| 683 | 683 | |
| 684 | 684 | // only make the field as big as it needs to be. |
| 685 | - if(isset($option_values) && $option_values && $field_type=='select'){
|
|
| 686 | - $option_values_arr = explode(',',$option_values);
|
|
| 687 | - if(is_array($option_values_arr)){
|
|
| 685 | + if (isset($option_values) && $option_values && $field_type == 'select') {
|
|
| 686 | + $option_values_arr = explode(',', $option_values);
|
|
| 687 | + if (is_array($option_values_arr)) {
|
|
| 688 | 688 | $op_max = 0; |
| 689 | - foreach($option_values_arr as $op_val){
|
|
| 690 | - if(strlen($op_val) && strlen($op_val)>$op_max){$op_max = strlen($op_val);}
|
|
| 689 | + foreach ($option_values_arr as $op_val) {
|
|
| 690 | + if (strlen($op_val) && strlen($op_val) > $op_max) {$op_max = strlen($op_val); }
|
|
| 691 | 691 | } |
| 692 | - if($op_max){$op_size =$op_max; }
|
|
| 692 | + if ($op_max) {$op_size = $op_max; }
|
|
| 693 | 693 | } |
| 694 | - }elseif(isset($option_values) && $option_values && $field_type=='multiselect'){
|
|
| 695 | - if(strlen($option_values)){
|
|
| 696 | - $op_size = strlen($option_values); |
|
| 694 | + }elseif (isset($option_values) && $option_values && $field_type == 'multiselect') {
|
|
| 695 | + if (strlen($option_values)) {
|
|
| 696 | + $op_size = strlen($option_values); |
|
| 697 | 697 | } |
| 698 | 698 | } |
| 699 | 699 | |
| 700 | - $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "`VARCHAR( $op_size ) NULL"; |
|
| 700 | + $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_html_variable."` `".$htmlvar_name."`VARCHAR( $op_size ) NULL"; |
|
| 701 | 701 | |
| 702 | 702 | if ($default_value != '') {
|
| 703 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 703 | + $meta_field_add .= " DEFAULT '".$default_value."'"; |
|
| 704 | 704 | } |
| 705 | 705 | |
| 706 | 706 | $alter_result = $wpdb->query($meta_field_add); |
| 707 | - if($alter_result===false){
|
|
| 708 | - return __('Column change failed, you may have too many columns.','geodirectory');
|
|
| 707 | + if ($alter_result === false) {
|
|
| 708 | + return __('Column change failed, you may have too many columns.', 'geodirectory');
|
|
| 709 | 709 | } |
| 710 | 710 | |
| 711 | 711 | if (isset($request_field['cat_display_type'])) |
@@ -722,9 +722,9 @@ discard block |
||
| 722 | 722 | case 'url': |
| 723 | 723 | case 'file': |
| 724 | 724 | |
| 725 | - $alter_result = $wpdb->query("ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "` TEXT NULL");
|
|
| 726 | - if($alter_result===false){
|
|
| 727 | - return __('Column change failed, you may have too many columns.','geodirectory');
|
|
| 725 | + $alter_result = $wpdb->query("ALTER TABLE ".$detail_table." CHANGE `".$old_html_variable."` `".$htmlvar_name."` TEXT NULL");
|
|
| 726 | + if ($alter_result === false) {
|
|
| 727 | + return __('Column change failed, you may have too many columns.', 'geodirectory');
|
|
| 728 | 728 | } |
| 729 | 729 | if (isset($request_field['advanced_editor'])) |
| 730 | 730 | $extra_fields = $request_field['advanced_editor']; |
@@ -738,24 +738,24 @@ discard block |
||
| 738 | 738 | default: |
| 739 | 739 | if ($data_type != 'VARCHAR' && $data_type != '') {
|
| 740 | 740 | if ($data_type == 'FLOAT' && $decimal_point > 0) {
|
| 741 | - $default_value_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "` DECIMAL(11, " . (int)$decimal_point . ") NULL"; |
|
| 741 | + $default_value_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_html_variable."` `".$htmlvar_name."` DECIMAL(11, ".(int) $decimal_point.") NULL"; |
|
| 742 | 742 | } else {
|
| 743 | - $default_value_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "` " . $data_type . " NULL"; |
|
| 743 | + $default_value_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_html_variable."` `".$htmlvar_name."` ".$data_type." NULL"; |
|
| 744 | 744 | } |
| 745 | 745 | |
| 746 | 746 | if (is_numeric($default_value) && $default_value != '') {
|
| 747 | - $default_value_add .= " DEFAULT '" . $default_value . "'"; |
|
| 747 | + $default_value_add .= " DEFAULT '".$default_value."'"; |
|
| 748 | 748 | } |
| 749 | 749 | } else {
|
| 750 | - $default_value_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "` VARCHAR( 254 ) NULL"; |
|
| 750 | + $default_value_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_html_variable."` `".$htmlvar_name."` VARCHAR( 254 ) NULL"; |
|
| 751 | 751 | if ($default_value != '') {
|
| 752 | - $default_value_add .= " DEFAULT '" . $default_value . "'"; |
|
| 752 | + $default_value_add .= " DEFAULT '".$default_value."'"; |
|
| 753 | 753 | } |
| 754 | 754 | } |
| 755 | 755 | |
| 756 | 756 | $alter_result = $wpdb->query($default_value_add); |
| 757 | - if($alter_result===false){
|
|
| 758 | - return __('Column change failed, you may have too many columns.','geodirectory');
|
|
| 757 | + if ($alter_result === false) {
|
|
| 758 | + return __('Column change failed, you may have too many columns.', 'geodirectory');
|
|
| 759 | 759 | } |
| 760 | 760 | break; |
| 761 | 761 | endswitch; |
@@ -771,7 +771,7 @@ discard block |
||
| 771 | 771 | |
| 772 | 772 | $wpdb->prepare( |
| 773 | 773 | |
| 774 | - "update " . GEODIR_CUSTOM_FIELDS_TABLE . " set |
|
| 774 | + "update ".GEODIR_CUSTOM_FIELDS_TABLE." set |
|
| 775 | 775 | post_type = %s, |
| 776 | 776 | admin_title = %s, |
| 777 | 777 | site_title = %s, |
@@ -805,7 +805,7 @@ discard block |
||
| 805 | 805 | for_admin_use = %s |
| 806 | 806 | where id = %d", |
| 807 | 807 | |
| 808 | - array($post_type, $admin_title, $site_title, $field_type, $field_type_key, $htmlvar_name, $admin_desc, $clabels, $default_value, $sort_order, $is_active, $is_default, $is_required, $required_msg, $css_class, $field_icon, $field_icon, $show_on_listing, $show_in, $show_on_detail, $show_as_tab, $option_values, $price_pkg, $cat_sort, $cat_filter, $data_type, $extra_field_query, $decimal_point,$validation_pattern,$validation_msg, $for_admin_use, $cf) |
|
| 808 | + array($post_type, $admin_title, $site_title, $field_type, $field_type_key, $htmlvar_name, $admin_desc, $clabels, $default_value, $sort_order, $is_active, $is_default, $is_required, $required_msg, $css_class, $field_icon, $field_icon, $show_on_listing, $show_in, $show_on_detail, $show_as_tab, $option_values, $price_pkg, $cat_sort, $cat_filter, $data_type, $extra_field_query, $decimal_point, $validation_pattern, $validation_msg, $for_admin_use, $cf) |
|
| 809 | 809 | ) |
| 810 | 810 | |
| 811 | 811 | ); |
@@ -815,7 +815,7 @@ discard block |
||
| 815 | 815 | |
| 816 | 816 | $wpdb->query( |
| 817 | 817 | $wpdb->prepare( |
| 818 | - "update " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set |
|
| 818 | + "update ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." set |
|
| 819 | 819 | site_title=%s |
| 820 | 820 | where post_type = %s and htmlvar_name = %s", |
| 821 | 821 | array($site_title, $post_type, $htmlvar_name) |
@@ -824,7 +824,7 @@ discard block |
||
| 824 | 824 | |
| 825 | 825 | |
| 826 | 826 | if ($cat_sort == '') |
| 827 | - $wpdb->query($wpdb->prepare("delete from " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " where post_type = %s and htmlvar_name = %s", array($post_type, $htmlvar_name)));
|
|
| 827 | + $wpdb->query($wpdb->prepare("delete from ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." where post_type = %s and htmlvar_name = %s", array($post_type, $htmlvar_name)));
|
|
| 828 | 828 | |
| 829 | 829 | |
| 830 | 830 | /** |
@@ -844,7 +844,7 @@ discard block |
||
| 844 | 844 | $data_type = ''; |
| 845 | 845 | |
| 846 | 846 | if ($htmlvar_name != '') {
|
| 847 | - $prefix = $htmlvar_name . '_'; |
|
| 847 | + $prefix = $htmlvar_name.'_'; |
|
| 848 | 848 | } |
| 849 | 849 | $old_prefix = $old_html_variable; |
| 850 | 850 | |
@@ -852,109 +852,109 @@ discard block |
||
| 852 | 852 | |
| 853 | 853 | $meta_field_add = "VARCHAR( 254 ) NULL"; |
| 854 | 854 | if ($default_value != '') {
|
| 855 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 855 | + $meta_field_add .= " DEFAULT '".$default_value."'"; |
|
| 856 | 856 | } |
| 857 | 857 | |
| 858 | - geodir_add_column_if_not_exist($detail_table, $prefix . "address", $meta_field_add); |
|
| 858 | + geodir_add_column_if_not_exist($detail_table, $prefix."address", $meta_field_add); |
|
| 859 | 859 | //$wpdb->query($meta_field_add); |
| 860 | 860 | |
| 861 | 861 | |
| 862 | 862 | if (!empty($extra_fields)) {
|
| 863 | 863 | |
| 864 | 864 | if (isset($extra_fields['show_city']) && $extra_fields['show_city']) {
|
| 865 | - $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "city` VARCHAR( 30 ) NULL"; |
|
| 865 | + $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."city` VARCHAR( 30 ) NULL"; |
|
| 866 | 866 | $meta_field_add = "VARCHAR( 30 ) NULL"; |
| 867 | 867 | if ($default_value != '') {
|
| 868 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 868 | + $meta_field_add .= " DEFAULT '".$default_value."'"; |
|
| 869 | 869 | } |
| 870 | 870 | |
| 871 | - geodir_add_column_if_not_exist($detail_table, $prefix . "city", $meta_field_add); |
|
| 871 | + geodir_add_column_if_not_exist($detail_table, $prefix."city", $meta_field_add); |
|
| 872 | 872 | //$wpdb->query($meta_field_add); |
| 873 | 873 | } |
| 874 | 874 | if (isset($extra_fields['show_region']) && $extra_fields['show_region']) {
|
| 875 | - $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "region` VARCHAR( 30 ) NULL"; |
|
| 875 | + $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."region` VARCHAR( 30 ) NULL"; |
|
| 876 | 876 | $meta_field_add = "VARCHAR( 30 ) NULL"; |
| 877 | 877 | if ($default_value != '') {
|
| 878 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 878 | + $meta_field_add .= " DEFAULT '".$default_value."'"; |
|
| 879 | 879 | } |
| 880 | 880 | |
| 881 | - geodir_add_column_if_not_exist($detail_table, $prefix . "region", $meta_field_add); |
|
| 881 | + geodir_add_column_if_not_exist($detail_table, $prefix."region", $meta_field_add); |
|
| 882 | 882 | //$wpdb->query($meta_field_add); |
| 883 | 883 | } |
| 884 | 884 | if (isset($extra_fields['show_country']) && $extra_fields['show_country']) {
|
| 885 | - $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "country` VARCHAR( 30 ) NULL"; |
|
| 885 | + $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."country` VARCHAR( 30 ) NULL"; |
|
| 886 | 886 | |
| 887 | 887 | $meta_field_add = "VARCHAR( 30 ) NULL"; |
| 888 | 888 | if ($default_value != '') {
|
| 889 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 889 | + $meta_field_add .= " DEFAULT '".$default_value."'"; |
|
| 890 | 890 | } |
| 891 | 891 | |
| 892 | - geodir_add_column_if_not_exist($detail_table, $prefix . "country", $meta_field_add); |
|
| 892 | + geodir_add_column_if_not_exist($detail_table, $prefix."country", $meta_field_add); |
|
| 893 | 893 | //$wpdb->query($meta_field_add); |
| 894 | 894 | } |
| 895 | 895 | if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) {
|
| 896 | - $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "zip` VARCHAR( 15 ) NULL"; |
|
| 896 | + $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."zip` VARCHAR( 15 ) NULL"; |
|
| 897 | 897 | $meta_field_add = "VARCHAR( 15 ) NULL"; |
| 898 | 898 | if ($default_value != '') {
|
| 899 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 899 | + $meta_field_add .= " DEFAULT '".$default_value."'"; |
|
| 900 | 900 | } |
| 901 | 901 | |
| 902 | - geodir_add_column_if_not_exist($detail_table, $prefix . "zip", $meta_field_add); |
|
| 902 | + geodir_add_column_if_not_exist($detail_table, $prefix."zip", $meta_field_add); |
|
| 903 | 903 | //$wpdb->query($meta_field_add); |
| 904 | 904 | } |
| 905 | 905 | if (isset($extra_fields['show_map']) && $extra_fields['show_map']) {
|
| 906 | - $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "latitude` VARCHAR( 20 ) NULL"; |
|
| 906 | + $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."latitude` VARCHAR( 20 ) NULL"; |
|
| 907 | 907 | $meta_field_add = "VARCHAR( 20 ) NULL"; |
| 908 | 908 | if ($default_value != '') {
|
| 909 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 909 | + $meta_field_add .= " DEFAULT '".$default_value."'"; |
|
| 910 | 910 | } |
| 911 | 911 | |
| 912 | - geodir_add_column_if_not_exist($detail_table, $prefix . "latitude", $meta_field_add); |
|
| 912 | + geodir_add_column_if_not_exist($detail_table, $prefix."latitude", $meta_field_add); |
|
| 913 | 913 | //$wpdb->query($meta_field_add); |
| 914 | 914 | |
| 915 | - $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "longitude` VARCHAR( 20 ) NULL"; |
|
| 915 | + $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."longitude` VARCHAR( 20 ) NULL"; |
|
| 916 | 916 | |
| 917 | 917 | $meta_field_add = "VARCHAR( 20 ) NULL"; |
| 918 | 918 | if ($default_value != '') {
|
| 919 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 919 | + $meta_field_add .= " DEFAULT '".$default_value."'"; |
|
| 920 | 920 | } |
| 921 | 921 | |
| 922 | - geodir_add_column_if_not_exist($detail_table, $prefix . "longitude", $meta_field_add); |
|
| 922 | + geodir_add_column_if_not_exist($detail_table, $prefix."longitude", $meta_field_add); |
|
| 923 | 923 | |
| 924 | 924 | //$wpdb->query($meta_field_add); |
| 925 | 925 | } |
| 926 | 926 | if (isset($extra_fields['show_mapview']) && $extra_fields['show_mapview']) {
|
| 927 | - $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "mapview` VARCHAR( 15 ) NULL"; |
|
| 927 | + $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."mapview` VARCHAR( 15 ) NULL"; |
|
| 928 | 928 | |
| 929 | 929 | $meta_field_add = "VARCHAR( 15 ) NULL"; |
| 930 | 930 | if ($default_value != '') {
|
| 931 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 931 | + $meta_field_add .= " DEFAULT '".$default_value."'"; |
|
| 932 | 932 | } |
| 933 | 933 | |
| 934 | - geodir_add_column_if_not_exist($detail_table, $prefix . "mapview", $meta_field_add); |
|
| 934 | + geodir_add_column_if_not_exist($detail_table, $prefix."mapview", $meta_field_add); |
|
| 935 | 935 | |
| 936 | 936 | //$wpdb->query($meta_field_add); |
| 937 | 937 | } |
| 938 | 938 | if (isset($extra_fields['show_mapzoom']) && $extra_fields['show_mapzoom']) {
|
| 939 | - $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "mapzoom` VARCHAR( 3 ) NULL"; |
|
| 939 | + $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."mapzoom` VARCHAR( 3 ) NULL"; |
|
| 940 | 940 | |
| 941 | 941 | $meta_field_add = "VARCHAR( 3 ) NULL"; |
| 942 | 942 | if ($default_value != '') {
|
| 943 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 943 | + $meta_field_add .= " DEFAULT '".$default_value."'"; |
|
| 944 | 944 | } |
| 945 | 945 | |
| 946 | - geodir_add_column_if_not_exist($detail_table, $prefix . "mapzoom", $meta_field_add); |
|
| 946 | + geodir_add_column_if_not_exist($detail_table, $prefix."mapzoom", $meta_field_add); |
|
| 947 | 947 | |
| 948 | 948 | //$wpdb->query($meta_field_add); |
| 949 | 949 | } |
| 950 | 950 | // show lat lng |
| 951 | 951 | if (isset($extra_fields['show_latlng']) && $extra_fields['show_latlng']) {
|
| 952 | - $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "latlng` VARCHAR( 3 ) NULL"; |
|
| 952 | + $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."latlng` VARCHAR( 3 ) NULL"; |
|
| 953 | 953 | |
| 954 | 954 | $meta_field_add = "VARCHAR( 3 ) NULL"; |
| 955 | 955 | $meta_field_add .= " DEFAULT '1'"; |
| 956 | 956 | |
| 957 | - geodir_add_column_if_not_exist($detail_table, $prefix . "latlng", $meta_field_add); |
|
| 957 | + geodir_add_column_if_not_exist($detail_table, $prefix."latlng", $meta_field_add); |
|
| 958 | 958 | //$wpdb->query($meta_field_add); |
| 959 | 959 | } |
| 960 | 960 | } |
@@ -964,8 +964,8 @@ discard block |
||
| 964 | 964 | case 'checkbox': |
| 965 | 965 | $data_type = 'TINYINT'; |
| 966 | 966 | |
| 967 | - $meta_field_add = $data_type . "( 1 ) NOT NULL "; |
|
| 968 | - if ((int)$default_value === 1) {
|
|
| 967 | + $meta_field_add = $data_type."( 1 ) NOT NULL "; |
|
| 968 | + if ((int) $default_value === 1) {
|
|
| 969 | 969 | $meta_field_add .= " DEFAULT '1'"; |
| 970 | 970 | } |
| 971 | 971 | |
@@ -998,7 +998,7 @@ discard block |
||
| 998 | 998 | } |
| 999 | 999 | } elseif (isset($option_values) && $option_values && $field_type == 'multiselect') {
|
| 1000 | 1000 | if (strlen($option_values)) {
|
| 1001 | - $op_size = strlen($option_values); |
|
| 1001 | + $op_size = strlen($option_values); |
|
| 1002 | 1002 | } |
| 1003 | 1003 | |
| 1004 | 1004 | if (isset($request_field['multi_display_type'])) {
|
@@ -1006,9 +1006,9 @@ discard block |
||
| 1006 | 1006 | } |
| 1007 | 1007 | } |
| 1008 | 1008 | |
| 1009 | - $meta_field_add = $data_type . "( $op_size ) NULL "; |
|
| 1009 | + $meta_field_add = $data_type."( $op_size ) NULL "; |
|
| 1010 | 1010 | if ($default_value != '') {
|
| 1011 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 1011 | + $meta_field_add .= " DEFAULT '".$default_value."'"; |
|
| 1012 | 1012 | } |
| 1013 | 1013 | |
| 1014 | 1014 | $add_result = geodir_add_column_if_not_exist($detail_table, $htmlvar_name, $meta_field_add); |
@@ -1023,9 +1023,9 @@ discard block |
||
| 1023 | 1023 | |
| 1024 | 1024 | $data_type = 'TEXT'; |
| 1025 | 1025 | |
| 1026 | - $default_value_add = " `" . $htmlvar_name . "` " . $data_type . " NULL "; |
|
| 1026 | + $default_value_add = " `".$htmlvar_name."` ".$data_type." NULL "; |
|
| 1027 | 1027 | |
| 1028 | - $meta_field_add = $data_type . " NULL "; |
|
| 1028 | + $meta_field_add = $data_type." NULL "; |
|
| 1029 | 1029 | /*if($default_value != '') |
| 1030 | 1030 | { $meta_field_add .= " DEFAULT '".$default_value."'"; }*/
|
| 1031 | 1031 | |
@@ -1040,9 +1040,9 @@ discard block |
||
| 1040 | 1040 | |
| 1041 | 1041 | $data_type = 'DATE'; |
| 1042 | 1042 | |
| 1043 | - $default_value_add = " `" . $htmlvar_name . "` " . $data_type . " NULL "; |
|
| 1043 | + $default_value_add = " `".$htmlvar_name."` ".$data_type." NULL "; |
|
| 1044 | 1044 | |
| 1045 | - $meta_field_add = $data_type . " NULL "; |
|
| 1045 | + $meta_field_add = $data_type." NULL "; |
|
| 1046 | 1046 | |
| 1047 | 1047 | $add_result = geodir_add_column_if_not_exist($detail_table, $htmlvar_name, $meta_field_add); |
| 1048 | 1048 | if ($add_result === false) {
|
@@ -1055,9 +1055,9 @@ discard block |
||
| 1055 | 1055 | |
| 1056 | 1056 | $data_type = 'TIME'; |
| 1057 | 1057 | |
| 1058 | - $default_value_add = " `" . $htmlvar_name . "` " . $data_type . " NULL "; |
|
| 1058 | + $default_value_add = " `".$htmlvar_name."` ".$data_type." NULL "; |
|
| 1059 | 1059 | |
| 1060 | - $meta_field_add = $data_type . " NULL "; |
|
| 1060 | + $meta_field_add = $data_type." NULL "; |
|
| 1061 | 1061 | |
| 1062 | 1062 | $add_result = geodir_add_column_if_not_exist($detail_table, $htmlvar_name, $meta_field_add); |
| 1063 | 1063 | if ($add_result === false) {
|
@@ -1069,22 +1069,22 @@ discard block |
||
| 1069 | 1069 | default: |
| 1070 | 1070 | |
| 1071 | 1071 | if ($data_type != 'VARCHAR' && $data_type != '') {
|
| 1072 | - $meta_field_add = $data_type . " NULL "; |
|
| 1072 | + $meta_field_add = $data_type." NULL "; |
|
| 1073 | 1073 | |
| 1074 | 1074 | if ($data_type == 'FLOAT' && $decimal_point > 0) {
|
| 1075 | - $meta_field_add = "DECIMAL(11, " . (int)$decimal_point . ") NULL "; |
|
| 1075 | + $meta_field_add = "DECIMAL(11, ".(int) $decimal_point.") NULL "; |
|
| 1076 | 1076 | } |
| 1077 | 1077 | |
| 1078 | 1078 | if (is_numeric($default_value) && $default_value != '') {
|
| 1079 | - $default_value_add .= " DEFAULT '" . $default_value . "'"; |
|
| 1080 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 1079 | + $default_value_add .= " DEFAULT '".$default_value."'"; |
|
| 1080 | + $meta_field_add .= " DEFAULT '".$default_value."'"; |
|
| 1081 | 1081 | } |
| 1082 | 1082 | } else {
|
| 1083 | 1083 | $meta_field_add = " VARCHAR( 254 ) NULL "; |
| 1084 | 1084 | |
| 1085 | 1085 | if ($default_value != '') {
|
| 1086 | - $default_value_add .= " DEFAULT '" . $default_value . "'"; |
|
| 1087 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 1086 | + $default_value_add .= " DEFAULT '".$default_value."'"; |
|
| 1087 | + $meta_field_add .= " DEFAULT '".$default_value."'"; |
|
| 1088 | 1088 | } |
| 1089 | 1089 | } |
| 1090 | 1090 | |
@@ -1106,7 +1106,7 @@ discard block |
||
| 1106 | 1106 | |
| 1107 | 1107 | $wpdb->prepare( |
| 1108 | 1108 | |
| 1109 | - "insert into " . GEODIR_CUSTOM_FIELDS_TABLE . " set |
|
| 1109 | + "insert into ".GEODIR_CUSTOM_FIELDS_TABLE." set |
|
| 1110 | 1110 | post_type = %s, |
| 1111 | 1111 | admin_title = %s, |
| 1112 | 1112 | site_title = %s, |
@@ -1139,7 +1139,7 @@ discard block |
||
| 1139 | 1139 | validation_msg = %s, |
| 1140 | 1140 | for_admin_use = %s ", |
| 1141 | 1141 | |
| 1142 | - array($post_type, $admin_title, $site_title, $field_type, $field_type_key, $htmlvar_name, $admin_desc, $clabels, $default_value, $sort_order, $is_active, $is_default, $is_admin, $is_required, $required_msg, $css_class, $field_icon, $show_on_listing,$show_in, $show_on_detail, $show_as_tab, $option_values, $price_pkg, $cat_sort, $cat_filter, $data_type, $extra_field_query, $decimal_point,$validation_pattern,$validation_msg, $for_admin_use) |
|
| 1142 | + array($post_type, $admin_title, $site_title, $field_type, $field_type_key, $htmlvar_name, $admin_desc, $clabels, $default_value, $sort_order, $is_active, $is_default, $is_admin, $is_required, $required_msg, $css_class, $field_icon, $show_on_listing, $show_in, $show_on_detail, $show_as_tab, $option_values, $price_pkg, $cat_sort, $cat_filter, $data_type, $extra_field_query, $decimal_point, $validation_pattern, $validation_msg, $for_admin_use) |
|
| 1143 | 1143 | |
| 1144 | 1144 | ) |
| 1145 | 1145 | |
@@ -1151,7 +1151,7 @@ discard block |
||
| 1151 | 1151 | |
| 1152 | 1152 | } |
| 1153 | 1153 | |
| 1154 | - return (int)$lastid; |
|
| 1154 | + return (int) $lastid; |
|
| 1155 | 1155 | |
| 1156 | 1156 | |
| 1157 | 1157 | } else {
|
@@ -1184,7 +1184,7 @@ discard block |
||
| 1184 | 1184 | |
| 1185 | 1185 | $post_meta_info = $wpdb->query( |
| 1186 | 1186 | $wpdb->prepare( |
| 1187 | - "update " . GEODIR_CUSTOM_FIELDS_TABLE . " set |
|
| 1187 | + "update ".GEODIR_CUSTOM_FIELDS_TABLE." set |
|
| 1188 | 1188 | sort_order=%d |
| 1189 | 1189 | where id= %d", |
| 1190 | 1190 | array($count, $cf) |
@@ -1206,7 +1206,7 @@ discard block |
||
| 1206 | 1206 | global $post; |
| 1207 | 1207 | |
| 1208 | 1208 | if (isset($_REQUEST['post'])) {
|
| 1209 | - $_REQUEST['pid'] = (int)$_REQUEST['post']; |
|
| 1209 | + $_REQUEST['pid'] = (int) $_REQUEST['post']; |
|
| 1210 | 1210 | } |
| 1211 | 1211 | } |
| 1212 | 1212 | |
@@ -1229,7 +1229,7 @@ discard block |
||
| 1229 | 1229 | * @param mixed $value Custom field value. |
| 1230 | 1230 | * @param array $cf Custom field info. |
| 1231 | 1231 | */ |
| 1232 | - return apply_filters( 'geodir_get_cf_value', $value, $cf ); |
|
| 1232 | + return apply_filters('geodir_get_cf_value', $value, $cf);
|
|
| 1233 | 1233 | } |
| 1234 | 1234 | |
| 1235 | 1235 | /** |
@@ -1255,16 +1255,16 @@ discard block |
||
| 1255 | 1255 | $custom_fields = geodir_post_custom_fields($package_id, $default, $post_type); |
| 1256 | 1256 | |
| 1257 | 1257 | foreach ($custom_fields as $key => $val) {
|
| 1258 | - if(isset($val['extra_fields'])){$extra_fields = $val['extra_fields'];}
|
|
| 1258 | + if (isset($val['extra_fields'])) {$extra_fields = $val['extra_fields']; }
|
|
| 1259 | 1259 | $val = stripslashes_deep($val); // strip slashes from labels |
| 1260 | - if(isset($val['extra_fields'])){$val['extra_fields'] = $extra_fields;}
|
|
| 1260 | + if (isset($val['extra_fields'])) {$val['extra_fields'] = $extra_fields; }
|
|
| 1261 | 1261 | |
| 1262 | 1262 | $name = $val['name']; |
| 1263 | 1263 | $type = $val['type']; |
| 1264 | 1264 | $is_default = $val['is_default']; |
| 1265 | 1265 | |
| 1266 | 1266 | /* field available to site admin only for edit */ |
| 1267 | - $for_admin_use = isset($val['for_admin_use']) && (int)$val['for_admin_use'] == 1 ? true : false; |
|
| 1267 | + $for_admin_use = isset($val['for_admin_use']) && (int) $val['for_admin_use'] == 1 ? true : false; |
|
| 1268 | 1268 | if ($for_admin_use && !is_super_admin()) {
|
| 1269 | 1269 | continue; |
| 1270 | 1270 | } |
@@ -1289,11 +1289,11 @@ discard block |
||
| 1289 | 1289 | * @param array $val The settings array for the field. {@see geodir_custom_field_save()}.
|
| 1290 | 1290 | * @see 'geodir_after_custom_form_field_$name' |
| 1291 | 1291 | */ |
| 1292 | - do_action('geodir_before_custom_form_field_' . $name, $listing_type, $package_id, $val);
|
|
| 1292 | + do_action('geodir_before_custom_form_field_'.$name, $listing_type, $package_id, $val);
|
|
| 1293 | 1293 | |
| 1294 | 1294 | |
| 1295 | 1295 | $custom_field = $val; |
| 1296 | - $html =''; |
|
| 1296 | + $html = ''; |
|
| 1297 | 1297 | /** |
| 1298 | 1298 | * Filter the output for custom fields. |
| 1299 | 1299 | * |
@@ -1302,7 +1302,7 @@ discard block |
||
| 1302 | 1302 | * @param string $html The html to be filtered (blank). |
| 1303 | 1303 | * @param array $custom_field The custom field array values. |
| 1304 | 1304 | */ |
| 1305 | - echo apply_filters("geodir_custom_field_input_{$type}",$html,$custom_field);
|
|
| 1305 | + echo apply_filters("geodir_custom_field_input_{$type}", $html, $custom_field);
|
|
| 1306 | 1306 | |
| 1307 | 1307 | |
| 1308 | 1308 | |
@@ -1317,7 +1317,7 @@ discard block |
||
| 1317 | 1317 | * @param array $val The settings array for the field. {@see geodir_custom_field_save()}.
|
| 1318 | 1318 | * @see 'geodir_before_custom_form_field_$name' |
| 1319 | 1319 | */ |
| 1320 | - do_action('geodir_after_custom_form_field_' . $name, $listing_type, $package_id, $val);
|
|
| 1320 | + do_action('geodir_after_custom_form_field_'.$name, $listing_type, $package_id, $val);
|
|
| 1321 | 1321 | |
| 1322 | 1322 | } |
| 1323 | 1323 | |
@@ -1343,7 +1343,7 @@ discard block |
||
| 1343 | 1343 | |
| 1344 | 1344 | $filter = $wpdb->get_row( |
| 1345 | 1345 | $wpdb->prepare( |
| 1346 | - "SELECT * FROM " . GEODIR_CUSTOM_FIELDS_TABLE . " WHERE post_type=%s AND " . $key . "='" . $value . "'", |
|
| 1346 | + "SELECT * FROM ".GEODIR_CUSTOM_FIELDS_TABLE." WHERE post_type=%s AND ".$key."='".$value."'", |
|
| 1347 | 1347 | array($geodir_post_type) |
| 1348 | 1348 | ) |
| 1349 | 1349 | ); |
@@ -1358,14 +1358,14 @@ discard block |
||
| 1358 | 1358 | } |
| 1359 | 1359 | |
| 1360 | 1360 | |
| 1361 | -function geodir_field_icon_proccess($cf){
|
|
| 1361 | +function geodir_field_icon_proccess($cf) {
|
|
| 1362 | 1362 | |
| 1363 | 1363 | |
| 1364 | 1364 | if (strpos($cf['field_icon'], 'http') !== false) {
|
| 1365 | - $field_icon = ' background: url(' . $cf['field_icon'] . ') no-repeat left center;background-size:18px 18px;padding-left: 21px;';
|
|
| 1365 | + $field_icon = ' background: url('.$cf['field_icon'].') no-repeat left center;background-size:18px 18px;padding-left: 21px;';
|
|
| 1366 | 1366 | } elseif (strpos($cf['field_icon'], 'fa fa-') !== false) {
|
| 1367 | - $field_icon = '<i class="' . $cf['field_icon'] . '"></i>'; |
|
| 1368 | - }else{
|
|
| 1367 | + $field_icon = '<i class="'.$cf['field_icon'].'"></i>'; |
|
| 1368 | + } else {
|
|
| 1369 | 1369 | $field_icon = $cf['field_icon']; |
| 1370 | 1370 | } |
| 1371 | 1371 | |
@@ -1410,14 +1410,14 @@ discard block |
||
| 1410 | 1410 | |
| 1411 | 1411 | |
| 1412 | 1412 | foreach ($fields_info as $type) {
|
| 1413 | - if(isset($type['extra_fields'])){$extra_fields= $type['extra_fields'];}
|
|
| 1413 | + if (isset($type['extra_fields'])) {$extra_fields = $type['extra_fields']; }
|
|
| 1414 | 1414 | $type = stripslashes_deep($type); // strip slashes |
| 1415 | - if(isset($type['extra_fields'])){$type['extra_fields'] = $extra_fields;}
|
|
| 1415 | + if (isset($type['extra_fields'])) {$type['extra_fields'] = $extra_fields; }
|
|
| 1416 | 1416 | $html = ''; |
| 1417 | 1417 | $field_icon = geodir_field_icon_proccess($type); |
| 1418 | 1418 | $filed_type = $type['type']; |
| 1419 | 1419 | $html_var = isset($type['htmlvar_name']) ? $type['htmlvar_name'] : ''; |
| 1420 | - if($html_var=='post'){$html_var='post_address';}
|
|
| 1420 | + if ($html_var == 'post') {$html_var = 'post_address'; }
|
|
| 1421 | 1421 | |
| 1422 | 1422 | /** |
| 1423 | 1423 | * Filter the output for custom fields. |
@@ -1428,7 +1428,7 @@ discard block |
||
| 1428 | 1428 | * @param string $fields_location The location the field is to be show. |
| 1429 | 1429 | * @param array $type The array of field values. |
| 1430 | 1430 | */ |
| 1431 | - $html = apply_filters("geodir_custom_field_output_{$filed_type}",$html,$fields_location,$type);
|
|
| 1431 | + $html = apply_filters("geodir_custom_field_output_{$filed_type}", $html, $fields_location, $type);
|
|
| 1432 | 1432 | |
| 1433 | 1433 | $variables_array = array(); |
| 1434 | 1434 | |
@@ -1488,7 +1488,7 @@ discard block |
||
| 1488 | 1488 | * @param string $fields_location The location the fields are being output. |
| 1489 | 1489 | * @since 1.6.9 |
| 1490 | 1490 | */ |
| 1491 | - return apply_filters('geodir_show_listing_info',$html,$fields_location);
|
|
| 1491 | + return apply_filters('geodir_show_listing_info', $html, $fields_location);
|
|
| 1492 | 1492 | |
| 1493 | 1493 | } |
| 1494 | 1494 | } |
@@ -1563,7 +1563,7 @@ discard block |
||
| 1563 | 1563 | |
| 1564 | 1564 | $post_type = get_post_type($post_id); |
| 1565 | 1565 | //echo $field_id; exit; |
| 1566 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
| 1566 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
| 1567 | 1567 | |
| 1568 | 1568 | $postcurr_images = array(); |
| 1569 | 1569 | $postcurr_images = geodir_get_post_meta($post_id, $field_id, true); |
@@ -1582,13 +1582,13 @@ discard block |
||
| 1582 | 1582 | $geodir_uploadurl = $uploads['url']; |
| 1583 | 1583 | $sub_dir = $uploads['subdir']; |
| 1584 | 1584 | |
| 1585 | - $allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types'] ) ? $extra_fields['gd_file_types'] : '';
|
|
| 1585 | + $allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types']) ? $extra_fields['gd_file_types'] : '';
|
|
| 1586 | 1586 | |
| 1587 | 1587 | for ($m = 0; $m < count($post_image); $m++) {
|
| 1588 | 1588 | |
| 1589 | 1589 | /* --------- start ------- */ |
| 1590 | 1590 | |
| 1591 | - if (!$find_image = $wpdb->get_var($wpdb->prepare("SELECT post_id FROM " . $table . " WHERE $field_id = %s AND post_id = %d", array($post_image[$m], $post_id)))) {
|
|
| 1591 | + if (!$find_image = $wpdb->get_var($wpdb->prepare("SELECT post_id FROM ".$table." WHERE $field_id = %s AND post_id = %d", array($post_image[$m], $post_id)))) {
|
|
| 1592 | 1592 | |
| 1593 | 1593 | |
| 1594 | 1594 | $curr_img_url = $post_image[$m]; |
@@ -1614,24 +1614,24 @@ discard block |
||
| 1614 | 1614 | //$allowed_file_types = array('image/jpg', 'image/jpeg', 'image/gif', 'image/png', 'application/pdf', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/octet-stream', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'text/csv', 'text/plain');
|
| 1615 | 1615 | |
| 1616 | 1616 | if (!function_exists('wp_handle_upload'))
|
| 1617 | - require_once(ABSPATH . 'wp-admin/includes/file.php'); |
|
| 1617 | + require_once(ABSPATH.'wp-admin/includes/file.php'); |
|
| 1618 | 1618 | |
| 1619 | 1619 | if (!is_dir($geodir_uploadpath)) |
| 1620 | 1620 | mkdir($geodir_uploadpath); |
| 1621 | 1621 | |
| 1622 | - $new_name = $post_id . '_' . $field_id . '_' . $img_name_arr[0] . '.' . $img_name_arr[1]; |
|
| 1622 | + $new_name = $post_id.'_'.$field_id.'_'.$img_name_arr[0].'.'.$img_name_arr[1]; |
|
| 1623 | 1623 | $explode_sub_dir = explode("/", $sub_dir);
|
| 1624 | 1624 | if ($curr_img_dir == end($explode_sub_dir)) {
|
| 1625 | - $img_path = $geodir_uploadpath . '/' . $filename; |
|
| 1626 | - $img_url = $geodir_uploadurl . '/' . $filename; |
|
| 1625 | + $img_path = $geodir_uploadpath.'/'.$filename; |
|
| 1626 | + $img_url = $geodir_uploadurl.'/'.$filename; |
|
| 1627 | 1627 | } else {
|
| 1628 | - $img_path = $uploads_dir . '/temp_' . $current_user->data->ID . '/' . $filename; |
|
| 1629 | - $img_url = $uploads['url'] . '/temp_' . $current_user->data->ID . '/' . $filename; |
|
| 1628 | + $img_path = $uploads_dir.'/temp_'.$current_user->data->ID.'/'.$filename; |
|
| 1629 | + $img_url = $uploads['url'].'/temp_'.$current_user->data->ID.'/'.$filename; |
|
| 1630 | 1630 | } |
| 1631 | 1631 | |
| 1632 | 1632 | $uploaded_file = ''; |
| 1633 | 1633 | if (file_exists($img_path)) |
| 1634 | - $uploaded_file = copy($img_path, $geodir_uploadpath . '/' . $new_name); |
|
| 1634 | + $uploaded_file = copy($img_path, $geodir_uploadpath.'/'.$new_name); |
|
| 1635 | 1635 | |
| 1636 | 1636 | if ($curr_img_dir != $geodir_uploaddir) {
|
| 1637 | 1637 | if (file_exists($img_path)) |
@@ -1639,7 +1639,7 @@ discard block |
||
| 1639 | 1639 | } |
| 1640 | 1640 | |
| 1641 | 1641 | if (!empty($uploaded_file)) |
| 1642 | - $file_urls = $geodir_uploadurl . '/' . $new_name; |
|
| 1642 | + $file_urls = $geodir_uploadurl.'/'.$new_name; |
|
| 1643 | 1643 | |
| 1644 | 1644 | } else {
|
| 1645 | 1645 | $file_urls = $post_image[$m]; |
@@ -1653,8 +1653,8 @@ discard block |
||
| 1653 | 1653 | if (!empty($postcurr_images)) {
|
| 1654 | 1654 | |
| 1655 | 1655 | if ($file_urls != $postcurr_images) {
|
| 1656 | - $invalid_files[] = (object)array('src' => $postcurr_images);
|
|
| 1657 | - $invalid_files = (object)$invalid_files; |
|
| 1656 | + $invalid_files[] = (object) array('src' => $postcurr_images);
|
|
| 1657 | + $invalid_files = (object) $invalid_files; |
|
| 1658 | 1658 | } |
| 1659 | 1659 | } |
| 1660 | 1660 | |
@@ -1706,9 +1706,9 @@ discard block |
||
| 1706 | 1706 | function geodir_upload_dir($upload) |
| 1707 | 1707 | {
|
| 1708 | 1708 | global $current_user; |
| 1709 | - $upload['subdir'] = $upload['subdir'] . '/temp_' . $current_user->data->ID; |
|
| 1710 | - $upload['path'] = $upload['basedir'] . $upload['subdir']; |
|
| 1711 | - $upload['url'] = $upload['baseurl'] . $upload['subdir']; |
|
| 1709 | + $upload['subdir'] = $upload['subdir'].'/temp_'.$current_user->data->ID; |
|
| 1710 | + $upload['path'] = $upload['basedir'].$upload['subdir']; |
|
| 1711 | + $upload['url'] = $upload['baseurl'].$upload['subdir']; |
|
| 1712 | 1712 | return $upload; |
| 1713 | 1713 | } |
| 1714 | 1714 | |
@@ -1723,20 +1723,20 @@ discard block |
||
| 1723 | 1723 | // check ajax nonce |
| 1724 | 1724 | $imgid = $_POST["imgid"]; |
| 1725 | 1725 | |
| 1726 | - check_ajax_referer($imgid . 'pluploadan'); |
|
| 1726 | + check_ajax_referer($imgid.'pluploadan'); |
|
| 1727 | 1727 | |
| 1728 | 1728 | // handle custom file uploaddir |
| 1729 | 1729 | add_filter('upload_dir', 'geodir_upload_dir');
|
| 1730 | 1730 | |
| 1731 | 1731 | // change file orientation if needed |
| 1732 | - $fixed_file = geodir_exif($_FILES[$imgid . 'async-upload']); |
|
| 1732 | + $fixed_file = geodir_exif($_FILES[$imgid.'async-upload']); |
|
| 1733 | 1733 | |
| 1734 | 1734 | // handle file upload |
| 1735 | 1735 | $status = wp_handle_upload($fixed_file, array('test_form' => true, 'action' => 'plupload_action'));
|
| 1736 | 1736 | // remove handle custom file uploaddir |
| 1737 | 1737 | remove_filter('upload_dir', 'geodir_upload_dir');
|
| 1738 | 1738 | |
| 1739 | - if(!isset($status['url']) && isset($status['error'])){
|
|
| 1739 | + if (!isset($status['url']) && isset($status['error'])) {
|
|
| 1740 | 1740 | print_r($status); |
| 1741 | 1741 | } |
| 1742 | 1742 | |
@@ -1766,9 +1766,9 @@ discard block |
||
| 1766 | 1766 | |
| 1767 | 1767 | $post_type = get_post_type($post_id); |
| 1768 | 1768 | |
| 1769 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
| 1769 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
| 1770 | 1770 | |
| 1771 | - $results = $wpdb->get_results($wpdb->prepare("SELECT geodir_video FROM " . $table . " WHERE post_id=%d", array($post_id)));
|
|
| 1771 | + $results = $wpdb->get_results($wpdb->prepare("SELECT geodir_video FROM ".$table." WHERE post_id=%d", array($post_id)));
|
|
| 1772 | 1772 | |
| 1773 | 1773 | if ($results) {
|
| 1774 | 1774 | return $results[0]->geodir_video; |
@@ -1792,9 +1792,9 @@ discard block |
||
| 1792 | 1792 | |
| 1793 | 1793 | $post_type = get_post_type($post_id); |
| 1794 | 1794 | |
| 1795 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
| 1795 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
| 1796 | 1796 | |
| 1797 | - $results = $wpdb->get_results($wpdb->prepare("SELECT geodir_special_offers FROM " . $table . " WHERE post_id=%d", array($post_id)));
|
|
| 1797 | + $results = $wpdb->get_results($wpdb->prepare("SELECT geodir_special_offers FROM ".$table." WHERE post_id=%d", array($post_id)));
|
|
| 1798 | 1798 | |
| 1799 | 1799 | if ($results) {
|
| 1800 | 1800 | return $results[0]->geodir_special_offers; |
@@ -1812,12 +1812,12 @@ discard block |
||
| 1812 | 1812 | */ |
| 1813 | 1813 | function geodir_max_upload_size() |
| 1814 | 1814 | {
|
| 1815 | - $max_filesize = (float)get_option('geodir_upload_max_filesize', 2);
|
|
| 1815 | + $max_filesize = (float) get_option('geodir_upload_max_filesize', 2);
|
|
| 1816 | 1816 | |
| 1817 | 1817 | if ($max_filesize > 0 && $max_filesize < 1) {
|
| 1818 | - $max_filesize = (int)($max_filesize * 1024) . 'kb'; |
|
| 1818 | + $max_filesize = (int) ($max_filesize * 1024).'kb'; |
|
| 1819 | 1819 | } else {
|
| 1820 | - $max_filesize = $max_filesize > 0 ? $max_filesize . 'mb' : '2mb'; |
|
| 1820 | + $max_filesize = $max_filesize > 0 ? $max_filesize.'mb' : '2mb'; |
|
| 1821 | 1821 | } |
| 1822 | 1822 | /** Filter documented in geodirectory-functions/general_functions.php **/ |
| 1823 | 1823 | return apply_filters('geodir_default_image_upload_size_limit', $max_filesize);
|
@@ -1849,7 +1849,7 @@ discard block |
||
| 1849 | 1849 | |
| 1850 | 1850 | $custom_fields = $wpdb->get_results( |
| 1851 | 1851 | $wpdb->prepare( |
| 1852 | - "select post_type,data_type,field_type,site_title,htmlvar_name,field_icon from " . GEODIR_CUSTOM_FIELDS_TABLE . " where post_type = %s and is_active='1' and cat_sort='1' AND field_type != 'address' order by sort_order asc", |
|
| 1852 | + "select post_type,data_type,field_type,site_title,htmlvar_name,field_icon from ".GEODIR_CUSTOM_FIELDS_TABLE." where post_type = %s and is_active='1' and cat_sort='1' AND field_type != 'address' order by sort_order asc", |
|
| 1853 | 1853 | array($post_type) |
| 1854 | 1854 | ), 'ARRAY_A' |
| 1855 | 1855 | ); |
@@ -1976,7 +1976,7 @@ discard block |
||
| 1976 | 1976 | |
| 1977 | 1977 | $post_meta_info = $wpdb->query( |
| 1978 | 1978 | $wpdb->prepare( |
| 1979 | - "update " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set |
|
| 1979 | + "update ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." set |
|
| 1980 | 1980 | sort_order=%d |
| 1981 | 1981 | where id= %d", |
| 1982 | 1982 | array($count, $cf) |
@@ -2058,14 +2058,14 @@ discard block |
||
| 2058 | 2058 | |
| 2059 | 2059 | $check_html_variable = $wpdb->get_var( |
| 2060 | 2060 | $wpdb->prepare( |
| 2061 | - "select htmlvar_name from " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s and field_type=%s ", |
|
| 2061 | + "select htmlvar_name from ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." where htmlvar_name = %s and post_type = %s and field_type=%s ", |
|
| 2062 | 2062 | array($cehhtmlvar_name, $post_type, $field_type) |
| 2063 | 2063 | ) |
| 2064 | 2064 | ); |
| 2065 | 2065 | |
| 2066 | 2066 | if ($is_default == 1) {
|
| 2067 | 2067 | |
| 2068 | - $wpdb->query($wpdb->prepare("update " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set is_default='0', default_order='' where post_type = %s", array($post_type)));
|
|
| 2068 | + $wpdb->query($wpdb->prepare("update ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." set is_default='0', default_order='' where post_type = %s", array($post_type)));
|
|
| 2069 | 2069 | |
| 2070 | 2070 | } |
| 2071 | 2071 | |
@@ -2076,7 +2076,7 @@ discard block |
||
| 2076 | 2076 | |
| 2077 | 2077 | $wpdb->prepare( |
| 2078 | 2078 | |
| 2079 | - "insert into " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set |
|
| 2079 | + "insert into ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." set |
|
| 2080 | 2080 | post_type = %s, |
| 2081 | 2081 | data_type = %s, |
| 2082 | 2082 | field_type = %s, |
@@ -2107,7 +2107,7 @@ discard block |
||
| 2107 | 2107 | |
| 2108 | 2108 | $wpdb->prepare( |
| 2109 | 2109 | |
| 2110 | - "update " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set |
|
| 2110 | + "update ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." set |
|
| 2111 | 2111 | post_type = %s, |
| 2112 | 2112 | data_type = %s, |
| 2113 | 2113 | field_type = %s, |
@@ -2133,7 +2133,7 @@ discard block |
||
| 2133 | 2133 | } |
| 2134 | 2134 | |
| 2135 | 2135 | |
| 2136 | - return (int)$lastid; |
|
| 2136 | + return (int) $lastid; |
|
| 2137 | 2137 | |
| 2138 | 2138 | } |
| 2139 | 2139 | } |
@@ -2156,7 +2156,7 @@ discard block |
||
| 2156 | 2156 | if ($field_id != '') {
|
| 2157 | 2157 | $cf = trim($field_id, '_'); |
| 2158 | 2158 | |
| 2159 | - $wpdb->query($wpdb->prepare("delete from " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " where id= %d ", array($cf)));
|
|
| 2159 | + $wpdb->query($wpdb->prepare("delete from ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." where id= %d ", array($cf)));
|
|
| 2160 | 2160 | |
| 2161 | 2161 | return $field_id; |
| 2162 | 2162 | |
@@ -2179,12 +2179,12 @@ discard block |
||
| 2179 | 2179 | * @param string $field_ins_upd When set to "submit" displays form. |
| 2180 | 2180 | * @param bool $default when set to true field will be for admin use only. |
| 2181 | 2181 | */ |
| 2182 | - function geodir_custom_sort_field_adminhtml($field_type, $result_str, $field_ins_upd = '', $field_type_key='') |
|
| 2182 | + function geodir_custom_sort_field_adminhtml($field_type, $result_str, $field_ins_upd = '', $field_type_key = '') |
|
| 2183 | 2183 | {
|
| 2184 | 2184 | global $wpdb; |
| 2185 | 2185 | $cf = $result_str; |
| 2186 | 2186 | if (!is_object($cf)) {
|
| 2187 | - $field_info = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " WHERE id = %d", array($cf)));
|
|
| 2187 | + $field_info = $wpdb->get_row($wpdb->prepare("SELECT * FROM ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." WHERE id = %d", array($cf)));
|
|
| 2188 | 2188 | } else {
|
| 2189 | 2189 | $field_info = $cf; |
| 2190 | 2190 | $result_str = $cf->id; |
@@ -2220,18 +2220,18 @@ discard block |
||
| 2220 | 2220 | if ($htmlvar_name == '') |
| 2221 | 2221 | $htmlvar_name = isset($field_info->htmlvar_name) ? $field_info->htmlvar_name : ''; |
| 2222 | 2222 | |
| 2223 | - $nonce = wp_create_nonce('custom_fields_' . $result_str);
|
|
| 2223 | + $nonce = wp_create_nonce('custom_fields_'.$result_str);
|
|
| 2224 | 2224 | |
| 2225 | 2225 | $field_icon = '<i class="fa fa-cog" aria-hidden="true"></i>'; |
| 2226 | 2226 | $cso_arr = geodir_get_custom_sort_options($post_type); |
| 2227 | 2227 | |
| 2228 | 2228 | $cur_field_type = (isset($cf->field_type)) ? $cf->field_type : esc_html($_REQUEST['field_type']); |
| 2229 | - foreach($cso_arr as $cso){
|
|
| 2230 | - if($cur_field_type==$cso['field_type']){
|
|
| 2229 | + foreach ($cso_arr as $cso) {
|
|
| 2230 | + if ($cur_field_type == $cso['field_type']) {
|
|
| 2231 | 2231 | |
| 2232 | 2232 | if (isset($cso['field_icon']) && strpos($cso['field_icon'], 'fa fa-') !== false) {
|
| 2233 | 2233 | $field_icon = '<i class="'.$cso['field_icon'].'" aria-hidden="true"></i>'; |
| 2234 | - }elseif(isset($cso['field_icon']) && $cso['field_icon']){
|
|
| 2234 | + }elseif (isset($cso['field_icon']) && $cso['field_icon']) {
|
|
| 2235 | 2235 | $field_icon = '<b style="background-image: url("'.$cso['field_icon'].'")"></b>';
|
| 2236 | 2236 | } |
| 2237 | 2237 | |
@@ -2241,40 +2241,40 @@ discard block |
||
| 2241 | 2241 | $radio_id = (isset($field_info->htmlvar_name)) ? $field_info->htmlvar_name.$field_type : rand(5, 500); |
| 2242 | 2242 | ?> |
| 2243 | 2243 | |
| 2244 | - <li class="text" id="licontainer_<?php echo $result_str;?>"> |
|
| 2244 | + <li class="text" id="licontainer_<?php echo $result_str; ?>"> |
|
| 2245 | 2245 | <form><!-- we need to wrap in a form so we can use radio buttons with same name --> |
| 2246 | - <div class="title title<?php echo $result_str;?> gt-fieldset" |
|
| 2247 | - title="<?php _e('Double Click to toggle and drag-drop to sort', 'geodirectory');?>"
|
|
| 2248 | - ondblclick="show_hide('field_frm<?php echo $result_str;?>')">
|
|
| 2246 | + <div class="title title<?php echo $result_str; ?> gt-fieldset" |
|
| 2247 | + title="<?php _e('Double Click to toggle and drag-drop to sort', 'geodirectory'); ?>"
|
|
| 2248 | + ondblclick="show_hide('field_frm<?php echo $result_str; ?>')">
|
|
| 2249 | 2249 | <?php |
| 2250 | 2250 | |
| 2251 | 2251 | ?> |
| 2252 | 2252 | |
| 2253 | - <div title="<?php _e('Click to remove field', 'geodirectory');?>"
|
|
| 2254 | - onclick="delete_sort_field('<?php echo $result_str;?>', '<?php echo $nonce;?>', this)"
|
|
| 2253 | + <div title="<?php _e('Click to remove field', 'geodirectory'); ?>"
|
|
| 2254 | + onclick="delete_sort_field('<?php echo $result_str; ?>', '<?php echo $nonce; ?>', this)"
|
|
| 2255 | 2255 | class="handlediv close"><i class="fa fa-times" aria-hidden="true"></i></div> |
| 2256 | 2256 | |
| 2257 | 2257 | |
| 2258 | - <?php echo $field_icon;?> |
|
| 2258 | + <?php echo $field_icon; ?> |
|
| 2259 | 2259 | <b style="cursor:pointer;" |
| 2260 | - onclick="show_hide('field_frm<?php echo $result_str;?>')"><?php echo geodir_ucwords(__('Field:', 'geodirectory') . ' (' . $site_title . ')');?></b>
|
|
| 2260 | + onclick="show_hide('field_frm<?php echo $result_str; ?>')"><?php echo geodir_ucwords(__('Field:', 'geodirectory').' ('.$site_title.')'); ?></b>
|
|
| 2261 | 2261 | |
| 2262 | 2262 | </div> |
| 2263 | 2263 | |
| 2264 | - <div id="field_frm<?php echo $result_str;?>" class="field_frm" |
|
| 2264 | + <div id="field_frm<?php echo $result_str; ?>" class="field_frm" |
|
| 2265 | 2265 | style="display:<?php if ($field_ins_upd == 'submit') {
|
| 2266 | 2266 | echo 'block;'; |
| 2267 | 2267 | } else {
|
| 2268 | 2268 | echo 'none;'; |
| 2269 | 2269 | } ?>"> |
| 2270 | 2270 | <input type="hidden" name="_wpnonce" value="<?php echo $nonce; ?>"/> |
| 2271 | - <input type="hidden" name="listing_type" id="listing_type" value="<?php echo $post_type;?>"/> |
|
| 2272 | - <input type="hidden" name="field_type" id="field_type" value="<?php echo $field_type;?>"/> |
|
| 2273 | - <input type="hidden" name="field_id" id="field_id" value="<?php echo $result_str;?>"/> |
|
| 2271 | + <input type="hidden" name="listing_type" id="listing_type" value="<?php echo $post_type; ?>"/> |
|
| 2272 | + <input type="hidden" name="field_type" id="field_type" value="<?php echo $field_type; ?>"/> |
|
| 2273 | + <input type="hidden" name="field_id" id="field_id" value="<?php echo $result_str; ?>"/> |
|
| 2274 | 2274 | <input type="hidden" name="data_type" id="data_type" value="<?php if (isset($field_info->data_type)) {
|
| 2275 | 2275 | echo $field_info->data_type; |
| 2276 | 2276 | }?>"/> |
| 2277 | - <input type="hidden" name="htmlvar_name" id="htmlvar_name" value="<?php echo $htmlvar_name;?>"/> |
|
| 2277 | + <input type="hidden" name="htmlvar_name" id="htmlvar_name" value="<?php echo $htmlvar_name; ?>"/> |
|
| 2278 | 2278 | |
| 2279 | 2279 | |
| 2280 | 2280 | <ul class="widefat post fixed" border="0" style="width:100%;"> |
@@ -2284,7 +2284,7 @@ discard block |
||
| 2284 | 2284 | <input type="hidden" name="site_title" id="site_title" value="<?php echo esc_attr($site_title); ?>"/> |
| 2285 | 2285 | |
| 2286 | 2286 | <li> |
| 2287 | - <?php $value = (isset($field_info->sort_asc) && $field_info->sort_asc) ? $field_info->sort_asc : 0;?> |
|
| 2287 | + <?php $value = (isset($field_info->sort_asc) && $field_info->sort_asc) ? $field_info->sort_asc : 0; ?> |
|
| 2288 | 2288 | |
| 2289 | 2289 | <label for="asc" class="gd-cf-tooltip-wrap"> |
| 2290 | 2290 | <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Show Ascending Sort (low to high)', 'geodirectory'); ?>
|
@@ -2294,24 +2294,24 @@ discard block |
||
| 2294 | 2294 | </label> |
| 2295 | 2295 | <div class="gd-cf-input-wrap gd-switch"> |
| 2296 | 2296 | |
| 2297 | - <input type="radio" id="asc_yes<?php echo $radio_id;?>" name="asc" class="gdri-enabled" value="1" |
|
| 2297 | + <input type="radio" id="asc_yes<?php echo $radio_id; ?>" name="asc" class="gdri-enabled" value="1" |
|
| 2298 | 2298 | <?php if ($value == '1') {
|
| 2299 | 2299 | echo 'checked'; |
| 2300 | 2300 | } ?>/> |
| 2301 | - <label onclick="show_hide_radio(this,'show','cfs-asc-title');" for="asc_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
|
|
| 2301 | + <label onclick="show_hide_radio(this,'show','cfs-asc-title');" for="asc_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
|
|
| 2302 | 2302 | |
| 2303 | - <input type="radio" id="asc_no<?php echo $radio_id;?>" name="asc" class="gdri-disabled" value="0" |
|
| 2303 | + <input type="radio" id="asc_no<?php echo $radio_id; ?>" name="asc" class="gdri-disabled" value="0" |
|
| 2304 | 2304 | <?php if ($value == '0' || !$value) {
|
| 2305 | 2305 | echo 'checked'; |
| 2306 | 2306 | } ?>/> |
| 2307 | - <label onclick="show_hide_radio(this,'hide','cfs-asc-title');" for="asc_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
|
|
| 2307 | + <label onclick="show_hide_radio(this,'hide','cfs-asc-title');" for="asc_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
|
|
| 2308 | 2308 | |
| 2309 | 2309 | </div> |
| 2310 | 2310 | |
| 2311 | 2311 | </li> |
| 2312 | 2312 | |
| 2313 | - <li class="cfs-asc-title" <?php if ((isset($field_info->sort_asc) && $field_info->sort_asc == '0') || !isset($field_info->sort_asc)) {echo "style='display:none;'";}?>>
|
|
| 2314 | - <?php $value = (isset($field_info->asc_title) && $field_info->asc_title) ? esc_attr($field_info->asc_title) : '';?> |
|
| 2313 | + <li class="cfs-asc-title" <?php if ((isset($field_info->sort_asc) && $field_info->sort_asc == '0') || !isset($field_info->sort_asc)) {echo "style='display:none;'"; }?>>
|
|
| 2314 | + <?php $value = (isset($field_info->asc_title) && $field_info->asc_title) ? esc_attr($field_info->asc_title) : ''; ?> |
|
| 2315 | 2315 | |
| 2316 | 2316 | <label for="asc_title" class="gd-cf-tooltip-wrap"> |
| 2317 | 2317 | <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Ascending title', 'geodirectory'); ?>
|
@@ -2321,14 +2321,14 @@ discard block |
||
| 2321 | 2321 | </label> |
| 2322 | 2322 | <div class="gd-cf-input-wrap"> |
| 2323 | 2323 | |
| 2324 | - <input type="text" name="asc_title" id="asc_title" value="<?php echo $value;?>" /> |
|
| 2324 | + <input type="text" name="asc_title" id="asc_title" value="<?php echo $value; ?>" /> |
|
| 2325 | 2325 | </div> |
| 2326 | 2326 | |
| 2327 | 2327 | |
| 2328 | 2328 | </li> |
| 2329 | 2329 | |
| 2330 | 2330 | |
| 2331 | - <li class="cfs-asc-title" <?php if ((isset($field_info->sort_asc) && $field_info->sort_asc == '0') || !isset($field_info->sort_asc)) {echo "style='display:none;'";}?>>
|
|
| 2331 | + <li class="cfs-asc-title" <?php if ((isset($field_info->sort_asc) && $field_info->sort_asc == '0') || !isset($field_info->sort_asc)) {echo "style='display:none;'"; }?>>
|
|
| 2332 | 2332 | |
| 2333 | 2333 | <label for="is_default" class="gd-cf-tooltip-wrap"> |
| 2334 | 2334 | <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Default sort?', 'geodirectory'); ?>
|
@@ -2339,7 +2339,7 @@ discard block |
||
| 2339 | 2339 | <div class="gd-cf-input-wrap"> |
| 2340 | 2340 | |
| 2341 | 2341 | <input type="radio" name="is_default" |
| 2342 | - value="<?php echo $htmlvar_name; ?>_asc" <?php if (isset($field_info->default_order) && $field_info->default_order == $htmlvar_name . '_asc') {
|
|
| 2342 | + value="<?php echo $htmlvar_name; ?>_asc" <?php if (isset($field_info->default_order) && $field_info->default_order == $htmlvar_name.'_asc') {
|
|
| 2343 | 2343 | echo 'checked="checked"'; |
| 2344 | 2344 | } ?>/> |
| 2345 | 2345 | </div> |
@@ -2349,7 +2349,7 @@ discard block |
||
| 2349 | 2349 | |
| 2350 | 2350 | |
| 2351 | 2351 | <li> |
| 2352 | - <?php $value = (isset($field_info->sort_desc) && $field_info->sort_desc) ? $field_info->sort_desc : 0;?> |
|
| 2352 | + <?php $value = (isset($field_info->sort_desc) && $field_info->sort_desc) ? $field_info->sort_desc : 0; ?> |
|
| 2353 | 2353 | |
| 2354 | 2354 | <label for="desc" class="gd-cf-tooltip-wrap"> |
| 2355 | 2355 | <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Show Descending Sort (high to low)', 'geodirectory'); ?>
|
@@ -2359,24 +2359,24 @@ discard block |
||
| 2359 | 2359 | </label> |
| 2360 | 2360 | <div class="gd-cf-input-wrap gd-switch"> |
| 2361 | 2361 | |
| 2362 | - <input type="radio" id="desc_yes<?php echo $radio_id;?>" name="desc" class="gdri-enabled" value="1" |
|
| 2362 | + <input type="radio" id="desc_yes<?php echo $radio_id; ?>" name="desc" class="gdri-enabled" value="1" |
|
| 2363 | 2363 | <?php if ($value == '1') {
|
| 2364 | 2364 | echo 'checked'; |
| 2365 | 2365 | } ?>/> |
| 2366 | - <label onclick="show_hide_radio(this,'show','cfs-desc-title');" for="desc_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
|
|
| 2366 | + <label onclick="show_hide_radio(this,'show','cfs-desc-title');" for="desc_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
|
|
| 2367 | 2367 | |
| 2368 | - <input type="radio" id="desc_no<?php echo $radio_id;?>" name="desc" class="gdri-disabled" value="0" |
|
| 2368 | + <input type="radio" id="desc_no<?php echo $radio_id; ?>" name="desc" class="gdri-disabled" value="0" |
|
| 2369 | 2369 | <?php if ($value == '0' || !$value) {
|
| 2370 | 2370 | echo 'checked'; |
| 2371 | 2371 | } ?>/> |
| 2372 | - <label onclick="show_hide_radio(this,'hide','cfs-desc-title');" for="desc_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
|
|
| 2372 | + <label onclick="show_hide_radio(this,'hide','cfs-desc-title');" for="desc_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
|
|
| 2373 | 2373 | |
| 2374 | 2374 | </div> |
| 2375 | 2375 | |
| 2376 | 2376 | </li> |
| 2377 | 2377 | |
| 2378 | - <li class="cfs-desc-title" <?php if ((isset($field_info->sort_desc) && $field_info->sort_desc == '0') || !isset($field_info->sort_desc)) {echo "style='display:none;'";}?>>
|
|
| 2379 | - <?php $value = (isset($field_info->desc_title) && $field_info->desc_title) ? esc_attr($field_info->desc_title) : '';?> |
|
| 2378 | + <li class="cfs-desc-title" <?php if ((isset($field_info->sort_desc) && $field_info->sort_desc == '0') || !isset($field_info->sort_desc)) {echo "style='display:none;'"; }?>>
|
|
| 2379 | + <?php $value = (isset($field_info->desc_title) && $field_info->desc_title) ? esc_attr($field_info->desc_title) : ''; ?> |
|
| 2380 | 2380 | |
| 2381 | 2381 | <label for="desc_title" class="gd-cf-tooltip-wrap"> |
| 2382 | 2382 | <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Descending title', 'geodirectory'); ?>
|
@@ -2386,13 +2386,13 @@ discard block |
||
| 2386 | 2386 | </label> |
| 2387 | 2387 | <div class="gd-cf-input-wrap"> |
| 2388 | 2388 | |
| 2389 | - <input type="text" name="desc_title" id="desc_title" value="<?php echo $value;?>" /> |
|
| 2389 | + <input type="text" name="desc_title" id="desc_title" value="<?php echo $value; ?>" /> |
|
| 2390 | 2390 | </div> |
| 2391 | 2391 | |
| 2392 | 2392 | |
| 2393 | 2393 | </li> |
| 2394 | 2394 | |
| 2395 | - <li class="cfs-desc-title" <?php if ((isset($field_info->sort_desc) && $field_info->sort_desc == '0') || !isset($field_info->sort_desc)) {echo "style='display:none;'";}?>>
|
|
| 2395 | + <li class="cfs-desc-title" <?php if ((isset($field_info->sort_desc) && $field_info->sort_desc == '0') || !isset($field_info->sort_desc)) {echo "style='display:none;'"; }?>>
|
|
| 2396 | 2396 | |
| 2397 | 2397 | <label for="is_default" class="gd-cf-tooltip-wrap"> |
| 2398 | 2398 | <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Default sort?', 'geodirectory'); ?>
|
@@ -2403,7 +2403,7 @@ discard block |
||
| 2403 | 2403 | <div class="gd-cf-input-wrap"> |
| 2404 | 2404 | |
| 2405 | 2405 | <input type="radio" name="is_default" |
| 2406 | - value="<?php echo $htmlvar_name; ?>_desc" <?php if (isset($field_info->default_order) && $field_info->default_order == $htmlvar_name . '_desc') {
|
|
| 2406 | + value="<?php echo $htmlvar_name; ?>_desc" <?php if (isset($field_info->default_order) && $field_info->default_order == $htmlvar_name.'_desc') {
|
|
| 2407 | 2407 | echo 'checked="checked"'; |
| 2408 | 2408 | } ?>/> |
| 2409 | 2409 | </div> |
@@ -2428,14 +2428,14 @@ discard block |
||
| 2428 | 2428 | </label> |
| 2429 | 2429 | <div class="gd-cf-input-wrap"> |
| 2430 | 2430 | |
| 2431 | - <input type="text" name="site_title" id="site_title" value="<?php echo $value;?>" /> |
|
| 2431 | + <input type="text" name="site_title" id="site_title" value="<?php echo $value; ?>" /> |
|
| 2432 | 2432 | </div> |
| 2433 | 2433 | |
| 2434 | 2434 | |
| 2435 | 2435 | </li> |
| 2436 | 2436 | |
| 2437 | 2437 | <li> |
| 2438 | - <?php $value = (isset($field_info->is_default) && $field_info->is_default) ? esc_attr($field_info->is_default) : '';?> |
|
| 2438 | + <?php $value = (isset($field_info->is_default) && $field_info->is_default) ? esc_attr($field_info->is_default) : ''; ?> |
|
| 2439 | 2439 | |
| 2440 | 2440 | <label for="is_default" class="gd-cf-tooltip-wrap"> |
| 2441 | 2441 | <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Default sort?', 'geodirectory'); ?>
|
@@ -2459,7 +2459,7 @@ discard block |
||
| 2459 | 2459 | |
| 2460 | 2460 | |
| 2461 | 2461 | <li> |
| 2462 | - <?php $value = (isset($field_info->is_active) && $field_info->is_active) ? $field_info->is_active: 0;?> |
|
| 2462 | + <?php $value = (isset($field_info->is_active) && $field_info->is_active) ? $field_info->is_active : 0; ?> |
|
| 2463 | 2463 | |
| 2464 | 2464 | <label for="is_active" class="gd-cf-tooltip-wrap"> |
| 2465 | 2465 | <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Is active', 'geodirectory'); ?>
|
@@ -2469,17 +2469,17 @@ discard block |
||
| 2469 | 2469 | </label> |
| 2470 | 2470 | <div class="gd-cf-input-wrap gd-switch"> |
| 2471 | 2471 | |
| 2472 | - <input type="radio" id="is_active_yes<?php echo $radio_id;?>" name="is_active" class="gdri-enabled" value="1" |
|
| 2472 | + <input type="radio" id="is_active_yes<?php echo $radio_id; ?>" name="is_active" class="gdri-enabled" value="1" |
|
| 2473 | 2473 | <?php if ($value == '1') {
|
| 2474 | 2474 | echo 'checked'; |
| 2475 | 2475 | } ?>/> |
| 2476 | - <label for="is_active_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
|
|
| 2476 | + <label for="is_active_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
|
|
| 2477 | 2477 | |
| 2478 | - <input type="radio" id="is_active_no<?php echo $radio_id;?>" name="is_active" class="gdri-disabled" value="0" |
|
| 2478 | + <input type="radio" id="is_active_no<?php echo $radio_id; ?>" name="is_active" class="gdri-disabled" value="0" |
|
| 2479 | 2479 | <?php if ($value == '0' || !$value) {
|
| 2480 | 2480 | echo 'checked'; |
| 2481 | 2481 | } ?>/> |
| 2482 | - <label for="is_active_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
|
|
| 2482 | + <label for="is_active_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
|
|
| 2483 | 2483 | |
| 2484 | 2484 | </div> |
| 2485 | 2485 | |
@@ -2500,10 +2500,10 @@ discard block |
||
| 2500 | 2500 | <h3></h3> |
| 2501 | 2501 | </label> |
| 2502 | 2502 | <div class="gd-cf-input-wrap"> |
| 2503 | - <input type="button" class="button button-primary" name="save" id="save" value="<?php echo esc_attr(__('Save','geodirectory'));?>"
|
|
| 2503 | + <input type="button" class="button button-primary" name="save" id="save" value="<?php echo esc_attr(__('Save', 'geodirectory')); ?>"
|
|
| 2504 | 2504 | onclick="save_sort_field('<?php echo esc_attr($result_str); ?>')"/>
|
| 2505 | - <a href="javascript:void(0)"><input type="button" name="delete" value="<?php echo esc_attr(__('Delete','geodirectory'));?>"
|
|
| 2506 | - onclick="delete_sort_field('<?php echo $result_str;?>', '<?php echo $nonce;?>', this)"
|
|
| 2505 | + <a href="javascript:void(0)"><input type="button" name="delete" value="<?php echo esc_attr(__('Delete', 'geodirectory')); ?>"
|
|
| 2506 | + onclick="delete_sort_field('<?php echo $result_str; ?>', '<?php echo $nonce; ?>', this)"
|
|
| 2507 | 2507 | class="button"/></a> |
| 2508 | 2508 | </div> |
| 2509 | 2509 | </li> |
@@ -2538,7 +2538,7 @@ discard block |
||
| 2538 | 2538 | if (!$package_id || !$field_name || !$post_type) {
|
| 2539 | 2539 | return true; |
| 2540 | 2540 | } |
| 2541 | - $sql = $wpdb->prepare("SELECT id FROM " . GEODIR_CUSTOM_FIELDS_TABLE . " WHERE is_active='1' AND htmlvar_name=%s AND post_type=%s AND FIND_IN_SET(%s, packages)", array($field_name, $post_type, (int)$package_id));
|
|
| 2541 | + $sql = $wpdb->prepare("SELECT id FROM ".GEODIR_CUSTOM_FIELDS_TABLE." WHERE is_active='1' AND htmlvar_name=%s AND post_type=%s AND FIND_IN_SET(%s, packages)", array($field_name, $post_type, (int) $package_id));
|
|
| 2542 | 2542 | |
| 2543 | 2543 | if ($wpdb->get_var($sql)) {
|
| 2544 | 2544 | return true; |
@@ -2661,13 +2661,13 @@ discard block |
||
| 2661 | 2661 | } |
| 2662 | 2662 | |
| 2663 | 2663 | |
| 2664 | -function geodir_cfa_data_type_text($output,$result_str,$cf,$field_info){
|
|
| 2664 | +function geodir_cfa_data_type_text($output, $result_str, $cf, $field_info) {
|
|
| 2665 | 2665 | ob_start(); |
| 2666 | 2666 | |
| 2667 | 2667 | $dt_value = ''; |
| 2668 | 2668 | if (isset($field_info->data_type)) {
|
| 2669 | 2669 | $dt_value = esc_attr($field_info->data_type); |
| 2670 | - }elseif(isset($cf['defaults']['data_type']) && $cf['defaults']['data_type']){
|
|
| 2670 | + }elseif (isset($cf['defaults']['data_type']) && $cf['defaults']['data_type']) {
|
|
| 2671 | 2671 | $dt_value = $cf['defaults']['data_type']; |
| 2672 | 2672 | } |
| 2673 | 2673 | ?> |
@@ -2678,15 +2678,15 @@ discard block |
||
| 2678 | 2678 | <select name="data_type" id="data_type" |
| 2679 | 2679 | onchange="javascript:gd_data_type_changed(this, '<?php echo $result_str; ?>');"> |
| 2680 | 2680 | <option |
| 2681 | - value="XVARCHAR" <?php if ($dt_value == 'VARCHAR') {
|
|
| 2681 | + value="XVARCHAR" <?php if ($dt_value == 'VARCHAR') {
|
|
| 2682 | 2682 | echo 'selected="selected"'; |
| 2683 | 2683 | } ?>><?php _e('CHARACTER', 'geodirectory'); ?></option>
|
| 2684 | 2684 | <option |
| 2685 | - value="INT" <?php if ($dt_value == 'INT') {
|
|
| 2685 | + value="INT" <?php if ($dt_value == 'INT') {
|
|
| 2686 | 2686 | echo 'selected="selected"'; |
| 2687 | 2687 | } ?>><?php _e('NUMBER', 'geodirectory'); ?></option>
|
| 2688 | 2688 | <option |
| 2689 | - value="FLOAT" <?php if ($dt_value == 'FLOAT') {
|
|
| 2689 | + value="FLOAT" <?php if ($dt_value == 'FLOAT') {
|
|
| 2690 | 2690 | echo 'selected="selected"'; |
| 2691 | 2691 | } ?>><?php _e('DECIMAL', 'geodirectory'); ?></option>
|
| 2692 | 2692 | </select> |
@@ -2699,13 +2699,13 @@ discard block |
||
| 2699 | 2699 | $value = ''; |
| 2700 | 2700 | if (isset($field_info->decimal_point)) {
|
| 2701 | 2701 | $value = esc_attr($field_info->decimal_point); |
| 2702 | - }elseif(isset($cf['defaults']['decimal_point']) && $cf['defaults']['decimal_point']){
|
|
| 2702 | + }elseif (isset($cf['defaults']['decimal_point']) && $cf['defaults']['decimal_point']) {
|
|
| 2703 | 2703 | $value = $cf['defaults']['decimal_point']; |
| 2704 | 2704 | } |
| 2705 | 2705 | ?> |
| 2706 | 2706 | |
| 2707 | 2707 | <li class="decimal-point-wrapper" |
| 2708 | - style="<?php echo ($dt_value == 'FLOAT') ? '' : 'display:none' ?>"> |
|
| 2708 | + style="<?php echo ($dt_value == 'FLOAT') ? '' : 'display:none' ?>"> |
|
| 2709 | 2709 | <label for="decimal_point"><?php _e('Select decimal point :', 'geodirectory'); ?></label>
|
| 2710 | 2710 | <div class="gd-cf-input-wrap"> |
| 2711 | 2711 | <select name="decimal_point" id="decimal_point"> |
@@ -2723,41 +2723,41 @@ discard block |
||
| 2723 | 2723 | $output = ob_get_clean(); |
| 2724 | 2724 | return $output; |
| 2725 | 2725 | } |
| 2726 | -add_filter('geodir_cfa_data_type_text','geodir_cfa_data_type_text',10,4);
|
|
| 2726 | +add_filter('geodir_cfa_data_type_text', 'geodir_cfa_data_type_text', 10, 4);
|
|
| 2727 | 2727 | |
| 2728 | 2728 | // htmlvar not needed for fieldset and taxonomy |
| 2729 | -add_filter('geodir_cfa_htmlvar_name_fieldset','__return_empty_string',10,4);
|
|
| 2730 | -add_filter('geodir_cfa_htmlvar_name_taxonomy','__return_empty_string',10,4);
|
|
| 2729 | +add_filter('geodir_cfa_htmlvar_name_fieldset', '__return_empty_string', 10, 4);
|
|
| 2730 | +add_filter('geodir_cfa_htmlvar_name_taxonomy', '__return_empty_string', 10, 4);
|
|
| 2731 | 2731 | |
| 2732 | 2732 | |
| 2733 | 2733 | // default_value not needed for textarea, html, file, fieldset, taxonomy, address |
| 2734 | -add_filter('geodir_cfa_default_value_file','__return_empty_string',10,4);
|
|
| 2735 | -add_filter('geodir_cfa_default_value_taxonomy','__return_empty_string',10,4);
|
|
| 2736 | -add_filter('geodir_cfa_default_value_address','__return_empty_string',10,4);
|
|
| 2737 | -add_filter('geodir_cfa_default_value_fieldset','__return_empty_string',10,4);
|
|
| 2734 | +add_filter('geodir_cfa_default_value_file', '__return_empty_string', 10, 4);
|
|
| 2735 | +add_filter('geodir_cfa_default_value_taxonomy', '__return_empty_string', 10, 4);
|
|
| 2736 | +add_filter('geodir_cfa_default_value_address', '__return_empty_string', 10, 4);
|
|
| 2737 | +add_filter('geodir_cfa_default_value_fieldset', '__return_empty_string', 10, 4);
|
|
| 2738 | 2738 | |
| 2739 | 2739 | // is_required not needed for fieldset |
| 2740 | -add_filter('geodir_cfa_is_required_fieldset','__return_empty_string',10,4);
|
|
| 2741 | -add_filter('geodir_cfa_required_msg_fieldset','__return_empty_string',10,4);
|
|
| 2740 | +add_filter('geodir_cfa_is_required_fieldset', '__return_empty_string', 10, 4);
|
|
| 2741 | +add_filter('geodir_cfa_required_msg_fieldset', '__return_empty_string', 10, 4);
|
|
| 2742 | 2742 | |
| 2743 | 2743 | // field_icon not needed for fieldset |
| 2744 | -add_filter('geodir_cfa_field_icon_fieldset','__return_empty_string',10,4);
|
|
| 2745 | -add_filter('geodir_cfa_css_class_fieldset','__return_empty_string',10,4);
|
|
| 2744 | +add_filter('geodir_cfa_field_icon_fieldset', '__return_empty_string', 10, 4);
|
|
| 2745 | +add_filter('geodir_cfa_css_class_fieldset', '__return_empty_string', 10, 4);
|
|
| 2746 | 2746 | |
| 2747 | 2747 | // cat_sort not needed for some fields |
| 2748 | -add_filter('geodir_cfa_cat_sort_html','__return_empty_string',10,4);
|
|
| 2749 | -add_filter('geodir_cfa_cat_sort_file','__return_empty_string',10,4);
|
|
| 2750 | -add_filter('geodir_cfa_cat_sort_url','__return_empty_string',10,4);
|
|
| 2751 | -add_filter('geodir_cfa_cat_sort_fieldset','__return_empty_string',10,4);
|
|
| 2752 | -add_filter('geodir_cfa_cat_sort_multiselect','__return_empty_string',10,4);
|
|
| 2753 | -add_filter('geodir_cfa_cat_sort_textarea','__return_empty_string',10,4);
|
|
| 2754 | -add_filter('geodir_cfa_cat_sort_taxonomy','__return_empty_string',10,4);
|
|
| 2755 | -add_filter('geodir_cfa_cat_sort_address','__return_empty_string',10,4);
|
|
| 2748 | +add_filter('geodir_cfa_cat_sort_html', '__return_empty_string', 10, 4);
|
|
| 2749 | +add_filter('geodir_cfa_cat_sort_file', '__return_empty_string', 10, 4);
|
|
| 2750 | +add_filter('geodir_cfa_cat_sort_url', '__return_empty_string', 10, 4);
|
|
| 2751 | +add_filter('geodir_cfa_cat_sort_fieldset', '__return_empty_string', 10, 4);
|
|
| 2752 | +add_filter('geodir_cfa_cat_sort_multiselect', '__return_empty_string', 10, 4);
|
|
| 2753 | +add_filter('geodir_cfa_cat_sort_textarea', '__return_empty_string', 10, 4);
|
|
| 2754 | +add_filter('geodir_cfa_cat_sort_taxonomy', '__return_empty_string', 10, 4);
|
|
| 2755 | +add_filter('geodir_cfa_cat_sort_address', '__return_empty_string', 10, 4);
|
|
| 2756 | 2756 | |
| 2757 | 2757 | |
| 2758 | 2758 | |
| 2759 | -function geodir_cfa_advanced_editor_geodir_special_offers($output,$result_str,$cf,$field_info){
|
|
| 2760 | - if($field_info->htmlvar_name != 'geodir_special_offers'){return '';}
|
|
| 2759 | +function geodir_cfa_advanced_editor_geodir_special_offers($output, $result_str, $cf, $field_info) {
|
|
| 2760 | + if ($field_info->htmlvar_name != 'geodir_special_offers') {return ''; }
|
|
| 2761 | 2761 | ob_start(); |
| 2762 | 2762 | ?> |
| 2763 | 2763 | <li> |
@@ -2788,16 +2788,16 @@ discard block |
||
| 2788 | 2788 | $output = ob_get_clean(); |
| 2789 | 2789 | return $output; |
| 2790 | 2790 | } |
| 2791 | -add_filter('geodir_cfa_advanced_editor_textarea','geodir_cfa_advanced_editor_geodir_special_offers',10,4);
|
|
| 2791 | +add_filter('geodir_cfa_advanced_editor_textarea', 'geodir_cfa_advanced_editor_geodir_special_offers', 10, 4);
|
|
| 2792 | 2792 | |
| 2793 | 2793 | |
| 2794 | -function geodir_cfa_validation_pattern_text($output,$result_str,$cf,$field_info){
|
|
| 2794 | +function geodir_cfa_validation_pattern_text($output, $result_str, $cf, $field_info) {
|
|
| 2795 | 2795 | ob_start(); |
| 2796 | 2796 | |
| 2797 | 2797 | $value = ''; |
| 2798 | 2798 | if (isset($field_info->validation_pattern)) {
|
| 2799 | 2799 | $value = esc_attr($field_info->validation_pattern); |
| 2800 | - }elseif(isset($cf['defaults']['validation_pattern']) && $cf['defaults']['validation_pattern']){
|
|
| 2800 | + }elseif (isset($cf['defaults']['validation_pattern']) && $cf['defaults']['validation_pattern']) {
|
|
| 2801 | 2801 | $value = esc_attr($cf['defaults']['validation_pattern']); |
| 2802 | 2802 | } |
| 2803 | 2803 | ?> |
@@ -2817,7 +2817,7 @@ discard block |
||
| 2817 | 2817 | $value = ''; |
| 2818 | 2818 | if (isset($field_info->validation_msg)) {
|
| 2819 | 2819 | $value = esc_attr($field_info->validation_msg); |
| 2820 | - }elseif(isset($cf['defaults']['validation_msg']) && $cf['defaults']['validation_msg']){
|
|
| 2820 | + }elseif (isset($cf['defaults']['validation_msg']) && $cf['defaults']['validation_msg']) {
|
|
| 2821 | 2821 | $value = esc_attr($cf['defaults']['validation_msg']); |
| 2822 | 2822 | } |
| 2823 | 2823 | ?> |
@@ -2838,10 +2838,10 @@ discard block |
||
| 2838 | 2838 | $output = ob_get_clean(); |
| 2839 | 2839 | return $output; |
| 2840 | 2840 | } |
| 2841 | -add_filter('geodir_cfa_validation_pattern_text','geodir_cfa_validation_pattern_text',10,4);
|
|
| 2841 | +add_filter('geodir_cfa_validation_pattern_text', 'geodir_cfa_validation_pattern_text', 10, 4);
|
|
| 2842 | 2842 | |
| 2843 | 2843 | |
| 2844 | -function geodir_cfa_htmlvar_name_taxonomy($output,$result_str,$cf,$field_info){
|
|
| 2844 | +function geodir_cfa_htmlvar_name_taxonomy($output, $result_str, $cf, $field_info) {
|
|
| 2845 | 2845 | ob_start(); |
| 2846 | 2846 | global $post_type; |
| 2847 | 2847 | |
@@ -2866,7 +2866,7 @@ discard block |
||
| 2866 | 2866 | ?> |
| 2867 | 2867 | <option <?php if (isset($field_info->htmlvar_name) && $field_info->htmlvar_name == $gd_tax) {
|
| 2868 | 2868 | echo 'selected="selected"'; |
| 2869 | - }?> id="<?php echo $gd_tax;?>"><?php echo $gd_tax;?></option><?php |
|
| 2869 | + }?> id="<?php echo $gd_tax; ?>"><?php echo $gd_tax; ?></option><?php |
|
| 2870 | 2870 | } |
| 2871 | 2871 | ?> |
| 2872 | 2872 | </select> |
@@ -2877,7 +2877,7 @@ discard block |
||
| 2877 | 2877 | <label for="cat_display_type" class="gd-cf-tooltip-wrap"> |
| 2878 | 2878 | <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Category display type :', 'geodirectory'); ?>
|
| 2879 | 2879 | <div class="gdcf-tooltip"> |
| 2880 | - <?php _e('Show categories list as select, multiselect, checkbox or radio', 'geodirectory');?>
|
|
| 2880 | + <?php _e('Show categories list as select, multiselect, checkbox or radio', 'geodirectory'); ?>
|
|
| 2881 | 2881 | </div> |
| 2882 | 2882 | </label> |
| 2883 | 2883 | <div class="gd-cf-input-wrap"> |
@@ -2885,19 +2885,19 @@ discard block |
||
| 2885 | 2885 | <select name="cat_display_type" id="cat_display_type"> |
| 2886 | 2886 | <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'ajax_chained') {
|
| 2887 | 2887 | echo 'selected="selected"'; |
| 2888 | - }?> value="ajax_chained"><?php _e('Ajax Chained', 'geodirectory');?></option>
|
|
| 2888 | + }?> value="ajax_chained"><?php _e('Ajax Chained', 'geodirectory'); ?></option>
|
|
| 2889 | 2889 | <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'select') {
|
| 2890 | 2890 | echo 'selected="selected"'; |
| 2891 | - }?> value="select"><?php _e('Select', 'geodirectory');?></option>
|
|
| 2891 | + }?> value="select"><?php _e('Select', 'geodirectory'); ?></option>
|
|
| 2892 | 2892 | <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'multiselect') {
|
| 2893 | 2893 | echo 'selected="selected"'; |
| 2894 | - }?> value="multiselect"><?php _e('Multiselect', 'geodirectory');?></option>
|
|
| 2894 | + }?> value="multiselect"><?php _e('Multiselect', 'geodirectory'); ?></option>
|
|
| 2895 | 2895 | <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'checkbox') {
|
| 2896 | 2896 | echo 'selected="selected"'; |
| 2897 | - }?> value="checkbox"><?php _e('Checkbox', 'geodirectory');?></option>
|
|
| 2897 | + }?> value="checkbox"><?php _e('Checkbox', 'geodirectory'); ?></option>
|
|
| 2898 | 2898 | <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'radio') {
|
| 2899 | 2899 | echo 'selected="selected"'; |
| 2900 | - }?> value="radio"><?php _e('Radio', 'geodirectory');?></option>
|
|
| 2900 | + }?> value="radio"><?php _e('Radio', 'geodirectory'); ?></option>
|
|
| 2901 | 2901 | </select> |
| 2902 | 2902 | </div> |
| 2903 | 2903 | </li> |
@@ -2906,10 +2906,10 @@ discard block |
||
| 2906 | 2906 | $output = ob_get_clean(); |
| 2907 | 2907 | return $output; |
| 2908 | 2908 | } |
| 2909 | -add_filter('geodir_cfa_htmlvar_name_taxonomy','geodir_cfa_htmlvar_name_taxonomy',10,4);
|
|
| 2909 | +add_filter('geodir_cfa_htmlvar_name_taxonomy', 'geodir_cfa_htmlvar_name_taxonomy', 10, 4);
|
|
| 2910 | 2910 | |
| 2911 | 2911 | |
| 2912 | -function geodir_cfa_extra_fields_address($output,$result_str,$cf,$field_info){
|
|
| 2912 | +function geodir_cfa_extra_fields_address($output, $result_str, $cf, $field_info) {
|
|
| 2913 | 2913 | |
| 2914 | 2914 | ob_start(); |
| 2915 | 2915 | if (isset($field_info->extra_fields) && $field_info->extra_fields != '') {
|
@@ -2932,32 +2932,32 @@ discard block |
||
| 2932 | 2932 | <label for="show_zip" class="gd-cf-tooltip-wrap"> |
| 2933 | 2933 | <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Display zip/post code :', 'geodirectory'); ?>
|
| 2934 | 2934 | <div class="gdcf-tooltip"> |
| 2935 | - <?php _e('Select if you want to show zip/post code field in address section.', 'geodirectory');?>
|
|
| 2935 | + <?php _e('Select if you want to show zip/post code field in address section.', 'geodirectory'); ?>
|
|
| 2936 | 2936 | </div> |
| 2937 | 2937 | </label> |
| 2938 | 2938 | <div class="gd-cf-input-wrap gd-switch"> |
| 2939 | 2939 | |
| 2940 | - <input type="radio" id="show_zip_yes<?php echo $radio_id;?>" name="extra[show_zip]" class="gdri-enabled" value="1" |
|
| 2940 | + <input type="radio" id="show_zip_yes<?php echo $radio_id; ?>" name="extra[show_zip]" class="gdri-enabled" value="1" |
|
| 2941 | 2941 | <?php if (isset($address['show_zip']) && $address['show_zip'] == '1') {
|
| 2942 | 2942 | echo 'checked'; |
| 2943 | 2943 | } ?>/> |
| 2944 | - <label onclick="show_hide_radio(this,'show','cf-zip-lable');" for="show_zip_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
|
|
| 2944 | + <label onclick="show_hide_radio(this,'show','cf-zip-lable');" for="show_zip_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
|
|
| 2945 | 2945 | |
| 2946 | - <input type="radio" id="show_zip_no<?php echo $radio_id;?>" name="extra[show_zip]" class="gdri-disabled" value="0" |
|
| 2946 | + <input type="radio" id="show_zip_no<?php echo $radio_id; ?>" name="extra[show_zip]" class="gdri-disabled" value="0" |
|
| 2947 | 2947 | <?php if ((isset($address['show_zip']) && !$address['show_zip']) || !isset($address['show_zip'])) {
|
| 2948 | 2948 | echo 'checked'; |
| 2949 | 2949 | } ?>/> |
| 2950 | - <label onclick="show_hide_radio(this,'hide','cf-zip-lable');" for="show_zip_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
|
|
| 2950 | + <label onclick="show_hide_radio(this,'hide','cf-zip-lable');" for="show_zip_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
|
|
| 2951 | 2951 | |
| 2952 | 2952 | |
| 2953 | 2953 | </div> |
| 2954 | 2954 | </li> |
| 2955 | 2955 | |
| 2956 | - <li class="cf-zip-lable" <?php if ((isset($address['show_zip']) && !$address['show_zip']) || !isset($address['show_zip'])) {echo "style='display:none;'";}?> >
|
|
| 2956 | + <li class="cf-zip-lable" <?php if ((isset($address['show_zip']) && !$address['show_zip']) || !isset($address['show_zip'])) {echo "style='display:none;'"; }?> >
|
|
| 2957 | 2957 | <label for="zip_lable" class="gd-cf-tooltip-wrap"> |
| 2958 | 2958 | <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Zip/Post code label :', 'geodirectory'); ?>
|
| 2959 | 2959 | <div class="gdcf-tooltip"> |
| 2960 | - <?php _e('Enter zip/post code field label in address section.', 'geodirectory');?>
|
|
| 2960 | + <?php _e('Enter zip/post code field label in address section.', 'geodirectory'); ?>
|
|
| 2961 | 2961 | </div> |
| 2962 | 2962 | </label> |
| 2963 | 2963 | <div class="gd-cf-input-wrap"> |
@@ -2975,7 +2975,7 @@ discard block |
||
| 2975 | 2975 | <label for="map_lable" class="gd-cf-tooltip-wrap"> |
| 2976 | 2976 | <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Map button label :', 'geodirectory'); ?>
|
| 2977 | 2977 | <div class="gdcf-tooltip"> |
| 2978 | - <?php _e('Enter text for `set address on map` button in address section.', 'geodirectory');?>
|
|
| 2978 | + <?php _e('Enter text for `set address on map` button in address section.', 'geodirectory'); ?>
|
|
| 2979 | 2979 | </div> |
| 2980 | 2980 | </label> |
| 2981 | 2981 | <div class="gd-cf-input-wrap"> |
@@ -2990,22 +2990,22 @@ discard block |
||
| 2990 | 2990 | <label for="show_mapzoom" class="gd-cf-tooltip-wrap"> |
| 2991 | 2991 | <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Use user zoom level:', 'geodirectory'); ?>
|
| 2992 | 2992 | <div class="gdcf-tooltip"> |
| 2993 | - <?php _e('Do you want to use the user defined map zoom level from the add listing page?', 'geodirectory');?>
|
|
| 2993 | + <?php _e('Do you want to use the user defined map zoom level from the add listing page?', 'geodirectory'); ?>
|
|
| 2994 | 2994 | </div> |
| 2995 | 2995 | </label> |
| 2996 | 2996 | <div class="gd-cf-input-wrap gd-switch"> |
| 2997 | 2997 | |
| 2998 | - <input type="radio" id="show_mapzoom_yes<?php echo $radio_id;?>" name="extra[show_mapzoom]" class="gdri-enabled" value="1" |
|
| 2998 | + <input type="radio" id="show_mapzoom_yes<?php echo $radio_id; ?>" name="extra[show_mapzoom]" class="gdri-enabled" value="1" |
|
| 2999 | 2999 | <?php if (isset($address['show_mapzoom']) && $address['show_mapzoom'] == '1') {
|
| 3000 | 3000 | echo 'checked'; |
| 3001 | 3001 | } ?>/> |
| 3002 | - <label for="show_mapzoom_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
|
|
| 3002 | + <label for="show_mapzoom_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
|
|
| 3003 | 3003 | |
| 3004 | - <input type="radio" id="show_mapzoom_no<?php echo $radio_id;?>" name="extra[show_mapzoom]" class="gdri-disabled" value="0" |
|
| 3004 | + <input type="radio" id="show_mapzoom_no<?php echo $radio_id; ?>" name="extra[show_mapzoom]" class="gdri-disabled" value="0" |
|
| 3005 | 3005 | <?php if ((isset($address['show_mapzoom']) && !$address['show_mapzoom']) || !isset($address['show_mapzoom'])) {
|
| 3006 | 3006 | echo 'checked'; |
| 3007 | 3007 | } ?>/> |
| 3008 | - <label for="show_mapzoom_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
|
|
| 3008 | + <label for="show_mapzoom_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
|
|
| 3009 | 3009 | |
| 3010 | 3010 | </div> |
| 3011 | 3011 | </li> |
@@ -3014,22 +3014,22 @@ discard block |
||
| 3014 | 3014 | <label for="show_mapview" class="gd-cf-tooltip-wrap"> |
| 3015 | 3015 | <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Display map view:', 'geodirectory'); ?>
|
| 3016 | 3016 | <div class="gdcf-tooltip"> |
| 3017 | - <?php _e('Select if you want to `set default map` options in address section. ( Satellite Map, Hybrid Map, Terrain Map)', 'geodirectory');?>
|
|
| 3017 | + <?php _e('Select if you want to `set default map` options in address section. ( Satellite Map, Hybrid Map, Terrain Map)', 'geodirectory'); ?>
|
|
| 3018 | 3018 | </div> |
| 3019 | 3019 | </label> |
| 3020 | 3020 | <div class="gd-cf-input-wrap gd-switch"> |
| 3021 | 3021 | |
| 3022 | - <input type="radio" id="show_mapview_yes<?php echo $radio_id;?>" name="extra[show_mapview]" class="gdri-enabled" value="1" |
|
| 3022 | + <input type="radio" id="show_mapview_yes<?php echo $radio_id; ?>" name="extra[show_mapview]" class="gdri-enabled" value="1" |
|
| 3023 | 3023 | <?php if (isset($address['show_mapview']) && $address['show_mapview'] == '1') {
|
| 3024 | 3024 | echo 'checked'; |
| 3025 | 3025 | } ?>/> |
| 3026 | - <label for="show_mapview_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
|
|
| 3026 | + <label for="show_mapview_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
|
|
| 3027 | 3027 | |
| 3028 | - <input type="radio" id="show_mapview_no<?php echo $radio_id;?>" name="extra[show_mapview]" class="gdri-disabled" value="0" |
|
| 3028 | + <input type="radio" id="show_mapview_no<?php echo $radio_id; ?>" name="extra[show_mapview]" class="gdri-disabled" value="0" |
|
| 3029 | 3029 | <?php if ((isset($address['show_mapview']) && !$address['show_mapview']) || !isset($address['show_mapview'])) {
|
| 3030 | 3030 | echo 'checked'; |
| 3031 | 3031 | } ?>/> |
| 3032 | - <label for="show_mapview_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
|
|
| 3032 | + <label for="show_mapview_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
|
|
| 3033 | 3033 | |
| 3034 | 3034 | </div> |
| 3035 | 3035 | </li> |
@@ -3039,7 +3039,7 @@ discard block |
||
| 3039 | 3039 | <label for="mapview_lable" class="gd-cf-tooltip-wrap"> |
| 3040 | 3040 | <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Map view label:', 'geodirectory'); ?>
|
| 3041 | 3041 | <div class="gdcf-tooltip"> |
| 3042 | - <?php _e('Enter mapview field label in address section.', 'geodirectory');?>
|
|
| 3042 | + <?php _e('Enter mapview field label in address section.', 'geodirectory'); ?>
|
|
| 3043 | 3043 | </div> |
| 3044 | 3044 | </label> |
| 3045 | 3045 | <div class="gd-cf-input-wrap"> |
@@ -3053,22 +3053,22 @@ discard block |
||
| 3053 | 3053 | <label for="show_latlng" class="gd-cf-tooltip-wrap"> |
| 3054 | 3054 | <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Show latitude and longitude', 'geodirectory'); ?>
|
| 3055 | 3055 | <div class="gdcf-tooltip"> |
| 3056 | - <?php _e('This will show/hide the longitude fields in the address section add listing form.', 'geodirectory');?>
|
|
| 3056 | + <?php _e('This will show/hide the longitude fields in the address section add listing form.', 'geodirectory'); ?>
|
|
| 3057 | 3057 | </div> |
| 3058 | 3058 | </label> |
| 3059 | 3059 | <div class="gd-cf-input-wrap gd-switch"> |
| 3060 | 3060 | |
| 3061 | - <input type="radio" id="show_latlng_yes<?php echo $radio_id;?>" name="extra[show_latlng]" class="gdri-enabled" value="1" |
|
| 3061 | + <input type="radio" id="show_latlng_yes<?php echo $radio_id; ?>" name="extra[show_latlng]" class="gdri-enabled" value="1" |
|
| 3062 | 3062 | <?php if (isset($address['show_latlng']) && $address['show_latlng'] == '1') {
|
| 3063 | 3063 | echo 'checked'; |
| 3064 | 3064 | } ?>/> |
| 3065 | - <label for="show_latlng_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
|
|
| 3065 | + <label for="show_latlng_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
|
|
| 3066 | 3066 | |
| 3067 | - <input type="radio" id="show_latlng_no<?php echo $radio_id;?>" name="extra[show_latlng]" class="gdri-disabled" value="0" |
|
| 3067 | + <input type="radio" id="show_latlng_no<?php echo $radio_id; ?>" name="extra[show_latlng]" class="gdri-disabled" value="0" |
|
| 3068 | 3068 | <?php if ((isset($address['show_latlng']) && !$address['show_latlng']) || !isset($address['show_latlng'])) {
|
| 3069 | 3069 | echo 'checked'; |
| 3070 | 3070 | } ?>/> |
| 3071 | - <label for="show_latlng_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
|
|
| 3071 | + <label for="show_latlng_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
|
|
| 3072 | 3072 | |
| 3073 | 3073 | </div> |
| 3074 | 3074 | </li> |
@@ -3077,17 +3077,17 @@ discard block |
||
| 3077 | 3077 | $html = ob_get_clean(); |
| 3078 | 3078 | return $output.$html; |
| 3079 | 3079 | } |
| 3080 | -add_filter('geodir_cfa_extra_fields_address','geodir_cfa_extra_fields_address',10,4);
|
|
| 3080 | +add_filter('geodir_cfa_extra_fields_address', 'geodir_cfa_extra_fields_address', 10, 4);
|
|
| 3081 | 3081 | |
| 3082 | 3082 | |
| 3083 | -function geodir_cfa_extra_fields_multiselect($output,$result_str,$cf,$field_info){
|
|
| 3083 | +function geodir_cfa_extra_fields_multiselect($output, $result_str, $cf, $field_info) {
|
|
| 3084 | 3084 | ob_start(); |
| 3085 | 3085 | ?> |
| 3086 | 3086 | <li> |
| 3087 | 3087 | <label for="multi_display_type" class="gd-cf-tooltip-wrap"> |
| 3088 | 3088 | <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Multiselect display type :', 'geodirectory'); ?>
|
| 3089 | 3089 | <div class="gdcf-tooltip"> |
| 3090 | - <?php _e('Show multiselect list as multiselect,checkbox or radio.', 'geodirectory');?>
|
|
| 3090 | + <?php _e('Show multiselect list as multiselect,checkbox or radio.', 'geodirectory'); ?>
|
|
| 3091 | 3091 | </div> |
| 3092 | 3092 | </label> |
| 3093 | 3093 | <div class="gd-cf-input-wrap"> |
@@ -3095,13 +3095,13 @@ discard block |
||
| 3095 | 3095 | <select name="multi_display_type" id="multi_display_type"> |
| 3096 | 3096 | <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'select') {
|
| 3097 | 3097 | echo 'selected="selected"'; |
| 3098 | - }?> value="select"><?php _e('Select', 'geodirectory');?></option>
|
|
| 3098 | + }?> value="select"><?php _e('Select', 'geodirectory'); ?></option>
|
|
| 3099 | 3099 | <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'checkbox') {
|
| 3100 | 3100 | echo 'selected="selected"'; |
| 3101 | - }?> value="checkbox"><?php _e('Checkbox', 'geodirectory');?></option>
|
|
| 3101 | + }?> value="checkbox"><?php _e('Checkbox', 'geodirectory'); ?></option>
|
|
| 3102 | 3102 | <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'radio') {
|
| 3103 | 3103 | echo 'selected="selected"'; |
| 3104 | - }?> value="radio"><?php _e('Radio', 'geodirectory');?></option>
|
|
| 3104 | + }?> value="radio"><?php _e('Radio', 'geodirectory'); ?></option>
|
|
| 3105 | 3105 | </select> |
| 3106 | 3106 | |
| 3107 | 3107 | <br/> |
@@ -3112,17 +3112,17 @@ discard block |
||
| 3112 | 3112 | $html = ob_get_clean(); |
| 3113 | 3113 | return $output.$html; |
| 3114 | 3114 | } |
| 3115 | -add_filter('geodir_cfa_extra_fields_multiselect','geodir_cfa_extra_fields_multiselect',10,4);
|
|
| 3115 | +add_filter('geodir_cfa_extra_fields_multiselect', 'geodir_cfa_extra_fields_multiselect', 10, 4);
|
|
| 3116 | 3116 | |
| 3117 | 3117 | |
| 3118 | -function geodir_cfa_extra_fields_smr($output,$result_str,$cf,$field_info){
|
|
| 3118 | +function geodir_cfa_extra_fields_smr($output, $result_str, $cf, $field_info) {
|
|
| 3119 | 3119 | |
| 3120 | 3120 | ob_start(); |
| 3121 | 3121 | |
| 3122 | 3122 | $value = ''; |
| 3123 | 3123 | if (isset($field_info->option_values)) {
|
| 3124 | 3124 | $value = esc_attr($field_info->option_values); |
| 3125 | - }elseif(isset($cf['defaults']['option_values']) && $cf['defaults']['option_values']){
|
|
| 3125 | + }elseif (isset($cf['defaults']['option_values']) && $cf['defaults']['option_values']) {
|
|
| 3126 | 3126 | $value = esc_attr($cf['defaults']['option_values']); |
| 3127 | 3127 | } |
| 3128 | 3128 | |
@@ -3132,11 +3132,11 @@ discard block |
||
| 3132 | 3132 | <label for="option_values" class="gd-cf-tooltip-wrap"> |
| 3133 | 3133 | <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Option Values :', 'geodirectory'); ?>
|
| 3134 | 3134 | <div class="gdcf-tooltip"> |
| 3135 | - <span><?php _e('Option Values should be separated by comma.', 'geodirectory');?></span>
|
|
| 3135 | + <span><?php _e('Option Values should be separated by comma.', 'geodirectory'); ?></span>
|
|
| 3136 | 3136 | <br/> |
| 3137 | - <small><span><?php _e('If using for a "tick filter" place a / and then either a 1 for true or 0 for false', 'geodirectory');?></span>
|
|
| 3137 | + <small><span><?php _e('If using for a "tick filter" place a / and then either a 1 for true or 0 for false', 'geodirectory'); ?></span>
|
|
| 3138 | 3138 | <br/> |
| 3139 | - <span><?php _e('eg: "No Dogs Allowed/0,Dogs Allowed/1" (Select only, not multiselect)', 'geodirectory');?></span>
|
|
| 3139 | + <span><?php _e('eg: "No Dogs Allowed/0,Dogs Allowed/1" (Select only, not multiselect)', 'geodirectory'); ?></span>
|
|
| 3140 | 3140 | <?php if ($field_type == 'multiselect' || $field_type == 'select') { ?>
|
| 3141 | 3141 | <br/> |
| 3142 | 3142 | <span><?php _e('- If using OPTGROUP tag to grouping options, use "{optgroup}OPTGROUP-LABEL|OPTION-1,OPTION-2{/optgroup}"', 'geodirectory'); ?></span>
|
@@ -3147,7 +3147,7 @@ discard block |
||
| 3147 | 3147 | </label> |
| 3148 | 3148 | <div class="gd-cf-input-wrap"> |
| 3149 | 3149 | <input type="text" name="option_values" id="option_values" |
| 3150 | - value="<?php echo $value;?>"/> |
|
| 3150 | + value="<?php echo $value; ?>"/> |
|
| 3151 | 3151 | <br/> |
| 3152 | 3152 | |
| 3153 | 3153 | </div> |
@@ -3157,12 +3157,12 @@ discard block |
||
| 3157 | 3157 | $html = ob_get_clean(); |
| 3158 | 3158 | return $output.$html; |
| 3159 | 3159 | } |
| 3160 | -add_filter('geodir_cfa_extra_fields_multiselect','geodir_cfa_extra_fields_smr',10,4);
|
|
| 3161 | -add_filter('geodir_cfa_extra_fields_select','geodir_cfa_extra_fields_smr',10,4);
|
|
| 3162 | -add_filter('geodir_cfa_extra_fields_radio','geodir_cfa_extra_fields_smr',10,4);
|
|
| 3160 | +add_filter('geodir_cfa_extra_fields_multiselect', 'geodir_cfa_extra_fields_smr', 10, 4);
|
|
| 3161 | +add_filter('geodir_cfa_extra_fields_select', 'geodir_cfa_extra_fields_smr', 10, 4);
|
|
| 3162 | +add_filter('geodir_cfa_extra_fields_radio', 'geodir_cfa_extra_fields_smr', 10, 4);
|
|
| 3163 | 3163 | |
| 3164 | 3164 | |
| 3165 | -function geodir_cfa_extra_fields_datepicker($output,$result_str,$cf,$field_info){
|
|
| 3165 | +function geodir_cfa_extra_fields_datepicker($output, $result_str, $cf, $field_info) {
|
|
| 3166 | 3166 | ob_start(); |
| 3167 | 3167 | $extra = array(); |
| 3168 | 3168 | if (isset($field_info->extra_fields) && $field_info->extra_fields != '') {
|
@@ -3173,7 +3173,7 @@ discard block |
||
| 3173 | 3173 | <label for="date_format" class="gd-cf-tooltip-wrap"> |
| 3174 | 3174 | <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Date Format :', 'geodirectory'); ?>
|
| 3175 | 3175 | <div class="gdcf-tooltip"> |
| 3176 | - <?php _e('Select the date format.', 'geodirectory');?>
|
|
| 3176 | + <?php _e('Select the date format.', 'geodirectory'); ?>
|
|
| 3177 | 3177 | </div> |
| 3178 | 3178 | </label> |
| 3179 | 3179 | <div class="gd-cf-input-wrap" style="overflow:inherit;"> |
@@ -3193,16 +3193,16 @@ discard block |
||
| 3193 | 3193 | * @since 1.6.5 |
| 3194 | 3194 | * @param array $date_formats The PHP date format array. |
| 3195 | 3195 | */ |
| 3196 | - $date_formats = apply_filters('geodir_date_formats',$date_formats);
|
|
| 3196 | + $date_formats = apply_filters('geodir_date_formats', $date_formats);
|
|
| 3197 | 3197 | ?> |
| 3198 | 3198 | <select name="extra[date_format]" id="date_format"> |
| 3199 | 3199 | <?php |
| 3200 | - foreach($date_formats as $format){
|
|
| 3200 | + foreach ($date_formats as $format) {
|
|
| 3201 | 3201 | $selected = ''; |
| 3202 | - if(!empty($extra) && esc_attr($extra['date_format'])==$format){
|
|
| 3202 | + if (!empty($extra) && esc_attr($extra['date_format']) == $format) {
|
|
| 3203 | 3203 | $selected = "selected='selected'"; |
| 3204 | 3204 | } |
| 3205 | - echo "<option $selected value='$format'>$format (".date_i18n( $format, time()).")</option>";
|
|
| 3205 | + echo "<option $selected value='$format'>$format (".date_i18n($format, time()).")</option>";
|
|
| 3206 | 3206 | } |
| 3207 | 3207 | ?> |
| 3208 | 3208 | </select> |
@@ -3214,10 +3214,10 @@ discard block |
||
| 3214 | 3214 | $html = ob_get_clean(); |
| 3215 | 3215 | return $output.$html; |
| 3216 | 3216 | } |
| 3217 | -add_filter('geodir_cfa_extra_fields_datepicker','geodir_cfa_extra_fields_datepicker',10,4);
|
|
| 3217 | +add_filter('geodir_cfa_extra_fields_datepicker', 'geodir_cfa_extra_fields_datepicker', 10, 4);
|
|
| 3218 | 3218 | |
| 3219 | 3219 | |
| 3220 | -function geodir_cfa_extra_fields_file($output,$result_str,$cf,$field_info){
|
|
| 3220 | +function geodir_cfa_extra_fields_file($output, $result_str, $cf, $field_info) {
|
|
| 3221 | 3221 | ob_start(); |
| 3222 | 3222 | $allowed_file_types = geodir_allowed_mime_types(); |
| 3223 | 3223 | |
@@ -3228,16 +3228,16 @@ discard block |
||
| 3228 | 3228 | <label for="gd_file_types" class="gd-cf-tooltip-wrap"> |
| 3229 | 3229 | <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Allowed file types :', 'geodirectory'); ?>
|
| 3230 | 3230 | <div class="gdcf-tooltip"> |
| 3231 | - <?php _e('Select file types to allowed for file uploading. (Select multiple file types by holding down "Ctrl" key.)', 'geodirectory');?>
|
|
| 3231 | + <?php _e('Select file types to allowed for file uploading. (Select multiple file types by holding down "Ctrl" key.)', 'geodirectory'); ?>
|
|
| 3232 | 3232 | </div> |
| 3233 | 3233 | </label> |
| 3234 | 3234 | <div class="gd-cf-input-wrap"> |
| 3235 | 3235 | <select name="extra[gd_file_types][]" id="gd_file_types" multiple="multiple" style="height:100px;width:90%;"> |
| 3236 | - <option value="*" <?php selected(true, in_array('*', $gd_file_types));?>><?php _e('All types', 'geodirectory') ;?></option>
|
|
| 3237 | - <?php foreach ( $allowed_file_types as $format => $types ) { ?>
|
|
| 3238 | - <optgroup label="<?php echo esc_attr( wp_sprintf(__('%s formats', 'geodirectory'), __($format, 'geodirectory') ) ) ;?>">
|
|
| 3239 | - <?php foreach ( $types as $ext => $type ) { ?>
|
|
| 3240 | - <option value="<?php echo esc_attr($ext) ;?>" <?php selected(true, in_array($ext, $gd_file_types));?>><?php echo '.' . $ext ;?></option> |
|
| 3236 | + <option value="*" <?php selected(true, in_array('*', $gd_file_types)); ?>><?php _e('All types', 'geodirectory'); ?></option>
|
|
| 3237 | + <?php foreach ($allowed_file_types as $format => $types) { ?>
|
|
| 3238 | + <optgroup label="<?php echo esc_attr(wp_sprintf(__('%s formats', 'geodirectory'), __($format, 'geodirectory'))); ?>">
|
|
| 3239 | + <?php foreach ($types as $ext => $type) { ?>
|
|
| 3240 | + <option value="<?php echo esc_attr($ext); ?>" <?php selected(true, in_array($ext, $gd_file_types)); ?>><?php echo '.'.$ext; ?></option> |
|
| 3241 | 3241 | <?php } ?> |
| 3242 | 3242 | </optgroup> |
| 3243 | 3243 | <?php } ?> |
@@ -3249,9 +3249,9 @@ discard block |
||
| 3249 | 3249 | $html = ob_get_clean(); |
| 3250 | 3250 | return $output.$html; |
| 3251 | 3251 | } |
| 3252 | -add_filter('geodir_cfa_extra_fields_file','geodir_cfa_extra_fields_file',10,4);
|
|
| 3252 | +add_filter('geodir_cfa_extra_fields_file', 'geodir_cfa_extra_fields_file', 10, 4);
|
|
| 3253 | 3253 | |
| 3254 | -function geodir_cfa_extra_fields_text($output,$result_str,$cf,$field_info){
|
|
| 3254 | +function geodir_cfa_extra_fields_text($output, $result_str, $cf, $field_info) {
|
|
| 3255 | 3255 | ob_start(); |
| 3256 | 3256 | |
| 3257 | 3257 | $extra_fields = isset($field_info->extra_fields) && $field_info->extra_fields != '' ? maybe_unserialize($field_info->extra_fields) : ''; |
@@ -3265,15 +3265,15 @@ discard block |
||
| 3265 | 3265 | $value = ''; |
| 3266 | 3266 | if ($extra_fields && isset($extra_fields['is_price'])) {
|
| 3267 | 3267 | $value = esc_attr($extra_fields['is_price']); |
| 3268 | - }elseif(isset($cf['defaults']['extra_fields']['is_price']) && $cf['defaults']['extra_fields']['is_price']){
|
|
| 3268 | + }elseif (isset($cf['defaults']['extra_fields']['is_price']) && $cf['defaults']['extra_fields']['is_price']) {
|
|
| 3269 | 3269 | $value = esc_attr($cf['defaults']['extra_fields']['is_price']); |
| 3270 | 3270 | } |
| 3271 | 3271 | |
| 3272 | - $show_price_extra = ($value==1) ? 1 : 0; |
|
| 3272 | + $show_price_extra = ($value == 1) ? 1 : 0; |
|
| 3273 | 3273 | |
| 3274 | - $show_price = (isset($field_info->data_type) && ($field_info->data_type=='INT' && $field_info->data_type=='FLOAT')) ? 1 : 0; |
|
| 3274 | + $show_price = (isset($field_info->data_type) && ($field_info->data_type == 'INT' && $field_info->data_type == 'FLOAT')) ? 1 : 0; |
|
| 3275 | 3275 | ?> |
| 3276 | - <li class="gdcf-price-extra-set" <?php if(!$show_price){ echo "style='display:none;'";}?>>
|
|
| 3276 | + <li class="gdcf-price-extra-set" <?php if (!$show_price) { echo "style='display:none;'"; }?>>
|
|
| 3277 | 3277 | <label for="is_price" class="gd-cf-tooltip-wrap"> |
| 3278 | 3278 | <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Display as price? :', 'geodirectory'); ?>
|
| 3279 | 3279 | <div class="gdcf-tooltip"> |
@@ -3282,17 +3282,17 @@ discard block |
||
| 3282 | 3282 | </label> |
| 3283 | 3283 | <div class="gd-cf-input-wrap gd-switch"> |
| 3284 | 3284 | |
| 3285 | - <input type="radio" id="is_price_yes<?php echo $radio_id;?>" name="extra[is_price]" class="gdri-enabled" value="1" |
|
| 3285 | + <input type="radio" id="is_price_yes<?php echo $radio_id; ?>" name="extra[is_price]" class="gdri-enabled" value="1" |
|
| 3286 | 3286 | <?php if ($value == '1') {
|
| 3287 | 3287 | echo 'checked'; |
| 3288 | 3288 | } ?>/> |
| 3289 | - <label onclick="show_hide_radio(this,'show','gdcf-price-extra');" for="is_price_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
|
|
| 3289 | + <label onclick="show_hide_radio(this,'show','gdcf-price-extra');" for="is_price_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
|
|
| 3290 | 3290 | |
| 3291 | - <input type="radio" id="is_price_no<?php echo $radio_id;?>" name="extra[is_price]" class="gdri-disabled" value="0" |
|
| 3291 | + <input type="radio" id="is_price_no<?php echo $radio_id; ?>" name="extra[is_price]" class="gdri-disabled" value="0" |
|
| 3292 | 3292 | <?php if ($value == '0' || !$value) {
|
| 3293 | 3293 | echo 'checked'; |
| 3294 | 3294 | } ?>/> |
| 3295 | - <label onclick="show_hide_radio(this,'hide','gdcf-price-extra');" for="is_price_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
|
|
| 3295 | + <label onclick="show_hide_radio(this,'hide','gdcf-price-extra');" for="is_price_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
|
|
| 3296 | 3296 | |
| 3297 | 3297 | </div> |
| 3298 | 3298 | </li> |
@@ -3302,23 +3302,23 @@ discard block |
||
| 3302 | 3302 | $value = ''; |
| 3303 | 3303 | if ($extra_fields && isset($extra_fields['thousand_separator'])) {
|
| 3304 | 3304 | $value = esc_attr($extra_fields['thousand_separator']); |
| 3305 | - }elseif(isset($cf['defaults']['extra_fields']['thousand_separator']) && $cf['defaults']['extra_fields']['thousand_separator']){
|
|
| 3305 | + }elseif (isset($cf['defaults']['extra_fields']['thousand_separator']) && $cf['defaults']['extra_fields']['thousand_separator']) {
|
|
| 3306 | 3306 | $value = esc_attr($cf['defaults']['extra_fields']['thousand_separator']); |
| 3307 | 3307 | } |
| 3308 | 3308 | ?> |
| 3309 | - <li class="gdcf-price-extra" <?php if(!$show_price_extra){ echo "style='display:none;'";}?>>
|
|
| 3310 | - <label for="thousand_separator" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Thousand separator :', 'geodirectory');?>
|
|
| 3309 | + <li class="gdcf-price-extra" <?php if (!$show_price_extra) { echo "style='display:none;'"; }?>>
|
|
| 3310 | + <label for="thousand_separator" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Thousand separator :', 'geodirectory'); ?>
|
|
| 3311 | 3311 | <div class="gdcf-tooltip"> |
| 3312 | 3312 | <?php _e('Select the thousand separator.', 'geodirectory'); ?>
|
| 3313 | 3313 | </div> |
| 3314 | 3314 | </label> |
| 3315 | 3315 | <div class="gd-cf-input-wrap"> |
| 3316 | 3316 | <select name="extra[thousand_separator]" id="thousand_separator"> |
| 3317 | - <option value="comma" <?php selected(true, $value == 'comma');?>><?php _e(', (comma)', 'geodirectory'); ?></option>
|
|
| 3318 | - <option value="slash" <?php selected(true, $value == "slash");?>><?php _e('\ (slash)', 'geodirectory'); ?></option>
|
|
| 3319 | - <option value="period" <?php selected(true, $value == 'period');?>><?php _e('. (period)', 'geodirectory'); ?></option>
|
|
| 3320 | - <option value="space" <?php selected(true, $value == 'space');?>><?php _e(' (space)', 'geodirectory'); ?></option>
|
|
| 3321 | - <option value="none" <?php selected(true, $value == 'none');?>><?php _e('(none)', 'geodirectory'); ?></option>
|
|
| 3317 | + <option value="comma" <?php selected(true, $value == 'comma'); ?>><?php _e(', (comma)', 'geodirectory'); ?></option>
|
|
| 3318 | + <option value="slash" <?php selected(true, $value == "slash"); ?>><?php _e('\ (slash)', 'geodirectory'); ?></option>
|
|
| 3319 | + <option value="period" <?php selected(true, $value == 'period'); ?>><?php _e('. (period)', 'geodirectory'); ?></option>
|
|
| 3320 | + <option value="space" <?php selected(true, $value == 'space'); ?>><?php _e(' (space)', 'geodirectory'); ?></option>
|
|
| 3321 | + <option value="none" <?php selected(true, $value == 'none'); ?>><?php _e('(none)', 'geodirectory'); ?></option>
|
|
| 3322 | 3322 | </select> |
| 3323 | 3323 | </div> |
| 3324 | 3324 | </li> |
@@ -3329,20 +3329,20 @@ discard block |
||
| 3329 | 3329 | $value = ''; |
| 3330 | 3330 | if ($extra_fields && isset($extra_fields['decimal_separator'])) {
|
| 3331 | 3331 | $value = esc_attr($extra_fields['decimal_separator']); |
| 3332 | - }elseif(isset($cf['defaults']['extra_fields']['decimal_separator']) && $cf['defaults']['extra_fields']['decimal_separator']){
|
|
| 3332 | + }elseif (isset($cf['defaults']['extra_fields']['decimal_separator']) && $cf['defaults']['extra_fields']['decimal_separator']) {
|
|
| 3333 | 3333 | $value = esc_attr($cf['defaults']['extra_fields']['decimal_separator']); |
| 3334 | 3334 | } |
| 3335 | 3335 | ?> |
| 3336 | - <li class="gdcf-price-extra" <?php if(!$show_price_extra){ echo "style='display:none;'";}?>>
|
|
| 3337 | - <label for="decimal_separator" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Decimal separator :', 'geodirectory');?>
|
|
| 3336 | + <li class="gdcf-price-extra" <?php if (!$show_price_extra) { echo "style='display:none;'"; }?>>
|
|
| 3337 | + <label for="decimal_separator" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Decimal separator :', 'geodirectory'); ?>
|
|
| 3338 | 3338 | <div class="gdcf-tooltip"> |
| 3339 | 3339 | <?php _e('Select the decimal separator.', 'geodirectory'); ?>
|
| 3340 | 3340 | </div> |
| 3341 | 3341 | </label> |
| 3342 | 3342 | <div class="gd-cf-input-wrap"> |
| 3343 | 3343 | <select name="extra[decimal_separator]" id="decimal_separator"> |
| 3344 | - <option value="period" <?php selected(true, $value == 'period');?>><?php _e('. (period)', 'geodirectory'); ?></option>
|
|
| 3345 | - <option value="comma" <?php selected(true, $value == "comma");?>><?php _e(', (comma)', 'geodirectory'); ?></option>
|
|
| 3344 | + <option value="period" <?php selected(true, $value == 'period'); ?>><?php _e('. (period)', 'geodirectory'); ?></option>
|
|
| 3345 | + <option value="comma" <?php selected(true, $value == "comma"); ?>><?php _e(', (comma)', 'geodirectory'); ?></option>
|
|
| 3346 | 3346 | </select> |
| 3347 | 3347 | </div> |
| 3348 | 3348 | </li> |
@@ -3352,20 +3352,20 @@ discard block |
||
| 3352 | 3352 | $value = ''; |
| 3353 | 3353 | if ($extra_fields && isset($extra_fields['decimal_display'])) {
|
| 3354 | 3354 | $value = esc_attr($extra_fields['decimal_display']); |
| 3355 | - }elseif(isset($cf['defaults']['extra_fields']['decimal_display']) && $cf['defaults']['extra_fields']['decimal_display']){
|
|
| 3355 | + }elseif (isset($cf['defaults']['extra_fields']['decimal_display']) && $cf['defaults']['extra_fields']['decimal_display']) {
|
|
| 3356 | 3356 | $value = esc_attr($cf['defaults']['extra_fields']['decimal_display']); |
| 3357 | 3357 | } |
| 3358 | 3358 | ?> |
| 3359 | - <li class="gdcf-price-extra" <?php if(!$show_price_extra){ echo "style='display:none;'";}?>>
|
|
| 3360 | - <label for="decimal_display" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Decimal display :', 'geodirectory');?>
|
|
| 3359 | + <li class="gdcf-price-extra" <?php if (!$show_price_extra) { echo "style='display:none;'"; }?>>
|
|
| 3360 | + <label for="decimal_display" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Decimal display :', 'geodirectory'); ?>
|
|
| 3361 | 3361 | <div class="gdcf-tooltip"> |
| 3362 | 3362 | <?php _e('Select how the decimal is displayed', 'geodirectory'); ?>
|
| 3363 | 3363 | </div> |
| 3364 | 3364 | </label> |
| 3365 | 3365 | <div class="gd-cf-input-wrap"> |
| 3366 | 3366 | <select name="extra[decimal_display]" id="decimal_display"> |
| 3367 | - <option value="if" <?php selected(true, $value == 'if');?>><?php _e('If used (not .00)', 'geodirectory'); ?></option>
|
|
| 3368 | - <option value="allways" <?php selected(true, $value == "allways");?>><?php _e('Always (.00)', 'geodirectory'); ?></option>
|
|
| 3367 | + <option value="if" <?php selected(true, $value == 'if'); ?>><?php _e('If used (not .00)', 'geodirectory'); ?></option>
|
|
| 3368 | + <option value="allways" <?php selected(true, $value == "allways"); ?>><?php _e('Always (.00)', 'geodirectory'); ?></option>
|
|
| 3369 | 3369 | </select> |
| 3370 | 3370 | </div> |
| 3371 | 3371 | </li> |
@@ -3375,12 +3375,12 @@ discard block |
||
| 3375 | 3375 | $value = ''; |
| 3376 | 3376 | if ($extra_fields && isset($extra_fields['currency_symbol'])) {
|
| 3377 | 3377 | $value = esc_attr($extra_fields['currency_symbol']); |
| 3378 | - }elseif(isset($cf['defaults']['extra_fields']['currency_symbol']) && $cf['defaults']['extra_fields']['currency_symbol']){
|
|
| 3378 | + }elseif (isset($cf['defaults']['extra_fields']['currency_symbol']) && $cf['defaults']['extra_fields']['currency_symbol']) {
|
|
| 3379 | 3379 | $value = esc_attr($cf['defaults']['extra_fields']['currency_symbol']); |
| 3380 | 3380 | } |
| 3381 | 3381 | ?> |
| 3382 | - <li class="gdcf-price-extra" <?php if(!$show_price_extra){ echo "style='display:none;'";}?>>
|
|
| 3383 | - <label for="currency_symbol" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Currency symbol :', 'geodirectory');?>
|
|
| 3382 | + <li class="gdcf-price-extra" <?php if (!$show_price_extra) { echo "style='display:none;'"; }?>>
|
|
| 3383 | + <label for="currency_symbol" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Currency symbol :', 'geodirectory'); ?>
|
|
| 3384 | 3384 | <div class="gdcf-tooltip"> |
| 3385 | 3385 | <?php _e('Select the currency symbol.', 'geodirectory'); ?>
|
| 3386 | 3386 | </div> |
@@ -3396,20 +3396,20 @@ discard block |
||
| 3396 | 3396 | $value = ''; |
| 3397 | 3397 | if ($extra_fields && isset($extra_fields['currency_symbol_placement'])) {
|
| 3398 | 3398 | $value = esc_attr($extra_fields['currency_symbol_placement']); |
| 3399 | - }elseif(isset($cf['defaults']['extra_fields']['currency_symbol_placement']) && $cf['defaults']['extra_fields']['currency_symbol_placement']){
|
|
| 3399 | + }elseif (isset($cf['defaults']['extra_fields']['currency_symbol_placement']) && $cf['defaults']['extra_fields']['currency_symbol_placement']) {
|
|
| 3400 | 3400 | $value = esc_attr($cf['defaults']['extra_fields']['currency_symbol_placement']); |
| 3401 | 3401 | } |
| 3402 | 3402 | ?> |
| 3403 | - <li class="gdcf-price-extra" <?php if(!$show_price_extra){ echo "style='display:none;'";}?>>
|
|
| 3404 | - <label for="currency_symbol_placement" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Currency symbol placement :', 'geodirectory');?>
|
|
| 3403 | + <li class="gdcf-price-extra" <?php if (!$show_price_extra) { echo "style='display:none;'"; }?>>
|
|
| 3404 | + <label for="currency_symbol_placement" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Currency symbol placement :', 'geodirectory'); ?>
|
|
| 3405 | 3405 | <div class="gdcf-tooltip"> |
| 3406 | 3406 | <?php _e('Select the currency symbol placement.', 'geodirectory'); ?>
|
| 3407 | 3407 | </div> |
| 3408 | 3408 | </label> |
| 3409 | 3409 | <div class="gd-cf-input-wrap"> |
| 3410 | 3410 | <select name="extra[currency_symbol_placement]" id="currency_symbol_placement"> |
| 3411 | - <option value="left" <?php selected(true, $value == 'left');?>><?php _e('Left', 'geodirectory'); ?></option>
|
|
| 3412 | - <option value="right" <?php selected(true, $value == "right");?>><?php _e('Right', 'geodirectory'); ?></option>
|
|
| 3411 | + <option value="left" <?php selected(true, $value == 'left'); ?>><?php _e('Left', 'geodirectory'); ?></option>
|
|
| 3412 | + <option value="right" <?php selected(true, $value == "right"); ?>><?php _e('Right', 'geodirectory'); ?></option>
|
|
| 3413 | 3413 | </select> |
| 3414 | 3414 | </div> |
| 3415 | 3415 | </li> |
@@ -3420,11 +3420,11 @@ discard block |
||
| 3420 | 3420 | $html = ob_get_clean(); |
| 3421 | 3421 | return $output.$html; |
| 3422 | 3422 | } |
| 3423 | -add_filter('geodir_cfa_extra_fields_text','geodir_cfa_extra_fields_text',10,4);
|
|
| 3423 | +add_filter('geodir_cfa_extra_fields_text', 'geodir_cfa_extra_fields_text', 10, 4);
|
|
| 3424 | 3424 | |
| 3425 | -function geodir_default_custom_fields($post_type='gd_place',$package_id=''){
|
|
| 3425 | +function geodir_default_custom_fields($post_type = 'gd_place', $package_id = '') {
|
|
| 3426 | 3426 | $fields = array(); |
| 3427 | - $package = ($package_id=='') ? '' : array($package_id); |
|
| 3427 | + $package = ($package_id == '') ? '' : array($package_id); |
|
| 3428 | 3428 | |
| 3429 | 3429 | $fields[] = array('listing_type' => $post_type,
|
| 3430 | 3430 | 'data_type' => 'VARCHAR', |
@@ -3597,7 +3597,7 @@ discard block |
||
| 3597 | 3597 | return $fields; |
| 3598 | 3598 | } |
| 3599 | 3599 | |
| 3600 | -function geodir_currency_format_number($number='',$cf=''){
|
|
| 3600 | +function geodir_currency_format_number($number = '', $cf = '') {
|
|
| 3601 | 3601 | |
| 3602 | 3602 | $cs = isset($cf['extra_fields']) ? maybe_unserialize($cf['extra_fields']) : ''; |
| 3603 | 3603 | |
@@ -3606,35 +3606,35 @@ discard block |
||
| 3606 | 3606 | $decimal_display = !empty($cf['decimal_display']) ? $cf['decimal_display'] : (!empty($cs['decimal_display']) ? $cs['decimal_display'] : 'if'); |
| 3607 | 3607 | $decimalpoint = '.'; |
| 3608 | 3608 | |
| 3609 | - if(isset($cs['decimal_separator']) && $cs['decimal_separator']=='comma'){
|
|
| 3609 | + if (isset($cs['decimal_separator']) && $cs['decimal_separator'] == 'comma') {
|
|
| 3610 | 3610 | $decimalpoint = ','; |
| 3611 | 3611 | } |
| 3612 | 3612 | |
| 3613 | 3613 | $separator = ','; |
| 3614 | 3614 | |
| 3615 | - if(isset($cs['thousand_separator'])){
|
|
| 3616 | - if($cs['thousand_separator']=='comma'){$separator = ',';}
|
|
| 3617 | - if($cs['thousand_separator']=='slash'){$separator = '\\';}
|
|
| 3618 | - if($cs['thousand_separator']=='period'){$separator = '.';}
|
|
| 3619 | - if($cs['thousand_separator']=='space'){$separator = ' ';}
|
|
| 3620 | - if($cs['thousand_separator']=='none'){$separator = '';}
|
|
| 3615 | + if (isset($cs['thousand_separator'])) {
|
|
| 3616 | + if ($cs['thousand_separator'] == 'comma') {$separator = ','; }
|
|
| 3617 | + if ($cs['thousand_separator'] == 'slash') {$separator = '\\'; }
|
|
| 3618 | + if ($cs['thousand_separator'] == 'period') {$separator = '.'; }
|
|
| 3619 | + if ($cs['thousand_separator'] == 'space') {$separator = ' '; }
|
|
| 3620 | + if ($cs['thousand_separator'] == 'none') {$separator = ''; }
|
|
| 3621 | 3621 | } |
| 3622 | 3622 | |
| 3623 | 3623 | $currency_symbol_placement = isset($cs['currency_symbol_placement']) ? $cs['currency_symbol_placement'] : 'left'; |
| 3624 | 3624 | |
| 3625 | - if($decimals>0 && $decimal_display=='if'){
|
|
| 3626 | - if(is_int($number) || floor( $number ) == $number) |
|
| 3625 | + if ($decimals > 0 && $decimal_display == 'if') {
|
|
| 3626 | + if (is_int($number) || floor($number) == $number) |
|
| 3627 | 3627 | $decimals = 0; |
| 3628 | 3628 | } |
| 3629 | 3629 | |
| 3630 | - $number = number_format($number,$decimals,$decimalpoint,$separator); |
|
| 3630 | + $number = number_format($number, $decimals, $decimalpoint, $separator); |
|
| 3631 | 3631 | |
| 3632 | 3632 | |
| 3633 | 3633 | |
| 3634 | - if($currency_symbol_placement=='left'){
|
|
| 3635 | - $number = $symbol . $number; |
|
| 3636 | - }else{
|
|
| 3637 | - $number = $number . $symbol; |
|
| 3634 | + if ($currency_symbol_placement == 'left') {
|
|
| 3635 | + $number = $symbol.$number; |
|
| 3636 | + } else {
|
|
| 3637 | + $number = $number.$symbol; |
|
| 3638 | 3638 | } |
| 3639 | 3639 | |
| 3640 | 3640 | |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | /* ON TEMPLATE INCLUDE */ |
| 137 | 137 | ///////////////////////// |
| 138 | 138 | |
| 139 | -add_filter('template_include', 'geodir_template_loader',9);
|
|
| 139 | +add_filter('template_include', 'geodir_template_loader', 9);
|
|
| 140 | 140 | |
| 141 | 141 | ///////////////////////// |
| 142 | 142 | /* CATEGORY / TAXONOMY / CUSTOM POST ACTIONS */ |
@@ -176,9 +176,9 @@ discard block |
||
| 176 | 176 | /* WP REVIEW COUNT ACTIONS */ |
| 177 | 177 | //////////////////////// |
| 178 | 178 | |
| 179 | -add_action('geodir_update_postrating', 'geodir_term_review_count_force_update_single_post', 100,1);
|
|
| 179 | +add_action('geodir_update_postrating', 'geodir_term_review_count_force_update_single_post', 100, 1);
|
|
| 180 | 180 | //add_action('geodir_update_postrating', 'geodir_term_review_count_force_update', 100);
|
| 181 | -add_action('transition_post_status', 'geodir_term_review_count_force_update', 100,3);
|
|
| 181 | +add_action('transition_post_status', 'geodir_term_review_count_force_update', 100, 3);
|
|
| 182 | 182 | //add_action('created_term', 'geodir_term_review_count_force_update', 100);
|
| 183 | 183 | add_action('edited_term', 'geodir_term_review_count_force_update', 100);
|
| 184 | 184 | add_action('delete_term', 'geodir_term_review_count_force_update', 100);
|
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | */ |
| 224 | 224 | function geodir_unset_prev_theme_nav_location($newname) |
| 225 | 225 | {
|
| 226 | - $geodir_theme_location = get_option('geodir_theme_location_nav_' . $newname);
|
|
| 226 | + $geodir_theme_location = get_option('geodir_theme_location_nav_'.$newname);
|
|
| 227 | 227 | if ($geodir_theme_location) {
|
| 228 | 228 | update_option('geodir_theme_location_nav', $geodir_theme_location);
|
| 229 | 229 | } else {
|
@@ -321,8 +321,8 @@ discard block |
||
| 321 | 321 | |
| 322 | 322 | /////// GEO DIRECOTORY CUSTOM HOOKS /// |
| 323 | 323 | |
| 324 | -add_action('geodir_before_tab_content', 'geodir_before_tab_content');// this function is in custom_functions.php and it is used to wrap detail page tab content
|
|
| 325 | -add_action('geodir_after_tab_content', 'geodir_after_tab_content');// this function is in custom_functions.php and it is used to wrap detail page tab content
|
|
| 324 | +add_action('geodir_before_tab_content', 'geodir_before_tab_content'); // this function is in custom_functions.php and it is used to wrap detail page tab content
|
|
| 325 | +add_action('geodir_after_tab_content', 'geodir_after_tab_content'); // this function is in custom_functions.php and it is used to wrap detail page tab content
|
|
| 326 | 326 | |
| 327 | 327 | // Detail page sidebar content |
| 328 | 328 | add_action('geodir_detail_page_sidebar', 'geodir_detail_page_sidebar_content_sorting', 1);
|
@@ -422,8 +422,8 @@ discard block |
||
| 422 | 422 | do_action('geodir_after_social_sharing_buttons');
|
| 423 | 423 | $content_html = ob_get_clean(); |
| 424 | 424 | if (trim($content_html) != '') |
| 425 | - $content_html = '<div class="geodir-company_info geodir-details-sidebar-social-sharing">' . $content_html . '</div>'; |
|
| 426 | - if ((int)get_option('geodir_disable_tfg_buttons_section') != 1) {
|
|
| 425 | + $content_html = '<div class="geodir-company_info geodir-details-sidebar-social-sharing">'.$content_html.'</div>'; |
|
| 426 | + if ((int) get_option('geodir_disable_tfg_buttons_section') != 1) {
|
|
| 427 | 427 | /** |
| 428 | 428 | * Filter the geodir_social_sharing_buttons() function content. |
| 429 | 429 | * |
@@ -463,12 +463,12 @@ discard block |
||
| 463 | 463 | $post_id = $post->ID; |
| 464 | 464 | |
| 465 | 465 | if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
| 466 | - $post_id = (int)$_REQUEST['pid']; |
|
| 466 | + $post_id = (int) $_REQUEST['pid']; |
|
| 467 | 467 | } |
| 468 | 468 | |
| 469 | 469 | $postlink = get_permalink(geodir_add_listing_page_id()); |
| 470 | 470 | $editlink = geodir_getlink($postlink, array('pid' => $post_id), false);
|
| 471 | - echo ' <p class="edit_link"><i class="fa fa-pencil"></i> <a href="' . esc_url($editlink) . '">' . __('Edit this Post', 'geodirectory') . '</a></p>';
|
|
| 471 | + echo ' <p class="edit_link"><i class="fa fa-pencil"></i> <a href="'.esc_url($editlink).'">'.__('Edit this Post', 'geodirectory').'</a></p>';
|
|
| 472 | 472 | } |
| 473 | 473 | }// end of if, if its a preview or not |
| 474 | 474 | /** |
@@ -479,8 +479,8 @@ discard block |
||
| 479 | 479 | do_action('geodir_after_edit_post_link');
|
| 480 | 480 | $content_html = ob_get_clean(); |
| 481 | 481 | if (trim($content_html) != '') |
| 482 | - $content_html = '<div class="geodir-company_info geodir-details-sidebar-user-links">' . $content_html . '</div>'; |
|
| 483 | - if ((int)get_option('geodir_disable_user_links_section') != 1) {
|
|
| 482 | + $content_html = '<div class="geodir-company_info geodir-details-sidebar-user-links">'.$content_html.'</div>'; |
|
| 483 | + if ((int) get_option('geodir_disable_user_links_section') != 1) {
|
|
| 484 | 484 | /** |
| 485 | 485 | * Filter the geodir_edit_post_link() function content. |
| 486 | 486 | * |
@@ -501,8 +501,8 @@ discard block |
||
| 501 | 501 | */ |
| 502 | 502 | function geodir_detail_page_google_analytics() |
| 503 | 503 | {
|
| 504 | - global $post,$preview; |
|
| 505 | - if($preview){return '';}
|
|
| 504 | + global $post, $preview; |
|
| 505 | + if ($preview) {return ''; }
|
|
| 506 | 506 | $package_info = array(); |
| 507 | 507 | $package_info = geodir_post_package_info($package_info, $post); |
| 508 | 508 | |
@@ -534,14 +534,14 @@ discard block |
||
| 534 | 534 | $hide_refresh = get_option('geodir_ga_auto_refresh');
|
| 535 | 535 | |
| 536 | 536 | $auto_refresh = $hide_refresh && $refresh_time && $refresh_time > 0 ? 1 : 0; |
| 537 | - if (get_option('geodir_ga_stats') && is_user_logged_in() && (isset($package_info->google_analytics) && $package_info->google_analytics == '1') && (get_current_user_id()==$post->post_author || current_user_can( 'manage_options' )) ) {
|
|
| 537 | + if (get_option('geodir_ga_stats') && is_user_logged_in() && (isset($package_info->google_analytics) && $package_info->google_analytics == '1') && (get_current_user_id() == $post->post_author || current_user_can('manage_options'))) {
|
|
| 538 | 538 | $page_url = urlencode($_SERVER['REQUEST_URI']); |
| 539 | 539 | ?> |
| 540 | 540 | <script type="text/javascript"> |
| 541 | 541 | var gd_gaTimeOut; |
| 542 | - var gd_gaTime = parseInt('<?php echo $refresh_time;?>');
|
|
| 543 | - var gd_gaHideRefresh = <?php echo (int)$hide_refresh;?>; |
|
| 544 | - var gd_gaAutoRefresh = <?php echo $auto_refresh;?>; |
|
| 542 | + var gd_gaTime = parseInt('<?php echo $refresh_time; ?>');
|
|
| 543 | + var gd_gaHideRefresh = <?php echo (int) $hide_refresh; ?>; |
|
| 544 | + var gd_gaAutoRefresh = <?php echo $auto_refresh; ?>; |
|
| 545 | 545 | ga_data1 = false; |
| 546 | 546 | ga_data2 = false; |
| 547 | 547 | ga_data3 = false; |
@@ -682,7 +682,7 @@ discard block |
||
| 682 | 682 | } |
| 683 | 683 | |
| 684 | 684 | function gdga_noResults() {
|
| 685 | - jQuery('#gdga-chart-container').html('<?php _e('No results available','geodirectory');?>');
|
|
| 685 | + jQuery('#gdga-chart-container').html('<?php _e('No results available', 'geodirectory'); ?>');
|
|
| 686 | 686 | jQuery('#gdga-legend-container').html('');
|
| 687 | 687 | } |
| 688 | 688 | |
@@ -714,18 +714,18 @@ discard block |
||
| 714 | 714 | var data2 = results[1].rows.map(function(row) { return +row[2]; });
|
| 715 | 715 | //var labelsN = results[0].rows.map(function(row) { return +row[1]; });
|
| 716 | 716 | |
| 717 | - var labels = ['<?php _e('Jan', 'geodirectory');?>',
|
|
| 718 | - '<?php _e('Feb', 'geodirectory');?>',
|
|
| 719 | - '<?php _e('Mar', 'geodirectory');?>',
|
|
| 720 | - '<?php _e('Apr', 'geodirectory');?>',
|
|
| 721 | - '<?php _e('May', 'geodirectory');?>',
|
|
| 722 | - '<?php _e('Jun', 'geodirectory');?>',
|
|
| 723 | - '<?php _e('Jul', 'geodirectory');?>',
|
|
| 724 | - '<?php _e('Aug', 'geodirectory');?>',
|
|
| 725 | - '<?php _e('Sep', 'geodirectory');?>',
|
|
| 726 | - '<?php _e('Oct', 'geodirectory');?>',
|
|
| 727 | - '<?php _e('Nov', 'geodirectory');?>',
|
|
| 728 | - '<?php _e('Dec', 'geodirectory');?>'];
|
|
| 717 | + var labels = ['<?php _e('Jan', 'geodirectory'); ?>',
|
|
| 718 | + '<?php _e('Feb', 'geodirectory'); ?>',
|
|
| 719 | + '<?php _e('Mar', 'geodirectory'); ?>',
|
|
| 720 | + '<?php _e('Apr', 'geodirectory'); ?>',
|
|
| 721 | + '<?php _e('May', 'geodirectory'); ?>',
|
|
| 722 | + '<?php _e('Jun', 'geodirectory'); ?>',
|
|
| 723 | + '<?php _e('Jul', 'geodirectory'); ?>',
|
|
| 724 | + '<?php _e('Aug', 'geodirectory'); ?>',
|
|
| 725 | + '<?php _e('Sep', 'geodirectory'); ?>',
|
|
| 726 | + '<?php _e('Oct', 'geodirectory'); ?>',
|
|
| 727 | + '<?php _e('Nov', 'geodirectory'); ?>',
|
|
| 728 | + '<?php _e('Dec', 'geodirectory'); ?>'];
|
|
| 729 | 729 | |
| 730 | 730 | // Ensure the data arrays are at least as long as the labels array. |
| 731 | 731 | // Chart.js bar charts don't (yet) accept sparse datasets. |
@@ -738,13 +738,13 @@ discard block |
||
| 738 | 738 | labels : labels, |
| 739 | 739 | datasets : [ |
| 740 | 740 | {
|
| 741 | - label: '<?php _e('Last Year', 'geodirectory');?>',
|
|
| 741 | + label: '<?php _e('Last Year', 'geodirectory'); ?>',
|
|
| 742 | 742 | fillColor : "rgba(220,220,220,0.5)", |
| 743 | 743 | strokeColor : "rgba(220,220,220,1)", |
| 744 | 744 | data : data2 |
| 745 | 745 | }, |
| 746 | 746 | {
|
| 747 | - label: '<?php _e('This Year', 'geodirectory');?>',
|
|
| 747 | + label: '<?php _e('This Year', 'geodirectory'); ?>',
|
|
| 748 | 748 | fillColor : "rgba(151,187,205,0.5)", |
| 749 | 749 | strokeColor : "rgba(151,187,205,1)", |
| 750 | 750 | data : data1 |
@@ -789,30 +789,30 @@ discard block |
||
| 789 | 789 | |
| 790 | 790 | <?php |
| 791 | 791 | // Here we list the shorthand days of the week so it can be used in translation. |
| 792 | - __("Mon",'geodirectory');
|
|
| 793 | - __("Tue",'geodirectory');
|
|
| 794 | - __("Wed",'geodirectory');
|
|
| 795 | - __("Thu",'geodirectory');
|
|
| 796 | - __("Fri",'geodirectory');
|
|
| 797 | - __("Sat",'geodirectory');
|
|
| 798 | - __("Sun",'geodirectory');
|
|
| 792 | + __("Mon", 'geodirectory');
|
|
| 793 | + __("Tue", 'geodirectory');
|
|
| 794 | + __("Wed", 'geodirectory');
|
|
| 795 | + __("Thu", 'geodirectory');
|
|
| 796 | + __("Fri", 'geodirectory');
|
|
| 797 | + __("Sat", 'geodirectory');
|
|
| 798 | + __("Sun", 'geodirectory');
|
|
| 799 | 799 | ?> |
| 800 | 800 | |
| 801 | 801 | labels = [ |
| 802 | - "<?php _e(date('D', strtotime("+1 day")),'geodirectory'); ?>",
|
|
| 803 | - "<?php _e(date('D', strtotime("+2 day")),'geodirectory'); ?>",
|
|
| 804 | - "<?php _e(date('D', strtotime("+3 day")),'geodirectory'); ?>",
|
|
| 805 | - "<?php _e(date('D', strtotime("+4 day")),'geodirectory'); ?>",
|
|
| 806 | - "<?php _e(date('D', strtotime("+5 day")),'geodirectory'); ?>",
|
|
| 807 | - "<?php _e(date('D', strtotime("+6 day")),'geodirectory'); ?>",
|
|
| 808 | - "<?php _e(date('D', strtotime("+7 day")),'geodirectory'); ?>"
|
|
| 802 | + "<?php _e(date('D', strtotime("+1 day")), 'geodirectory'); ?>",
|
|
| 803 | + "<?php _e(date('D', strtotime("+2 day")), 'geodirectory'); ?>",
|
|
| 804 | + "<?php _e(date('D', strtotime("+3 day")), 'geodirectory'); ?>",
|
|
| 805 | + "<?php _e(date('D', strtotime("+4 day")), 'geodirectory'); ?>",
|
|
| 806 | + "<?php _e(date('D', strtotime("+5 day")), 'geodirectory'); ?>",
|
|
| 807 | + "<?php _e(date('D', strtotime("+6 day")), 'geodirectory'); ?>",
|
|
| 808 | + "<?php _e(date('D', strtotime("+7 day")), 'geodirectory'); ?>"
|
|
| 809 | 809 | ]; |
| 810 | 810 | |
| 811 | 811 | var data = {
|
| 812 | 812 | labels : labels, |
| 813 | 813 | datasets : [ |
| 814 | 814 | {
|
| 815 | - label: '<?php _e('Last Week', 'geodirectory');?>',
|
|
| 815 | + label: '<?php _e('Last Week', 'geodirectory'); ?>',
|
|
| 816 | 816 | fillColor : "rgba(220,220,220,0.5)", |
| 817 | 817 | strokeColor : "rgba(220,220,220,1)", |
| 818 | 818 | pointColor : "rgba(220,220,220,1)", |
@@ -820,7 +820,7 @@ discard block |
||
| 820 | 820 | data : data2 |
| 821 | 821 | }, |
| 822 | 822 | {
|
| 823 | - label: '<?php _e('This Week', 'geodirectory');?>',
|
|
| 823 | + label: '<?php _e('This Week', 'geodirectory'); ?>',
|
|
| 824 | 824 | fillColor : "rgba(151,187,205,0.5)", |
| 825 | 825 | strokeColor : "rgba(151,187,205,1)", |
| 826 | 826 | pointColor : "rgba(151,187,205,1)", |
@@ -1027,18 +1027,18 @@ discard block |
||
| 1027 | 1027 | </style> |
| 1028 | 1028 | <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.2/Chart.min.js"></script> |
| 1029 | 1029 | <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.2/moment.min.js"></script> |
| 1030 | - <button type="button" class="gdga-show-analytics"><?php _e('Show Google Analytics', 'geodirectory');?></button>
|
|
| 1030 | + <button type="button" class="gdga-show-analytics"><?php _e('Show Google Analytics', 'geodirectory'); ?></button>
|
|
| 1031 | 1031 | <span id="ga_stats" class="gdga-analytics-box" style="display:none"> |
| 1032 | - <div id="ga-analytics-title"><?php _e("Analytics", 'geodirectory');?></div>
|
|
| 1032 | + <div id="ga-analytics-title"><?php _e("Analytics", 'geodirectory'); ?></div>
|
|
| 1033 | 1033 | <div id="gd-active-users-container"> |
| 1034 | - <div class="gd-ActiveUsers"><i id="gdga-loader-icon" class="fa fa-refresh fa-spin" title="<?php esc_attr_e("Refresh", 'geodirectory');?>"></i><?php _e("Active Users:", 'geodirectory');?>
|
|
| 1034 | + <div class="gd-ActiveUsers"><i id="gdga-loader-icon" class="fa fa-refresh fa-spin" title="<?php esc_attr_e("Refresh", 'geodirectory'); ?>"></i><?php _e("Active Users:", 'geodirectory'); ?>
|
|
| 1035 | 1035 | <b class="gd-ActiveUsers-value">0</b> |
| 1036 | 1036 | </div> |
| 1037 | 1037 | </div> |
| 1038 | 1038 | <select id="gdga-select-analytic" onchange="gdga_select_option();" style="display: none;"> |
| 1039 | - <option value="weeks"><?php _e("Last Week vs This Week", 'geodirectory');?></option>
|
|
| 1040 | - <option value="years"><?php _e("This Year vs Last Year", 'geodirectory');?></option>
|
|
| 1041 | - <option value="country"><?php _e("Top Countries", 'geodirectory');?></option>
|
|
| 1039 | + <option value="weeks"><?php _e("Last Week vs This Week", 'geodirectory'); ?></option>
|
|
| 1040 | + <option value="years"><?php _e("This Year vs Last Year", 'geodirectory'); ?></option>
|
|
| 1041 | + <option value="country"><?php _e("Top Countries", 'geodirectory'); ?></option>
|
|
| 1042 | 1042 | </select> |
| 1043 | 1043 | <div class="Chartjs-figure" id="gdga-chart-container"></div> |
| 1044 | 1044 | <ol class="Chartjs-legend" id="gdga-legend-container"></ol> |
@@ -1054,8 +1054,8 @@ discard block |
||
| 1054 | 1054 | do_action('geodir_after_google_analytics');
|
| 1055 | 1055 | $content_html = ob_get_clean(); |
| 1056 | 1056 | if (trim($content_html) != '') |
| 1057 | - $content_html = '<div class="geodir-company_info geodir-details-sidebar-google-analytics">' . $content_html . '</div>'; |
|
| 1058 | - if ((int)get_option('geodir_disable_google_analytics_section') != 1) {
|
|
| 1057 | + $content_html = '<div class="geodir-company_info geodir-details-sidebar-google-analytics">'.$content_html.'</div>'; |
|
| 1058 | + if ((int) get_option('geodir_disable_google_analytics_section') != 1) {
|
|
| 1059 | 1059 | /** |
| 1060 | 1060 | * Filter the geodir_edit_post_link() function content. |
| 1061 | 1061 | * |
@@ -1081,7 +1081,7 @@ discard block |
||
| 1081 | 1081 | {
|
| 1082 | 1082 | global $post, $preview, $post_images; |
| 1083 | 1083 | |
| 1084 | - if (!empty($post->ID) && geodir_cpt_has_rating_disabled((int)$post->ID)) {
|
|
| 1084 | + if (!empty($post->ID) && geodir_cpt_has_rating_disabled((int) $post->ID)) {
|
|
| 1085 | 1085 | return; |
| 1086 | 1086 | } |
| 1087 | 1087 | ob_start(); // Start buffering; |
@@ -1116,10 +1116,10 @@ discard block |
||
| 1116 | 1116 | |
| 1117 | 1117 | $reviews_text = $comment_count > 1 ? __("reviews", 'geodirectory') : __("review", 'geodirectory');
|
| 1118 | 1118 | |
| 1119 | - $html .= '<span itemprop="rating" itemscope itemtype="http://data-vocabulary.org/Rating"><span class="rating" itemprop="average" content="' . $post_avgratings . '">' . $post_avgratings . '</span> / <span itemprop="best" content="5">5</span> ' . __("based on", 'geodirectory') . ' </span><span class="count" itemprop="count" content="' . $comment_count . '">' . $comment_count . ' ' . $reviews_text . '</span><br />';
|
|
| 1119 | + $html .= '<span itemprop="rating" itemscope itemtype="http://data-vocabulary.org/Rating"><span class="rating" itemprop="average" content="'.$post_avgratings.'">'.$post_avgratings.'</span> / <span itemprop="best" content="5">5</span> '.__("based on", 'geodirectory').' </span><span class="count" itemprop="count" content="'.$comment_count.'">'.$comment_count.' '.$reviews_text.'</span><br />';
|
|
| 1120 | 1120 | |
| 1121 | 1121 | $html .= '<span class="item">'; |
| 1122 | - $html .= '<span class="fn" itemprop="itemreviewed">' . $post->post_title . '</span>'; |
|
| 1122 | + $html .= '<span class="fn" itemprop="itemreviewed">'.$post->post_title.'</span>'; |
|
| 1123 | 1123 | |
| 1124 | 1124 | if ($post_images) {
|
| 1125 | 1125 | foreach ($post_images as $img) {
|
@@ -1129,7 +1129,7 @@ discard block |
||
| 1129 | 1129 | } |
| 1130 | 1130 | |
| 1131 | 1131 | if (isset($post_img) && $post_img) {
|
| 1132 | - $html .= '<br /><img src="' . $post_img . '" class="photo" alt="' . esc_attr($post->post_title) . '" itemprop="photo" content="' . $post_img . '" class="photo" />'; |
|
| 1132 | + $html .= '<br /><img src="'.$post_img.'" class="photo" alt="'.esc_attr($post->post_title).'" itemprop="photo" content="'.$post_img.'" class="photo" />'; |
|
| 1133 | 1133 | } |
| 1134 | 1134 | |
| 1135 | 1135 | $html .= '</span>'; |
@@ -1156,9 +1156,9 @@ discard block |
||
| 1156 | 1156 | do_action('geodir_after_detail_page_review_rating');
|
| 1157 | 1157 | $content_html = ob_get_clean(); |
| 1158 | 1158 | if (trim($content_html) != '') {
|
| 1159 | - $content_html = '<div class="geodir-company_info geodir-details-sidebar-rating">' . $content_html . '</div>'; |
|
| 1159 | + $content_html = '<div class="geodir-company_info geodir-details-sidebar-rating">'.$content_html.'</div>'; |
|
| 1160 | 1160 | } |
| 1161 | - if ((int)get_option('geodir_disable_rating_info_section') != 1) {
|
|
| 1161 | + if ((int) get_option('geodir_disable_rating_info_section') != 1) {
|
|
| 1162 | 1162 | /** |
| 1163 | 1163 | * Filter the geodir_detail_page_review_rating() function content. |
| 1164 | 1164 | * |
@@ -1197,8 +1197,8 @@ discard block |
||
| 1197 | 1197 | |
| 1198 | 1198 | $content_html = ob_get_clean(); |
| 1199 | 1199 | if (trim($content_html) != '') |
| 1200 | - $content_html = '<div class="geodir-company_info geodir-details-sidebar-listing-info">' . $content_html . '</div>'; |
|
| 1201 | - if ((int)get_option('geodir_disable_listing_info_section') != 1) {
|
|
| 1200 | + $content_html = '<div class="geodir-company_info geodir-details-sidebar-listing-info">'.$content_html.'</div>'; |
|
| 1201 | + if ((int) get_option('geodir_disable_listing_info_section') != 1) {
|
|
| 1202 | 1202 | /** |
| 1203 | 1203 | * Filter the output html for function geodir_detail_page_more_info(). |
| 1204 | 1204 | * |
@@ -1297,7 +1297,7 @@ discard block |
||
| 1297 | 1297 | 'gd_allowed_img_types' => !empty($allowed_img_types) ? implode(',', $allowed_img_types) : '',
|
| 1298 | 1298 | 'geodir_txt_form_wait' => __('Wait...', 'geodirectory'),
|
| 1299 | 1299 | 'geodir_txt_form_searching' => __('Searching...', 'geodirectory'),
|
| 1300 | - 'fa_rating' => (int)get_option('geodir_reviewrating_enable_font_awesome') == 1 ? 1 : '',
|
|
| 1300 | + 'fa_rating' => (int) get_option('geodir_reviewrating_enable_font_awesome') == 1 ? 1 : '',
|
|
| 1301 | 1301 | 'reviewrating' => defined('GEODIRREVIEWRATING_VERSION') ? 1 : '',
|
| 1302 | 1302 | 'multirating' => defined('GEODIRREVIEWRATING_VERSION') && get_option('geodir_reviewrating_enable_rating') ? true : false,
|
| 1303 | 1303 | 'geodir_map_name' => geodir_map_name(), |
@@ -1326,10 +1326,10 @@ discard block |
||
| 1326 | 1326 | foreach ($arr_alert_msg as $key => $value) {
|
| 1327 | 1327 | if (!is_scalar($value)) |
| 1328 | 1328 | continue; |
| 1329 | - $arr_alert_msg[$key] = html_entity_decode((string)$value, ENT_QUOTES, 'UTF-8'); |
|
| 1329 | + $arr_alert_msg[$key] = html_entity_decode((string) $value, ENT_QUOTES, 'UTF-8'); |
|
| 1330 | 1330 | } |
| 1331 | 1331 | |
| 1332 | - $script = "var geodir_all_js_msg = " . json_encode($arr_alert_msg) . ';'; |
|
| 1332 | + $script = "var geodir_all_js_msg = ".json_encode($arr_alert_msg).';'; |
|
| 1333 | 1333 | echo '<script>'; |
| 1334 | 1334 | echo $script; |
| 1335 | 1335 | echo '</script>'; |
@@ -1419,7 +1419,7 @@ discard block |
||
| 1419 | 1419 | $geodir_old_sidebars = get_option('geodir_sidebars');
|
| 1420 | 1420 | if (is_array($geodir_old_sidebars)) {
|
| 1421 | 1421 | foreach ($geodir_old_sidebars as $key => $val) {
|
| 1422 | - if(0 === strpos($key, 'geodir_'))// if gd widget |
|
| 1422 | + if (0 === strpos($key, 'geodir_'))// if gd widget |
|
| 1423 | 1423 | {
|
| 1424 | 1424 | $sidebars_widgets[$key] = $geodir_old_sidebars[$key]; |
| 1425 | 1425 | } |
@@ -1498,7 +1498,7 @@ discard block |
||
| 1498 | 1498 | global $post; |
| 1499 | 1499 | $term_condition = ''; |
| 1500 | 1500 | if (isset($_REQUEST['backandedit'])) {
|
| 1501 | - $post = (object)$gd_session->get('listing');
|
|
| 1501 | + $post = (object) $gd_session->get('listing');
|
|
| 1502 | 1502 | $term_condition = isset($post->geodir_accept_term_condition) ? $post->geodir_accept_term_condition : ''; |
| 1503 | 1503 | } |
| 1504 | 1504 | |
@@ -1512,7 +1512,7 @@ discard block |
||
| 1512 | 1512 | echo 'checked="checked"'; |
| 1513 | 1513 | } ?> field_type="checkbox" name="geodir_accept_term_condition" id="geodir_accept_term_condition" |
| 1514 | 1514 | class="geodir_textfield" value="1" |
| 1515 | - style="display:inline-block"/><a href="<?php $terms_page = get_option('geodir_term_condition_page'); if($terms_page){ echo get_permalink($terms_page);}?>" target="_blank"><?php _e('Please accept our terms and conditions', 'geodirectory'); ?></a>
|
|
| 1515 | + style="display:inline-block"/><a href="<?php $terms_page = get_option('geodir_term_condition_page'); if ($terms_page) { echo get_permalink($terms_page); }?>" target="_blank"><?php _e('Please accept our terms and conditions', 'geodirectory'); ?></a>
|
|
| 1516 | 1516 | </span> |
| 1517 | 1517 | </div> |
| 1518 | 1518 | <span class="geodir_message_error"><?php if (isset($required_msg)) {
|
@@ -1552,7 +1552,7 @@ discard block |
||
| 1552 | 1552 | /** This action is documented in geodirectory_template_actions.php */ |
| 1553 | 1553 | $desc_limit = apply_filters('geodir_description_field_desc_limit', '');
|
| 1554 | 1554 | |
| 1555 | - if (!($desc_limit === '' || (int)$desc_limit > 0)) {
|
|
| 1555 | + if (!($desc_limit === '' || (int) $desc_limit > 0)) {
|
|
| 1556 | 1556 | $is_display = false; |
| 1557 | 1557 | } |
| 1558 | 1558 | } |
@@ -1600,16 +1600,16 @@ discard block |
||
| 1600 | 1600 | global $wpdb, $plugin_prefix; |
| 1601 | 1601 | |
| 1602 | 1602 | // Remove unused virtual page |
| 1603 | - $listings_page_id = (int)get_option('geodir_listing_page');
|
|
| 1603 | + $listings_page_id = (int) get_option('geodir_listing_page');
|
|
| 1604 | 1604 | if ($listings_page_id) {
|
| 1605 | - $wpdb->query($wpdb->prepare("DELETE FROM " . $wpdb->posts . " WHERE ID=%d AND post_name = %s AND post_type=%s", array($listings_page_id, 'listings', 'page')));
|
|
| 1605 | + $wpdb->query($wpdb->prepare("DELETE FROM ".$wpdb->posts." WHERE ID=%d AND post_name = %s AND post_type=%s", array($listings_page_id, 'listings', 'page')));
|
|
| 1606 | 1606 | delete_option('geodir_listing_page');
|
| 1607 | 1607 | } |
| 1608 | 1608 | |
| 1609 | 1609 | if (!get_option('geodir_changes_in_custom_fields_table')) {
|
| 1610 | 1610 | $wpdb->query( |
| 1611 | 1611 | $wpdb->prepare( |
| 1612 | - "UPDATE " . GEODIR_CUSTOM_FIELDS_TABLE . " SET is_default=%s, is_admin=%s WHERE is_default=%s", |
|
| 1612 | + "UPDATE ".GEODIR_CUSTOM_FIELDS_TABLE." SET is_default=%s, is_admin=%s WHERE is_default=%s", |
|
| 1613 | 1613 | array('1', '1', 'admin')
|
| 1614 | 1614 | ) |
| 1615 | 1615 | ); |
@@ -1617,9 +1617,9 @@ discard block |
||
| 1617 | 1617 | |
| 1618 | 1618 | /* --- terms meta value set --- */ |
| 1619 | 1619 | |
| 1620 | - update_option('geodir_default_marker_icon', geodir_plugin_url() . '/geodirectory-functions/map-functions/icons/pin.png');
|
|
| 1620 | + update_option('geodir_default_marker_icon', geodir_plugin_url().'/geodirectory-functions/map-functions/icons/pin.png');
|
|
| 1621 | 1621 | |
| 1622 | - $options_data = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "options WHERE option_name LIKE %s", array('%tax_meta_%')));
|
|
| 1622 | + $options_data = $wpdb->get_results($wpdb->prepare("SELECT * FROM ".$wpdb->prefix."options WHERE option_name LIKE %s", array('%tax_meta_%')));
|
|
| 1623 | 1623 | |
| 1624 | 1624 | if (!empty($options_data)) {
|
| 1625 | 1625 | |
@@ -1627,7 +1627,7 @@ discard block |
||
| 1627 | 1627 | |
| 1628 | 1628 | $option_val = str_replace('tax_meta_', '', $optobj->option_name);
|
| 1629 | 1629 | |
| 1630 | - $taxonomies_data = $wpdb->get_results($wpdb->prepare("SELECT taxonomy FROM " . $wpdb->prefix . "term_taxonomy WHERE taxonomy LIKE %s AND term_id=%d", array('%category%', $option_val)));
|
|
| 1630 | + $taxonomies_data = $wpdb->get_results($wpdb->prepare("SELECT taxonomy FROM ".$wpdb->prefix."term_taxonomy WHERE taxonomy LIKE %s AND term_id=%d", array('%category%', $option_val)));
|
|
| 1631 | 1631 | |
| 1632 | 1632 | if (!empty($taxonomies_data)) {
|
| 1633 | 1633 | |
@@ -1636,17 +1636,17 @@ discard block |
||
| 1636 | 1636 | $taxObject = get_taxonomy($taxobj->taxonomy); |
| 1637 | 1637 | $post_type = $taxObject->object_type[0]; |
| 1638 | 1638 | |
| 1639 | - $opt_value = 'tax_meta_' . $post_type . '_' . $option_val; |
|
| 1639 | + $opt_value = 'tax_meta_'.$post_type.'_'.$option_val; |
|
| 1640 | 1640 | |
| 1641 | - $duplicate_data = $wpdb->get_var($wpdb->prepare("SELECT option_id FROM " . $wpdb->prefix . "options WHERE option_name=%s", array('tax_meta_' . $option_val)));
|
|
| 1641 | + $duplicate_data = $wpdb->get_var($wpdb->prepare("SELECT option_id FROM ".$wpdb->prefix."options WHERE option_name=%s", array('tax_meta_'.$option_val)));
|
|
| 1642 | 1642 | |
| 1643 | 1643 | if ($duplicate_data) {
|
| 1644 | 1644 | |
| 1645 | - $wpdb->query($wpdb->prepare("UPDATE " . $wpdb->prefix . "options SET option_name=%s WHERE option_id=%d", array($opt_value, $optobj->option_id)));
|
|
| 1645 | + $wpdb->query($wpdb->prepare("UPDATE ".$wpdb->prefix."options SET option_name=%s WHERE option_id=%d", array($opt_value, $optobj->option_id)));
|
|
| 1646 | 1646 | |
| 1647 | 1647 | } else {
|
| 1648 | 1648 | |
| 1649 | - $wpdb->query($wpdb->prepare("INSERT INTO " . $wpdb->prefix . "options (option_name,option_value,autoload) VALUES (%s, %s, %s)", array($opt_value, $optobj->option_value, $optobj->autoload)));
|
|
| 1649 | + $wpdb->query($wpdb->prepare("INSERT INTO ".$wpdb->prefix."options (option_name,option_value,autoload) VALUES (%s, %s, %s)", array($opt_value, $optobj->option_value, $optobj->autoload)));
|
|
| 1650 | 1650 | |
| 1651 | 1651 | } |
| 1652 | 1652 | |
@@ -1680,14 +1680,14 @@ discard block |
||
| 1680 | 1680 | |
| 1681 | 1681 | global $wpdb, $table_prefix; |
| 1682 | 1682 | |
| 1683 | - $slug_exists = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($slug)));
|
|
| 1683 | + $slug_exists = $wpdb->get_var($wpdb->prepare("SELECT slug FROM ".$table_prefix."terms WHERE slug=%s", array($slug)));
|
|
| 1684 | 1684 | |
| 1685 | 1685 | if ($slug_exists) {
|
| 1686 | 1686 | |
| 1687 | 1687 | $suffix = 1; |
| 1688 | 1688 | do {
|
| 1689 | - $alt_location_name = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix"; |
|
| 1690 | - $location_slug_check = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($alt_location_name)));
|
|
| 1689 | + $alt_location_name = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1))."-$suffix"; |
|
| 1690 | + $location_slug_check = $wpdb->get_var($wpdb->prepare("SELECT slug FROM ".$table_prefix."terms WHERE slug=%s", array($alt_location_name)));
|
|
| 1691 | 1691 | $suffix++; |
| 1692 | 1692 | } while ($location_slug_check && $suffix < 100); |
| 1693 | 1693 | |
@@ -1741,7 +1741,7 @@ discard block |
||
| 1741 | 1741 | |
| 1742 | 1742 | $suffix = 1; |
| 1743 | 1743 | do {
|
| 1744 | - $new_slug = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix"; |
|
| 1744 | + $new_slug = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1))."-$suffix"; |
|
| 1745 | 1745 | |
| 1746 | 1746 | /** This action is documented in geodirectory_hooks_actions.php */ |
| 1747 | 1747 | $term_slug_check = apply_filters('geodir_term_slug_is_exists', false, $new_slug, $term_id);
|
@@ -1753,7 +1753,7 @@ discard block |
||
| 1753 | 1753 | |
| 1754 | 1754 | //wp_update_term( $term_id, $taxonomy, array('slug' => $slug) );
|
| 1755 | 1755 | |
| 1756 | - $wpdb->query($wpdb->prepare("UPDATE " . $table_prefix . "terms SET slug=%s WHERE term_id=%d", array($slug, $term_id)));
|
|
| 1756 | + $wpdb->query($wpdb->prepare("UPDATE ".$table_prefix."terms SET slug=%s WHERE term_id=%d", array($slug, $term_id)));
|
|
| 1757 | 1757 | |
| 1758 | 1758 | } |
| 1759 | 1759 | |
@@ -1762,18 +1762,18 @@ discard block |
||
| 1762 | 1762 | $post_type = !empty($taxonomy_obj) ? $taxonomy_obj->object_type[0] : NULL; |
| 1763 | 1763 | |
| 1764 | 1764 | $post_types = geodir_get_posttypes(); |
| 1765 | - if ($post_type && in_array($post_type, $post_types) && $post_type . '_tags' == $taxonomy) {
|
|
| 1766 | - $posts_obj = $wpdb->get_results($wpdb->prepare("SELECT object_id FROM " . $wpdb->term_relationships . " WHERE term_taxonomy_id = %d", array($tt_id)));
|
|
| 1765 | + if ($post_type && in_array($post_type, $post_types) && $post_type.'_tags' == $taxonomy) {
|
|
| 1766 | + $posts_obj = $wpdb->get_results($wpdb->prepare("SELECT object_id FROM ".$wpdb->term_relationships." WHERE term_taxonomy_id = %d", array($tt_id)));
|
|
| 1767 | 1767 | |
| 1768 | 1768 | if (!empty($posts_obj)) {
|
| 1769 | 1769 | foreach ($posts_obj as $post_obj) {
|
| 1770 | 1770 | $post_id = $post_obj->object_id; |
| 1771 | 1771 | |
| 1772 | - $raw_tags = wp_get_object_terms($post_id, $post_type . '_tags', array('fields' => 'names'));
|
|
| 1772 | + $raw_tags = wp_get_object_terms($post_id, $post_type.'_tags', array('fields' => 'names'));
|
|
| 1773 | 1773 | $post_tags = !empty($raw_tags) ? implode(',', $raw_tags) : '';
|
| 1774 | 1774 | |
| 1775 | - $listing_table = $plugin_prefix . $post_type . '_detail'; |
|
| 1776 | - $wpdb->query($wpdb->prepare("UPDATE " . $listing_table . " SET post_tags=%s WHERE post_id =%d", array($post_tags, $post_id)));
|
|
| 1775 | + $listing_table = $plugin_prefix.$post_type.'_detail'; |
|
| 1776 | + $wpdb->query($wpdb->prepare("UPDATE ".$listing_table." SET post_tags=%s WHERE post_id =%d", array($post_tags, $post_id)));
|
|
| 1777 | 1777 | } |
| 1778 | 1778 | } |
| 1779 | 1779 | } |
@@ -1807,7 +1807,7 @@ discard block |
||
| 1807 | 1807 | if ($country_slug == $slug || $region_slug == $slug || $city_slug == $slug) |
| 1808 | 1808 | return $slug_exists = true; |
| 1809 | 1809 | |
| 1810 | - if ($wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s AND term_id != %d", array($slug, $term_id))))
|
|
| 1810 | + if ($wpdb->get_var($wpdb->prepare("SELECT slug FROM ".$table_prefix."terms WHERE slug=%s AND term_id != %d", array($slug, $term_id))))
|
|
| 1811 | 1811 | return $slug_exists = true; |
| 1812 | 1812 | |
| 1813 | 1813 | return $slug_exists; |
@@ -1848,43 +1848,43 @@ discard block |
||
| 1848 | 1848 | |
| 1849 | 1849 | |
| 1850 | 1850 | $gd_page = ''; |
| 1851 | - if(geodir_is_page('home')){
|
|
| 1851 | + if (geodir_is_page('home')) {
|
|
| 1852 | 1852 | $gd_page = 'home'; |
| 1853 | 1853 | $title = (get_option('geodir_meta_title_homepage')) ? get_option('geodir_meta_title_homepage') : $title;
|
| 1854 | 1854 | } |
| 1855 | - elseif(geodir_is_page('detail')){
|
|
| 1855 | + elseif (geodir_is_page('detail')) {
|
|
| 1856 | 1856 | $gd_page = 'detail'; |
| 1857 | 1857 | $title = (get_option('geodir_meta_title_detail')) ? get_option('geodir_meta_title_detail') : $title;
|
| 1858 | 1858 | } |
| 1859 | - elseif(geodir_is_page('pt')){
|
|
| 1859 | + elseif (geodir_is_page('pt')) {
|
|
| 1860 | 1860 | $gd_page = 'pt'; |
| 1861 | 1861 | $title = (get_option('geodir_meta_title_pt')) ? get_option('geodir_meta_title_pt') : $title;
|
| 1862 | 1862 | } |
| 1863 | - elseif(geodir_is_page('listing')){
|
|
| 1863 | + elseif (geodir_is_page('listing')) {
|
|
| 1864 | 1864 | $gd_page = 'listing'; |
| 1865 | 1865 | $title = (get_option('geodir_meta_title_listing')) ? get_option('geodir_meta_title_listing') : $title;
|
| 1866 | 1866 | } |
| 1867 | - elseif(geodir_is_page('location')){
|
|
| 1867 | + elseif (geodir_is_page('location')) {
|
|
| 1868 | 1868 | $gd_page = 'location'; |
| 1869 | 1869 | $title = (get_option('geodir_meta_title_location')) ? get_option('geodir_meta_title_location') : $title;
|
| 1870 | 1870 | } |
| 1871 | - elseif(geodir_is_page('search')){
|
|
| 1871 | + elseif (geodir_is_page('search')) {
|
|
| 1872 | 1872 | $gd_page = 'search'; |
| 1873 | 1873 | $title = (get_option('geodir_meta_title_search')) ? get_option('geodir_meta_title_search') : $title;
|
| 1874 | 1874 | } |
| 1875 | - elseif(geodir_is_page('add-listing')){
|
|
| 1875 | + elseif (geodir_is_page('add-listing')) {
|
|
| 1876 | 1876 | $gd_page = 'add-listing'; |
| 1877 | 1877 | $title = (get_option('geodir_meta_title_add-listing')) ? get_option('geodir_meta_title_add-listing') : $title;
|
| 1878 | 1878 | } |
| 1879 | - elseif(geodir_is_page('author')){
|
|
| 1879 | + elseif (geodir_is_page('author')) {
|
|
| 1880 | 1880 | $gd_page = 'author'; |
| 1881 | 1881 | $title = (get_option('geodir_meta_title_author')) ? get_option('geodir_meta_title_author') : $title;
|
| 1882 | 1882 | } |
| 1883 | - elseif(geodir_is_page('login')){
|
|
| 1883 | + elseif (geodir_is_page('login')) {
|
|
| 1884 | 1884 | $gd_page = 'login'; |
| 1885 | 1885 | $title = (get_option('geodir_meta_title_login')) ? get_option('geodir_meta_title_login') : $title;
|
| 1886 | 1886 | } |
| 1887 | - elseif(geodir_is_page('listing-success')){
|
|
| 1887 | + elseif (geodir_is_page('listing-success')) {
|
|
| 1888 | 1888 | $gd_page = 'listing-success'; |
| 1889 | 1889 | $title = (get_option('geodir_meta_title_listing-success')) ? get_option('geodir_meta_title_listing-success') : $title;
|
| 1890 | 1890 | } |
@@ -1916,12 +1916,12 @@ discard block |
||
| 1916 | 1916 | |
| 1917 | 1917 | if (!get_option('geodir_set_post_attachments')) {
|
| 1918 | 1918 | |
| 1919 | - require_once(ABSPATH . 'wp-admin/includes/image.php'); |
|
| 1920 | - require_once(ABSPATH . 'wp-admin/includes/file.php'); |
|
| 1919 | + require_once(ABSPATH.'wp-admin/includes/image.php'); |
|
| 1920 | + require_once(ABSPATH.'wp-admin/includes/file.php'); |
|
| 1921 | 1921 | |
| 1922 | 1922 | $all_postypes = geodir_get_posttypes(); |
| 1923 | 1923 | |
| 1924 | - foreach($all_postypes as $post_type){
|
|
| 1924 | + foreach ($all_postypes as $post_type) {
|
|
| 1925 | 1925 | $args = array( |
| 1926 | 1926 | 'posts_per_page' => -1, |
| 1927 | 1927 | 'post_type' => $post_type, |
@@ -2015,7 +2015,7 @@ discard block |
||
| 2015 | 2015 | {
|
| 2016 | 2016 | $user_id = get_current_user_id(); |
| 2017 | 2017 | |
| 2018 | - if(!$user_id){return $post;}
|
|
| 2018 | + if (!$user_id) {return $post; }
|
|
| 2019 | 2019 | |
| 2020 | 2020 | $gd_post_types = geodir_get_posttypes(); |
| 2021 | 2021 | |
@@ -2124,7 +2124,7 @@ discard block |
||
| 2124 | 2124 | |
| 2125 | 2125 | if (array_key_exists('post_video', $tabs_arr)) {
|
| 2126 | 2126 | |
| 2127 | - $field_title = $wpdb->get_var($wpdb->prepare("select site_title from " . GEODIR_CUSTOM_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s ", array('geodir_video', $post_type)));
|
|
| 2127 | + $field_title = $wpdb->get_var($wpdb->prepare("select site_title from ".GEODIR_CUSTOM_FIELDS_TABLE." where htmlvar_name = %s and post_type = %s ", array('geodir_video', $post_type)));
|
|
| 2128 | 2128 | |
| 2129 | 2129 | if (isset($tabs_arr['post_video']['heading_text']) && $field_title != '') |
| 2130 | 2130 | $tabs_arr['post_video']['heading_text'] = $field_title; |
@@ -2132,7 +2132,7 @@ discard block |
||
| 2132 | 2132 | |
| 2133 | 2133 | if (array_key_exists('special_offers', $tabs_arr)) {
|
| 2134 | 2134 | |
| 2135 | - $field_title = $wpdb->get_var($wpdb->prepare("select site_title from " . GEODIR_CUSTOM_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s ", array('geodir_special_offers', $post_type)));
|
|
| 2135 | + $field_title = $wpdb->get_var($wpdb->prepare("select site_title from ".GEODIR_CUSTOM_FIELDS_TABLE." where htmlvar_name = %s and post_type = %s ", array('geodir_special_offers', $post_type)));
|
|
| 2136 | 2136 | |
| 2137 | 2137 | if (isset($tabs_arr['special_offers']['heading_text']) && $field_title != '') |
| 2138 | 2138 | $tabs_arr['special_offers']['heading_text'] = $field_title; |
@@ -2153,7 +2153,7 @@ discard block |
||
| 2153 | 2153 | */ |
| 2154 | 2154 | function geodir_remove_template_redirect_actions() |
| 2155 | 2155 | {
|
| 2156 | - if (geodir_is_page('login')){
|
|
| 2156 | + if (geodir_is_page('login')) {
|
|
| 2157 | 2157 | remove_all_actions('template_redirect');
|
| 2158 | 2158 | remove_action('init', 'avia_modify_front', 10);
|
| 2159 | 2159 | } |
@@ -2200,25 +2200,25 @@ discard block |
||
| 2200 | 2200 | $split_img_file_path = isset($split_img_path[1]) ? $split_img_path[1] : ''; |
| 2201 | 2201 | |
| 2202 | 2202 | $wpdb->query( |
| 2203 | - $wpdb->prepare("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id = %d AND file=%s ",
|
|
| 2203 | + $wpdb->prepare("DELETE FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id = %d AND file=%s ",
|
|
| 2204 | 2204 | array($post_id, $split_img_file_path) |
| 2205 | 2205 | ) |
| 2206 | 2206 | ); |
| 2207 | 2207 | |
| 2208 | 2208 | $attachment_data = $wpdb->get_row( |
| 2209 | - $wpdb->prepare("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=%d",
|
|
| 2209 | + $wpdb->prepare("SELECT ID, MIN(`menu_order`) FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id=%d",
|
|
| 2210 | 2210 | array($post_id) |
| 2211 | 2211 | ) |
| 2212 | 2212 | ); |
| 2213 | 2213 | |
| 2214 | 2214 | if (!empty($attachment_data)) {
|
| 2215 | - $wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
|
|
| 2215 | + $wpdb->query("UPDATE ".GEODIR_ATTACHMENT_TABLE." SET menu_order=1 WHERE ID=".$attachment_data->ID);
|
|
| 2216 | 2216 | } |
| 2217 | 2217 | |
| 2218 | 2218 | |
| 2219 | - $table_name = $plugin_prefix . $post_type . '_detail'; |
|
| 2219 | + $table_name = $plugin_prefix.$post_type.'_detail'; |
|
| 2220 | 2220 | |
| 2221 | - $wpdb->query("UPDATE " . $table_name . " SET featured_image='' WHERE post_id =" . $post_id);
|
|
| 2221 | + $wpdb->query("UPDATE ".$table_name." SET featured_image='' WHERE post_id =".$post_id);
|
|
| 2222 | 2222 | |
| 2223 | 2223 | geodir_set_wp_featured_image($post_id); |
| 2224 | 2224 | |
@@ -2246,9 +2246,9 @@ discard block |
||
| 2246 | 2246 | |
| 2247 | 2247 | foreach ($all_postypes as $posttype) {
|
| 2248 | 2248 | |
| 2249 | - $tablename = $plugin_prefix . $posttype . '_detail'; |
|
| 2249 | + $tablename = $plugin_prefix.$posttype.'_detail'; |
|
| 2250 | 2250 | |
| 2251 | - $get_post_data = $wpdb->get_results("SELECT post_id FROM " . $tablename);
|
|
| 2251 | + $get_post_data = $wpdb->get_results("SELECT post_id FROM ".$tablename);
|
|
| 2252 | 2252 | |
| 2253 | 2253 | if (!empty($get_post_data)) {
|
| 2254 | 2254 | |
@@ -2256,7 +2256,7 @@ discard block |
||
| 2256 | 2256 | |
| 2257 | 2257 | $post_id = $data->post_id; |
| 2258 | 2258 | |
| 2259 | - $attachment_data = $wpdb->get_results("SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id =" . $post_id . " AND file!=''");
|
|
| 2259 | + $attachment_data = $wpdb->get_results("SELECT * FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id =".$post_id." AND file!=''");
|
|
| 2260 | 2260 | |
| 2261 | 2261 | if (!empty($attachment_data)) {
|
| 2262 | 2262 | |
@@ -2273,22 +2273,22 @@ discard block |
||
| 2273 | 2273 | |
| 2274 | 2274 | $file_name = $file_info['basename']; |
| 2275 | 2275 | |
| 2276 | - $img_arr['path'] = $uploads_path . $sub_dir . '/' . $file_name; |
|
| 2276 | + $img_arr['path'] = $uploads_path.$sub_dir.'/'.$file_name; |
|
| 2277 | 2277 | |
| 2278 | 2278 | if (!file_exists($img_arr['path'])) {
|
| 2279 | 2279 | |
| 2280 | - $wpdb->query("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE ID=" . $attach->ID);
|
|
| 2280 | + $wpdb->query("DELETE FROM ".GEODIR_ATTACHMENT_TABLE." WHERE ID=".$attach->ID);
|
|
| 2281 | 2281 | |
| 2282 | 2282 | } |
| 2283 | 2283 | |
| 2284 | 2284 | } |
| 2285 | 2285 | |
| 2286 | - $attachment_data = $wpdb->get_row("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=" . $post_id . " GROUP BY post_id");
|
|
| 2286 | + $attachment_data = $wpdb->get_row("SELECT ID, MIN(`menu_order`) FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id=".$post_id." GROUP BY post_id");
|
|
| 2287 | 2287 | |
| 2288 | 2288 | if (!empty($attachment_data)) {
|
| 2289 | 2289 | |
| 2290 | 2290 | if ($attachment_data->ID) |
| 2291 | - $wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
|
|
| 2291 | + $wpdb->query("UPDATE ".GEODIR_ATTACHMENT_TABLE." SET menu_order=1 WHERE ID=".$attachment_data->ID);
|
|
| 2292 | 2292 | |
| 2293 | 2293 | } else {
|
| 2294 | 2294 | |
@@ -2302,7 +2302,7 @@ discard block |
||
| 2302 | 2302 | |
| 2303 | 2303 | } |
| 2304 | 2304 | |
| 2305 | - $wpdb->query("UPDATE " . $tablename . " SET featured_image='' WHERE post_id =" . $post_id);
|
|
| 2305 | + $wpdb->query("UPDATE ".$tablename." SET featured_image='' WHERE post_id =".$post_id);
|
|
| 2306 | 2306 | |
| 2307 | 2307 | geodir_set_wp_featured_image($post_id); |
| 2308 | 2308 | |
@@ -2331,7 +2331,7 @@ discard block |
||
| 2331 | 2331 | {
|
| 2332 | 2332 | |
| 2333 | 2333 | if (!get_option('geodir_default_rating_star_icon')) {
|
| 2334 | - update_option('geodir_default_rating_star_icon', geodir_plugin_url() . '/geodirectory-assets/images/stars.png');
|
|
| 2334 | + update_option('geodir_default_rating_star_icon', geodir_plugin_url().'/geodirectory-assets/images/stars.png');
|
|
| 2335 | 2335 | } |
| 2336 | 2336 | |
| 2337 | 2337 | } |
@@ -2348,10 +2348,10 @@ discard block |
||
| 2348 | 2348 | * @global string $plugin_prefix Geodirectory plugin table prefix. |
| 2349 | 2349 | * @return array User listing count for each post type. |
| 2350 | 2350 | */ |
| 2351 | -function geodir_user_post_listing_count($user_id=null) |
|
| 2351 | +function geodir_user_post_listing_count($user_id = null) |
|
| 2352 | 2352 | {
|
| 2353 | 2353 | global $wpdb, $plugin_prefix, $current_user; |
| 2354 | - if(!$user_id){
|
|
| 2354 | + if (!$user_id) {
|
|
| 2355 | 2355 | $user_id = $current_user->ID; |
| 2356 | 2356 | } |
| 2357 | 2357 | |
@@ -2362,7 +2362,7 @@ discard block |
||
| 2362 | 2362 | $user_listing = array(); |
| 2363 | 2363 | if (is_array($all_posts) && !empty($all_posts)) {
|
| 2364 | 2364 | foreach ($all_posts as $ptype) {
|
| 2365 | - $total_posts = $wpdb->get_var("SELECT count( ID ) FROM " . $wpdb->prefix . "posts WHERE post_author=" . $user_id . " AND post_type='" . $ptype . "' AND ( post_status = 'publish' OR post_status = 'draft' OR post_status = 'private' )");
|
|
| 2365 | + $total_posts = $wpdb->get_var("SELECT count( ID ) FROM ".$wpdb->prefix."posts WHERE post_author=".$user_id." AND post_type='".$ptype."' AND ( post_status = 'publish' OR post_status = 'draft' OR post_status = 'private' )");
|
|
| 2366 | 2366 | |
| 2367 | 2367 | if ($total_posts > 0) {
|
| 2368 | 2368 | $user_listing[$ptype] = $total_posts; |
@@ -2403,19 +2403,19 @@ discard block |
||
| 2403 | 2403 | |
| 2404 | 2404 | $custom_fields = geodir_post_custom_fields($post_package_id, 'all', $post_type, $fields_location); |
| 2405 | 2405 | //remove video and special offers if it is already set to show |
| 2406 | - if(isset($tabs_arr['post_video']['is_display']) && $tabs_arr['post_video']['is_display']){
|
|
| 2406 | + if (isset($tabs_arr['post_video']['is_display']) && $tabs_arr['post_video']['is_display']) {
|
|
| 2407 | 2407 | $unset_video = true; |
| 2408 | 2408 | } |
| 2409 | 2409 | |
| 2410 | - if(isset($tabs_arr['special_offers']['is_display']) && $tabs_arr['special_offers']['is_display']){
|
|
| 2410 | + if (isset($tabs_arr['special_offers']['is_display']) && $tabs_arr['special_offers']['is_display']) {
|
|
| 2411 | 2411 | $unset_special_offers = true; |
| 2412 | 2412 | } |
| 2413 | - if(isset($unset_video) || isset($unset_special_offers) && !empty($custom_fields)){
|
|
| 2414 | - foreach($custom_fields as $key => $custom_field){
|
|
| 2415 | - if($custom_field['name']=='geodir_video' && isset($unset_video)){
|
|
| 2413 | + if (isset($unset_video) || isset($unset_special_offers) && !empty($custom_fields)) {
|
|
| 2414 | + foreach ($custom_fields as $key => $custom_field) {
|
|
| 2415 | + if ($custom_field['name'] == 'geodir_video' && isset($unset_video)) {
|
|
| 2416 | 2416 | unset($custom_fields[$key]); |
| 2417 | 2417 | } |
| 2418 | - if($custom_field['name']=='geodir_special_offers' && isset($unset_special_offers)){
|
|
| 2418 | + if ($custom_field['name'] == 'geodir_special_offers' && isset($unset_special_offers)) {
|
|
| 2419 | 2419 | unset($custom_fields[$key]); |
| 2420 | 2420 | } |
| 2421 | 2421 | } |
@@ -2432,7 +2432,7 @@ discard block |
||
| 2432 | 2432 | $post->{$field_name} = $_REQUEST[$field_name];
|
| 2433 | 2433 | } |
| 2434 | 2434 | |
| 2435 | - if (isset($field['show_in']) && strpos($field['show_in'], '[owntab]') !== false && ((isset($post->{$field_name}) && $post->{$field_name} != '') || $field['type'] == 'fieldset' || $field['type'] == 'address') && in_array($field['type'], array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file','address','taxonomy'))) {
|
|
| 2435 | + if (isset($field['show_in']) && strpos($field['show_in'], '[owntab]') !== false && ((isset($post->{$field_name}) && $post->{$field_name} != '') || $field['type'] == 'fieldset' || $field['type'] == 'address') && in_array($field['type'], array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file', 'address', 'taxonomy'))) {
|
|
| 2436 | 2436 | if ($type['type'] == 'datepicker' && ($post->{$type['htmlvar_name']} == '' || $post->{$type['htmlvar_name']} == '0000-00-00')) {
|
| 2437 | 2437 | continue; |
| 2438 | 2438 | } |
@@ -2465,7 +2465,7 @@ discard block |
||
| 2465 | 2465 | $post->{$field_name} = $_REQUEST[$field_name];
|
| 2466 | 2466 | } |
| 2467 | 2467 | |
| 2468 | - if (isset($field['show_in']) && strpos($field['show_in'], '[owntab]') !== false && ((isset($post->{$field_name}) && $post->{$field_name} != '') || $field['type'] == 'fieldset' || $field['type'] == 'address') && in_array($field['type'], array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file','address','taxonomy'))) {
|
|
| 2468 | + if (isset($field['show_in']) && strpos($field['show_in'], '[owntab]') !== false && ((isset($post->{$field_name}) && $post->{$field_name} != '') || $field['type'] == 'fieldset' || $field['type'] == 'address') && in_array($field['type'], array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file', 'address', 'taxonomy'))) {
|
|
| 2469 | 2469 | $label = $field['site_title'] != '' ? $field['site_title'] : $field['admin_title']; |
| 2470 | 2470 | $site_title = trim($field['site_title']); |
| 2471 | 2471 | $type = $field; |
@@ -2481,21 +2481,21 @@ discard block |
||
| 2481 | 2481 | $variables_array['label'] = __($type['site_title'], 'geodirectory'); |
| 2482 | 2482 | $variables_array['value'] = ''; |
| 2483 | 2483 | $variables_array['value'] = $post->{$type['htmlvar_name']};
|
| 2484 | - }else{
|
|
| 2484 | + } else {
|
|
| 2485 | 2485 | $i = 0; |
| 2486 | 2486 | $fieldset_count++; |
| 2487 | 2487 | $field_set_start = 1; |
| 2488 | - $fieldset_arr[$fieldset_count]['htmlvar_name'] = 'gd_tab_' . $fieldset_count; |
|
| 2488 | + $fieldset_arr[$fieldset_count]['htmlvar_name'] = 'gd_tab_'.$fieldset_count; |
|
| 2489 | 2489 | $fieldset_arr[$fieldset_count]['label'] = $label; |
| 2490 | 2490 | } |
| 2491 | 2491 | |
| 2492 | 2492 | |
| 2493 | - if(isset($type['extra_fields'])){$extra_fields= $type['extra_fields'];}
|
|
| 2493 | + if (isset($type['extra_fields'])) {$extra_fields = $type['extra_fields']; }
|
|
| 2494 | 2494 | $type = stripslashes_deep($type); // strip slashes |
| 2495 | - if(isset($type['extra_fields'])){$type['extra_fields'] = $extra_fields;}
|
|
| 2495 | + if (isset($type['extra_fields'])) {$type['extra_fields'] = $extra_fields; }
|
|
| 2496 | 2496 | $html = ''; |
| 2497 | 2497 | $html_var = isset($type['htmlvar_name']) ? $type['htmlvar_name'] : ''; |
| 2498 | - if($html_var=='post'){$html_var='post_address';}
|
|
| 2498 | + if ($html_var == 'post') {$html_var = 'post_address'; }
|
|
| 2499 | 2499 | $field_icon = geodir_field_icon_proccess($type); |
| 2500 | 2500 | $filed_type = $type['type']; |
| 2501 | 2501 | |
@@ -2508,7 +2508,7 @@ discard block |
||
| 2508 | 2508 | * @param string $fields_location The location the field is to be show. |
| 2509 | 2509 | * @param array $type The array of field values. |
| 2510 | 2510 | */ |
| 2511 | - $html = apply_filters("geodir_custom_field_output_{$filed_type}",$html,$fields_location,$type);
|
|
| 2511 | + $html = apply_filters("geodir_custom_field_output_{$filed_type}", $html, $fields_location, $type);
|
|
| 2512 | 2512 | |
| 2513 | 2513 | |
| 2514 | 2514 | /** |
@@ -2554,7 +2554,7 @@ discard block |
||
| 2554 | 2554 | * @param string $htmlvar_name The field HTML var name. |
| 2555 | 2555 | */ |
| 2556 | 2556 | 'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, $htmlvar_name),
|
| 2557 | - 'tab_content' => '<div class="geodir-company_info field-group xxx">' . $fieldset_html . '</div>' |
|
| 2557 | + 'tab_content' => '<div class="geodir-company_info field-group xxx">'.$fieldset_html.'</div>' |
|
| 2558 | 2558 | ); |
| 2559 | 2559 | } |
| 2560 | 2560 | } else {
|
@@ -2616,7 +2616,7 @@ discard block |
||
| 2616 | 2616 | } |
| 2617 | 2617 | $status .= ")</strong>"; |
| 2618 | 2618 | |
| 2619 | - $html = '<span class="geodir-post-status">' . $status_icon . ' <font class="geodir-status-label">' . __('Status: ', 'geodirectory') . '</font>' . $status . '</span>';
|
|
| 2619 | + $html = '<span class="geodir-post-status">'.$status_icon.' <font class="geodir-status-label">'.__('Status: ', 'geodirectory').'</font>'.$status.'</span>';
|
|
| 2620 | 2620 | } |
| 2621 | 2621 | } |
| 2622 | 2622 | |
@@ -2685,7 +2685,7 @@ discard block |
||
| 2685 | 2685 | * @return array Modified class array. |
| 2686 | 2686 | */ |
| 2687 | 2687 | function geodir_body_class_active_map($classes = array()) {
|
| 2688 | - $classes[] = 'gd-map-' . geodir_map_name(); |
|
| 2688 | + $classes[] = 'gd-map-'.geodir_map_name(); |
|
| 2689 | 2689 | |
| 2690 | 2690 | return $classes; |
| 2691 | 2691 | } |
@@ -2700,7 +2700,7 @@ discard block |
||
| 2700 | 2700 | * @return string Modified class string. |
| 2701 | 2701 | */ |
| 2702 | 2702 | function geodir_admin_body_class_active_map($class = '') {
|
| 2703 | - $class .= ' gd-map-' . geodir_map_name(); |
|
| 2703 | + $class .= ' gd-map-'.geodir_map_name(); |
|
| 2704 | 2704 | |
| 2705 | 2705 | return $class; |
| 2706 | 2706 | } |
@@ -2720,7 +2720,7 @@ discard block |
||
| 2720 | 2720 | * @return array Translation texts. |
| 2721 | 2721 | */ |
| 2722 | 2722 | function geodir_load_gd_options_text_translation($translation_texts = array()) {
|
| 2723 | - $translation_texts = !empty( $translation_texts ) && is_array( $translation_texts ) ? $translation_texts : array(); |
|
| 2723 | + $translation_texts = !empty($translation_texts) && is_array($translation_texts) ? $translation_texts : array(); |
|
| 2724 | 2724 | |
| 2725 | 2725 | $gd_options = array('geodir_post_submited_success_email_subject_admin', 'geodir_post_submited_success_email_content_admin', 'geodir_post_submited_success_email_subject', 'geodir_post_submited_success_email_content', 'geodir_forgot_password_subject', 'geodir_forgot_password_content', 'geodir_registration_success_email_subject', 'geodir_registration_success_email_content', 'geodir_post_published_email_subject', 'geodir_post_published_email_content', 'geodir_email_friend_subject', 'geodir_email_friend_content', 'geodir_email_enquiry_subject', 'geodir_email_enquiry_content', 'geodir_post_added_success_msg_content', 'geodir_post_edited_email_subject_admin', 'geodir_post_edited_email_content_admin');
|
| 2726 | 2726 | |
@@ -2786,17 +2786,17 @@ discard block |
||
| 2786 | 2786 | * @param array $args The array of menu arguments. |
| 2787 | 2787 | * @return array The modified arguments. |
| 2788 | 2788 | */ |
| 2789 | -function geodir_add_nav_menu_class( $args ) |
|
| 2789 | +function geodir_add_nav_menu_class($args) |
|
| 2790 | 2790 | {
|
| 2791 | 2791 | |
| 2792 | - if(isset($args['menu_class'])){
|
|
| 2792 | + if (isset($args['menu_class'])) {
|
|
| 2793 | 2793 | $args['menu_class'] = $args['menu_class']." gd-menu-z"; |
| 2794 | 2794 | } |
| 2795 | 2795 | |
| 2796 | 2796 | return $args; |
| 2797 | 2797 | } |
| 2798 | 2798 | |
| 2799 | -add_filter( 'wp_nav_menu_args', 'geodir_add_nav_menu_class' ); |
|
| 2799 | +add_filter('wp_nav_menu_args', 'geodir_add_nav_menu_class');
|
|
| 2800 | 2800 | |
| 2801 | 2801 | /** |
| 2802 | 2802 | * Filters WordPress locale ID. |
@@ -2836,9 +2836,9 @@ discard block |
||
| 2836 | 2836 | } |
| 2837 | 2837 | |
| 2838 | 2838 | add_action('geodir_after_save_listing', 'geodir_wpml_duplicate_listing', 100, 2);
|
| 2839 | - add_action( 'geodir_edit_post_link_html', 'geodir_wpml_frontend_duplicate_listing', 0, 1 ); |
|
| 2839 | + add_action('geodir_edit_post_link_html', 'geodir_wpml_frontend_duplicate_listing', 0, 1);
|
|
| 2840 | 2840 | if (is_admin()) {
|
| 2841 | - add_filter( 'geodir_design_settings', 'geodir_wpml_duplicate_settings', 10, 1 ); |
|
| 2841 | + add_filter('geodir_design_settings', 'geodir_wpml_duplicate_settings', 10, 1);
|
|
| 2842 | 2842 | } |
| 2843 | 2843 | } |
| 2844 | 2844 | } |
@@ -2867,7 +2867,7 @@ discard block |
||
| 2867 | 2867 | } |
| 2868 | 2868 | |
| 2869 | 2869 | if (!empty($keep_vars)) {
|
| 2870 | - foreach ( $languages as $code => $url) {
|
|
| 2870 | + foreach ($languages as $code => $url) {
|
|
| 2871 | 2871 | $filter_url = $url['url']; |
| 2872 | 2872 | |
| 2873 | 2873 | foreach ($keep_vars as $var) {
|
@@ -2886,7 +2886,7 @@ discard block |
||
| 2886 | 2886 | |
| 2887 | 2887 | return $languages; |
| 2888 | 2888 | } |
| 2889 | -add_filter( 'icl_ls_languages', 'geodir_wpml_filter_ls_languages', 11, 1 ); |
|
| 2889 | +add_filter('icl_ls_languages', 'geodir_wpml_filter_ls_languages', 11, 1);
|
|
| 2890 | 2890 | |
| 2891 | 2891 | /** |
| 2892 | 2892 | * Remove Yoast SEO hook if disabled on GD pages. |
@@ -2894,18 +2894,18 @@ discard block |
||
| 2894 | 2894 | * @since 1.6.18 |
| 2895 | 2895 | * |
| 2896 | 2896 | */ |
| 2897 | -function geodir_remove_yoast_seo_metas(){
|
|
| 2898 | - if ( class_exists( 'WPSEO_Frontend' ) && geodir_is_geodir_page() && geodir_disable_yoast_seo_metas() ) {
|
|
| 2897 | +function geodir_remove_yoast_seo_metas() {
|
|
| 2898 | + if (class_exists('WPSEO_Frontend') && geodir_is_geodir_page() && geodir_disable_yoast_seo_metas()) {
|
|
| 2899 | 2899 | $wpseo = WPSEO_Frontend::get_instance(); |
| 2900 | 2900 | |
| 2901 | - remove_action( 'wp_head', array( $wpseo, 'metadesc' ), 6 ); |
|
| 2902 | - remove_action( 'wp_head', array( $wpseo, 'metakeywords' ), 11 ); |
|
| 2903 | - remove_filter( 'pre_get_document_title', array( $wpseo, 'title' ), 15 ); |
|
| 2904 | - remove_filter( 'wp_title', array( $wpseo, 'title' ), 15, 3 ); |
|
| 2905 | - remove_filter( 'thematic_doctitle', array( $wpseo, 'title' ), 15 ); |
|
| 2906 | - remove_filter( 'woo_title', array( $wpseo, 'fix_woo_title' ), 99 ); |
|
| 2901 | + remove_action('wp_head', array($wpseo, 'metadesc'), 6);
|
|
| 2902 | + remove_action('wp_head', array($wpseo, 'metakeywords'), 11);
|
|
| 2903 | + remove_filter('pre_get_document_title', array($wpseo, 'title'), 15);
|
|
| 2904 | + remove_filter('wp_title', array($wpseo, 'title'), 15, 3);
|
|
| 2905 | + remove_filter('thematic_doctitle', array($wpseo, 'title'), 15);
|
|
| 2906 | + remove_filter('woo_title', array($wpseo, 'fix_woo_title'), 99);
|
|
| 2907 | 2907 | |
| 2908 | - remove_action( 'template_redirect', 'wpseo_frontend_head_init', 999 ); |
|
| 2908 | + remove_action('template_redirect', 'wpseo_frontend_head_init', 999);
|
|
| 2909 | 2909 | } |
| 2910 | 2910 | } |
| 2911 | 2911 | |
@@ -2920,22 +2920,22 @@ discard block |
||
| 2920 | 2920 | * |
| 2921 | 2921 | */ |
| 2922 | 2922 | function geodir_wpml_ajax_set_guest_lang() {
|
| 2923 | - if ( geodir_is_wpml() && wpml_is_ajax() && !is_user_logged_in() ) {
|
|
| 2924 | - if ( empty( $_GET['lang'] ) && !( !empty( $_SERVER['REQUEST_URI'] ) && preg_match( '@\.(css|js|png|jpg|gif|jpeg|bmp)@i', basename( preg_replace( '@\?.*$@', '', $_SERVER['REQUEST_URI'] ) ) ) ) ) {
|
|
| 2923 | + if (geodir_is_wpml() && wpml_is_ajax() && !is_user_logged_in()) {
|
|
| 2924 | + if (empty($_GET['lang']) && !(!empty($_SERVER['REQUEST_URI']) && preg_match('@\.(css|js|png|jpg|gif|jpeg|bmp)@i', basename(preg_replace('@\?.*$@', '', $_SERVER['REQUEST_URI']))))) {
|
|
| 2925 | 2925 | global $sitepress; |
| 2926 | 2926 | |
| 2927 | 2927 | $referer = wp_get_referer(); |
| 2928 | 2928 | |
| 2929 | 2929 | $current_lang = $sitepress->get_current_language(); |
| 2930 | - $referrer_lang = $sitepress->get_language_from_url( $referer ); |
|
| 2930 | + $referrer_lang = $sitepress->get_language_from_url($referer); |
|
| 2931 | 2931 | |
| 2932 | - if ( $referrer_lang && $current_lang != $referrer_lang ) {
|
|
| 2932 | + if ($referrer_lang && $current_lang != $referrer_lang) {
|
|
| 2933 | 2933 | $_GET['lang'] = $referrer_lang; |
| 2934 | 2934 | } |
| 2935 | 2935 | } |
| 2936 | 2936 | } |
| 2937 | 2937 | } |
| 2938 | -add_action( 'plugins_loaded', 'geodir_wpml_ajax_set_guest_lang', -1 ); |
|
| 2938 | +add_action('plugins_loaded', 'geodir_wpml_ajax_set_guest_lang', -1);
|
|
| 2939 | 2939 | |
| 2940 | 2940 | /** |
| 2941 | 2941 | * Change country slug czech-republic to czechia and redirect. |
@@ -2956,18 +2956,18 @@ discard block |
||
| 2956 | 2956 | } |
| 2957 | 2957 | |
| 2958 | 2958 | $redirect = false; |
| 2959 | - if (strpos($current_url, '/' . $search . '/') !== false) {
|
|
| 2959 | + if (strpos($current_url, '/'.$search.'/') !== false) {
|
|
| 2960 | 2960 | $redirect = true; |
| 2961 | - $current_url = preg_replace('/\/' . $search . '\//', '/' . $replace . '/', $current_url, 1);
|
|
| 2961 | + $current_url = preg_replace('/\/'.$search.'\//', '/'.$replace.'/', $current_url, 1);
|
|
| 2962 | 2962 | } |
| 2963 | 2963 | |
| 2964 | 2964 | if ($has_slash != "/") {
|
| 2965 | 2965 | $current_url = trim($current_url, '/'); |
| 2966 | 2966 | } |
| 2967 | 2967 | |
| 2968 | - if (strpos($current_url, 'gd_country=' . $search) !== false) {
|
|
| 2968 | + if (strpos($current_url, 'gd_country='.$search) !== false) {
|
|
| 2969 | 2969 | $redirect = true; |
| 2970 | - $current_url = str_replace('gd_country=' . $search, 'gd_country=' . $replace, $current_url);
|
|
| 2970 | + $current_url = str_replace('gd_country='.$search, 'gd_country='.$replace, $current_url);
|
|
| 2971 | 2971 | } |
| 2972 | 2972 | |
| 2973 | 2973 | if ($redirect) {
|
@@ -2992,26 +2992,26 @@ discard block |
||
| 2992 | 2992 | * @param int $post_parent Post parent ID |
| 2993 | 2993 | * @param string $original_slug The original post slug. |
| 2994 | 2994 | */ |
| 2995 | -function geodir_check_post_to_term_slug( $slug, $post_ID, $post_status, $post_type, $post_parent, $original_slug ) {
|
|
| 2995 | +function geodir_check_post_to_term_slug($slug, $post_ID, $post_status, $post_type, $post_parent, $original_slug) {
|
|
| 2996 | 2996 | global $wpdb; |
| 2997 | 2997 | |
| 2998 | - if ( $post_type && strpos( $post_type, 'gd_' ) === 0 ) {
|
|
| 2999 | - $term_slug_check = $wpdb->get_var( $wpdb->prepare( "SELECT t.slug FROM $wpdb->terms AS t LEFT JOIN $wpdb->term_taxonomy AS tt ON tt.term_id = t.term_id WHERE slug = '%s' AND ( taxonomy = '" . $post_type . "category' OR taxonomy = '" . $post_type . "_tags' ) LIMIT 1", $slug ) ); |
|
| 2998 | + if ($post_type && strpos($post_type, 'gd_') === 0) {
|
|
| 2999 | + $term_slug_check = $wpdb->get_var($wpdb->prepare("SELECT t.slug FROM $wpdb->terms AS t LEFT JOIN $wpdb->term_taxonomy AS tt ON tt.term_id = t.term_id WHERE slug = '%s' AND ( taxonomy = '".$post_type."category' OR taxonomy = '".$post_type."_tags' ) LIMIT 1", $slug));
|
|
| 3000 | 3000 | |
| 3001 | - if ( $term_slug_check ) {
|
|
| 3001 | + if ($term_slug_check) {
|
|
| 3002 | 3002 | $suffix = 1; |
| 3003 | 3003 | |
| 3004 | 3004 | do {
|
| 3005 | - $alt_slug = _truncate_post_slug( $original_slug, 200 - ( strlen( $suffix ) + 1 ) ) . "-$suffix"; |
|
| 3005 | + $alt_slug = _truncate_post_slug($original_slug, 200 - (strlen($suffix) + 1))."-$suffix"; |
|
| 3006 | 3006 | |
| 3007 | - $term_check = $wpdb->get_var( $wpdb->prepare( "SELECT t.slug FROM $wpdb->terms AS t LEFT JOIN $wpdb->term_taxonomy AS tt ON tt.term_id = t.term_id WHERE slug = '%s' AND ( taxonomy = '" . $post_type . "category' OR taxonomy = '" . $post_type . "_tags' ) LIMIT 1", $alt_slug ) ); |
|
| 3007 | + $term_check = $wpdb->get_var($wpdb->prepare("SELECT t.slug FROM $wpdb->terms AS t LEFT JOIN $wpdb->term_taxonomy AS tt ON tt.term_id = t.term_id WHERE slug = '%s' AND ( taxonomy = '".$post_type."category' OR taxonomy = '".$post_type."_tags' ) LIMIT 1", $alt_slug));
|
|
| 3008 | 3008 | |
| 3009 | - $post_check = !$term_check && $wpdb->get_var( $wpdb->prepare( "SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND post_type = %s AND ID != %d LIMIT 1", $alt_slug, $post_type, $post_ID ) ); |
|
| 3009 | + $post_check = !$term_check && $wpdb->get_var($wpdb->prepare("SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND post_type = %s AND ID != %d LIMIT 1", $alt_slug, $post_type, $post_ID));
|
|
| 3010 | 3010 | |
| 3011 | 3011 | $term_slug_check = $term_check || $post_check; |
| 3012 | 3012 | |
| 3013 | 3013 | $suffix++; |
| 3014 | - } while ( $term_slug_check ); |
|
| 3014 | + } while ($term_slug_check); |
|
| 3015 | 3015 | |
| 3016 | 3016 | $slug = $alt_slug; |
| 3017 | 3017 | } |
@@ -3019,7 +3019,7 @@ discard block |
||
| 3019 | 3019 | |
| 3020 | 3020 | return $slug; |
| 3021 | 3021 | } |
| 3022 | -add_filter( 'wp_unique_post_slug', 'geodir_check_post_to_term_slug', 10, 6 ); |
|
| 3022 | +add_filter('wp_unique_post_slug', 'geodir_check_post_to_term_slug', 10, 6);
|
|
| 3023 | 3023 | |
| 3024 | 3024 | /** |
| 3025 | 3025 | * Check whether a post name with slug exists or not. |
@@ -3034,25 +3034,25 @@ discard block |
||
| 3034 | 3034 | * @param int $term_id The term ID. |
| 3035 | 3035 | * @return bool true when exists. false when not exists. |
| 3036 | 3036 | */ |
| 3037 | -function geodir_check_term_to_post_slug( $slug_exists, $slug, $term_id ) {
|
|
| 3037 | +function geodir_check_term_to_post_slug($slug_exists, $slug, $term_id) {
|
|
| 3038 | 3038 | global $wpdb, $gd_term_post_type; |
| 3039 | 3039 | |
| 3040 | - if ( $slug_exists ) {
|
|
| 3040 | + if ($slug_exists) {
|
|
| 3041 | 3041 | return $slug_exists; |
| 3042 | 3042 | } |
| 3043 | 3043 | |
| 3044 | - if ( !empty( $gd_term_post_type ) && $gd_term_post_type[$term_id] ) {
|
|
| 3044 | + if (!empty($gd_term_post_type) && $gd_term_post_type[$term_id]) {
|
|
| 3045 | 3045 | $post_type = $gd_term_post_type[$term_id]; |
| 3046 | 3046 | } else {
|
| 3047 | - $taxonomy = $wpdb->get_var( $wpdb->prepare( "SELECT taxonomy FROM $wpdb->term_taxonomy WHERE term_id = %d LIMIT 1", $term_id ) ); |
|
| 3048 | - $taxonomy_obj = get_taxonomy( $taxonomy ); |
|
| 3049 | - $post_type = !empty( $taxonomy_obj->object_type ) ? $taxonomy_obj->object_type[0] : NULL; |
|
| 3047 | + $taxonomy = $wpdb->get_var($wpdb->prepare("SELECT taxonomy FROM $wpdb->term_taxonomy WHERE term_id = %d LIMIT 1", $term_id));
|
|
| 3048 | + $taxonomy_obj = get_taxonomy($taxonomy); |
|
| 3049 | + $post_type = !empty($taxonomy_obj->object_type) ? $taxonomy_obj->object_type[0] : NULL; |
|
| 3050 | 3050 | } |
| 3051 | 3051 | |
| 3052 | - if ( $post_type && $wpdb->get_var( $wpdb->prepare( "SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND post_type = %s LIMIT 1", $slug, $post_type ) ) ) {
|
|
| 3052 | + if ($post_type && $wpdb->get_var($wpdb->prepare("SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND post_type = %s LIMIT 1", $slug, $post_type))) {
|
|
| 3053 | 3053 | $slug_exists = true; |
| 3054 | 3054 | } |
| 3055 | 3055 | |
| 3056 | 3056 | return $slug_exists; |
| 3057 | 3057 | } |
| 3058 | -add_filter( 'geodir_term_slug_is_exists', 'geodir_check_term_to_post_slug', 10, 3 ); |
|
| 3059 | 3058 | \ No newline at end of file |
| 3059 | +add_filter('geodir_term_slug_is_exists', 'geodir_check_term_to_post_slug', 10, 3); |
|
| 3060 | 3060 | \ No newline at end of file |
@@ -60,16 +60,16 @@ discard block |
||
| 60 | 60 | * @since 1.0.0 |
| 61 | 61 | * @param string $menu_class The menu HTML class. |
| 62 | 62 | */ |
| 63 | - $li_class = apply_filters('geodir_menu_li_class', 'menu-item ' . $menu_class);
|
|
| 63 | + $li_class = apply_filters('geodir_menu_li_class', 'menu-item '.$menu_class);
|
|
| 64 | 64 | /** |
| 65 | 65 | * Filter the menu a class. |
| 66 | 66 | * |
| 67 | 67 | * @since 1.0.0 |
| 68 | 68 | */ |
| 69 | 69 | $a_class = apply_filters('geodir_menu_a_class', '');
|
| 70 | - $items .= '<li class="' . $li_class . '"> |
|
| 71 | - <a href="' . get_post_type_archive_link($post_type) . '" class="' . $a_class . '"> |
|
| 72 | - ' . __(geodir_utf8_ucfirst($args->labels->name),'geodirectory') . ' |
|
| 70 | + $items .= '<li class="'.$li_class.'"> |
|
| 71 | + <a href="' . get_post_type_archive_link($post_type).'" class="'.$a_class.'"> |
|
| 72 | + ' . __(geodir_utf8_ucfirst($args->labels->name), 'geodirectory').' |
|
| 73 | 73 | </a> |
| 74 | 74 | </li>'; |
| 75 | 75 | } |
@@ -88,14 +88,14 @@ discard block |
||
| 88 | 88 | * @since 1.0.0 |
| 89 | 89 | * @param string $menu_class The menu HTML class. |
| 90 | 90 | */ |
| 91 | - $li_class = apply_filters('geodir_menu_li_class', 'menu-item menu-item-has-children menu-gd-listings ' . $menu_class);
|
|
| 91 | + $li_class = apply_filters('geodir_menu_li_class', 'menu-item menu-item-has-children menu-gd-listings '.$menu_class);
|
|
| 92 | 92 | /** |
| 93 | 93 | * Filter the sub menu li class. |
| 94 | 94 | * |
| 95 | 95 | * @since 1.0.0 |
| 96 | 96 | * @param string $menu_class The menu HTML class. |
| 97 | 97 | */ |
| 98 | - $sub_li_class = apply_filters('geodir_sub_menu_li_class', 'menu-item ' . $menu_class);
|
|
| 98 | + $sub_li_class = apply_filters('geodir_sub_menu_li_class', 'menu-item '.$menu_class);
|
|
| 99 | 99 | /** |
| 100 | 100 | * Filter the sub menu ul class. |
| 101 | 101 | * |
@@ -114,9 +114,9 @@ discard block |
||
| 114 | 114 | * @since 1.0.0 |
| 115 | 115 | */ |
| 116 | 116 | $sub_a_class = apply_filters('geodir_sub_menu_a_class', '');
|
| 117 | - $items .= '<li class="' . $li_class . '"> |
|
| 118 | - <a href="#" class="' . $a_class . '">' . __('Listing', 'geodirectory') . '</a>
|
|
| 119 | - <ul class="' . $sub_ul_class . '">'; |
|
| 117 | + $items .= '<li class="'.$li_class.'"> |
|
| 118 | + <a href="#" class="' . $a_class.'">'.__('Listing', 'geodirectory').'</a>
|
|
| 119 | + <ul class="' . $sub_ul_class.'">'; |
|
| 120 | 120 | $post_types = geodir_get_posttypes('object');
|
| 121 | 121 | |
| 122 | 122 | $show_listing_post_types = get_option('geodir_add_posttype_in_listing_nav');
|
@@ -133,9 +133,9 @@ discard block |
||
| 133 | 133 | if (geodir_get_current_posttype() == $post_type && geodir_is_page('listing'))
|
| 134 | 134 | $menu_class = 'current-menu-item'; |
| 135 | 135 | |
| 136 | - $items .= '<li class="' . $sub_li_class . '"> |
|
| 137 | - <a href="' . get_post_type_archive_link($post_type) . '" class="' . $sub_a_class . '"> |
|
| 138 | - ' . __(geodir_utf8_ucfirst($args->labels->name),'geodirectory') . ' |
|
| 136 | + $items .= '<li class="'.$sub_li_class.'"> |
|
| 137 | + <a href="' . get_post_type_archive_link($post_type).'" class="'.$sub_a_class.'"> |
|
| 138 | + ' . __(geodir_utf8_ucfirst($args->labels->name), 'geodirectory').' |
|
| 139 | 139 | </a> |
| 140 | 140 | </li>'; |
| 141 | 141 | } |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | * |
| 152 | 152 | * @since 1.5.9 |
| 153 | 153 | */ |
| 154 | - $items .= apply_filters('geodir_menu_after_sub_ul','');
|
|
| 154 | + $items .= apply_filters('geodir_menu_after_sub_ul', '');
|
|
| 155 | 155 | $items .= '</li>'; |
| 156 | 156 | } |
| 157 | 157 | } |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | * @since 1.0.0 |
| 185 | 185 | * @param string $menu_class The menu HTML class. |
| 186 | 186 | */ |
| 187 | - $li_class = apply_filters('geodir_menu_li_class', 'menu-item ' . $menu_class);
|
|
| 187 | + $li_class = apply_filters('geodir_menu_li_class', 'menu-item '.$menu_class);
|
|
| 188 | 188 | /** |
| 189 | 189 | * Filter the menu a class. |
| 190 | 190 | * |
@@ -192,9 +192,9 @@ discard block |
||
| 192 | 192 | */ |
| 193 | 193 | $a_class = apply_filters('geodir_menu_a_class', '');
|
| 194 | 194 | $cpt_name = __($args->labels->singular_name, 'geodirectory'); |
| 195 | - $items .= '<li class="' . $li_class . '"> |
|
| 196 | - <a href="' . geodir_get_addlisting_link($post_type) . '" class="' . $a_class . '"> |
|
| 197 | - ' . sprintf( __('Add %s', 'geodirectory'), $cpt_name ) . '
|
|
| 195 | + $items .= '<li class="'.$li_class.'"> |
|
| 196 | + <a href="' . geodir_get_addlisting_link($post_type).'" class="'.$a_class.'"> |
|
| 197 | + ' . sprintf(__('Add %s', 'geodirectory'), $cpt_name).'
|
|
| 198 | 198 | </a> |
| 199 | 199 | </li>'; |
| 200 | 200 | } |
@@ -218,14 +218,14 @@ discard block |
||
| 218 | 218 | * @since 1.0.0 |
| 219 | 219 | * @param string $menu_class The menu HTML class. |
| 220 | 220 | */ |
| 221 | - $li_class = apply_filters('geodir_menu_li_class', 'menu-item menu-item-has-children menu-gd-add-listing ' . $menu_class);
|
|
| 221 | + $li_class = apply_filters('geodir_menu_li_class', 'menu-item menu-item-has-children menu-gd-add-listing '.$menu_class);
|
|
| 222 | 222 | /** |
| 223 | 223 | * Filter the sub menu li class. |
| 224 | 224 | * |
| 225 | 225 | * @since 1.0.0 |
| 226 | 226 | * @param string $menu_class The menu HTML class. |
| 227 | 227 | */ |
| 228 | - $sub_li_class = apply_filters('geodir_sub_menu_li_class', 'menu-item ' . $menu_class);
|
|
| 228 | + $sub_li_class = apply_filters('geodir_sub_menu_li_class', 'menu-item '.$menu_class);
|
|
| 229 | 229 | /** |
| 230 | 230 | * Filter the sub menu ul class. |
| 231 | 231 | * |
@@ -244,9 +244,9 @@ discard block |
||
| 244 | 244 | * @since 1.0.0 |
| 245 | 245 | */ |
| 246 | 246 | $sub_a_class = apply_filters('geodir_sub_menu_a_class', '');
|
| 247 | - $items .= '<li class="' . $li_class . '"> |
|
| 248 | - <a href="#" class="' . $a_class . '">' . __('Add Listing', 'geodirectory') . '</a>
|
|
| 249 | - <ul class="' . $sub_ul_class . '">'; |
|
| 247 | + $items .= '<li class="'.$li_class.'"> |
|
| 248 | + <a href="#" class="' . $a_class.'">'.__('Add Listing', 'geodirectory').'</a>
|
|
| 249 | + <ul class="' . $sub_ul_class.'">'; |
|
| 250 | 250 | |
| 251 | 251 | $post_types = geodir_get_posttypes('object');
|
| 252 | 252 | |
@@ -269,11 +269,11 @@ discard block |
||
| 269 | 269 | * @since 1.0.0 |
| 270 | 270 | * @param string $menu_class The menu HTML class. |
| 271 | 271 | */ |
| 272 | - $li_class = apply_filters('geodir_menu_li_class', 'menu-item ' . $menu_class);
|
|
| 272 | + $li_class = apply_filters('geodir_menu_li_class', 'menu-item '.$menu_class);
|
|
| 273 | 273 | $cpt_name = __($args->labels->singular_name, 'geodirectory'); |
| 274 | - $items .= '<li class="' . $sub_li_class . '"> |
|
| 275 | - <a href="' . geodir_get_addlisting_link($post_type) . '" class="' . $sub_a_class . '"> |
|
| 276 | - ' . sprintf( __('Add %s', 'geodirectory'), $cpt_name ) . '
|
|
| 274 | + $items .= '<li class="'.$sub_li_class.'"> |
|
| 275 | + <a href="' . geodir_get_addlisting_link($post_type).'" class="'.$sub_a_class.'"> |
|
| 276 | + ' . sprintf(__('Add %s', 'geodirectory'), $cpt_name).'
|
|
| 277 | 277 | </a> |
| 278 | 278 | </li>'; |
| 279 | 279 | } |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | } |
| 286 | 286 | |
| 287 | 287 | $items .= ' </ul> '; |
| 288 | - $items .= apply_filters('geodir_menu_after_sub_ul','');
|
|
| 288 | + $items .= apply_filters('geodir_menu_after_sub_ul', '');
|
|
| 289 | 289 | $items .= '</li>'; |
| 290 | 290 | |
| 291 | 291 | } |
@@ -313,14 +313,14 @@ discard block |
||
| 313 | 313 | $geodir_theme_location = get_option('geodir_theme_location_nav');
|
| 314 | 314 | $geodir_theme_location_nav = array(); |
| 315 | 315 | if (empty($locations) && empty($geodir_theme_location)) {
|
| 316 | - $menu = str_replace("</ul></div>", geodir_add_nav_menu_items() . "</ul></div>", $menu);
|
|
| 316 | + $menu = str_replace("</ul></div>", geodir_add_nav_menu_items()."</ul></div>", $menu);
|
|
| 317 | 317 | $geodir_theme_location_nav[] = $args['theme_location']; |
| 318 | 318 | update_option('geodir_theme_location_nav', $geodir_theme_location_nav);
|
| 319 | 319 | } |
| 320 | 320 | //else if(empty($geodir_theme_location)) // It means 'Show geodirectory navigation in selected menu locations' is not set yet. |
| 321 | 321 | // $menu = str_replace("</ul></div>",geodir_add_nav_menu_items()."</ul></div>",$menu);
|
| 322 | 322 | else if (is_array($geodir_theme_location) && isset($args['theme_location']) && in_array($args['theme_location'], $geodir_theme_location)) |
| 323 | - $menu = str_replace("</ul></div>", geodir_add_nav_menu_items() . "</ul></div>", $menu);
|
|
| 323 | + $menu = str_replace("</ul></div>", geodir_add_nav_menu_items()."</ul></div>", $menu);
|
|
| 324 | 324 | |
| 325 | 325 | return $menu; |
| 326 | 326 | |
@@ -348,7 +348,7 @@ discard block |
||
| 348 | 348 | |
| 349 | 349 | if (has_nav_menu($location) == '1' && is_array($geodir_theme_location) && in_array($location, $geodir_theme_location)) {
|
| 350 | 350 | |
| 351 | - $items = $items . geodir_add_nav_menu_items(); |
|
| 351 | + $items = $items.geodir_add_nav_menu_items(); |
|
| 352 | 352 | return $items; |
| 353 | 353 | |
| 354 | 354 | } else {
|
@@ -373,12 +373,12 @@ discard block |
||
| 373 | 373 | |
| 374 | 374 | $taxonomies = geodir_get_taxonomies(); |
| 375 | 375 | $taxonomies = implode("','", $taxonomies);
|
| 376 | - $taxonomies = "'" . $taxonomies . "'"; |
|
| 376 | + $taxonomies = "'".$taxonomies."'"; |
|
| 377 | 377 | |
| 378 | 378 | $pn_categories = $wpdb->get_results( |
| 379 | 379 | $wpdb->prepare( |
| 380 | 380 | "SELECT $wpdb->terms.name as name, $wpdb->term_taxonomy.count as count, $wpdb->terms.term_id as cat_ID FROM $wpdb->term_taxonomy, $wpdb->terms WHERE $wpdb->term_taxonomy.term_id = %d AND $wpdb->term_taxonomy.taxonomy in ( $taxonomies ) ORDER BY name", |
| 381 | - array($wpdb->terms . term_id) |
|
| 381 | + array($wpdb->terms.term_id) |
|
| 382 | 382 | ) |
| 383 | 383 | ); |
| 384 | 384 | |
@@ -408,7 +408,7 @@ discard block |
||
| 408 | 408 | |
| 409 | 409 | if (geodir_is_page('add-listing') || geodir_is_page('preview')) {
|
| 410 | 410 | if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') |
| 411 | - $geodir_post_type = get_post_type((int)$_REQUEST['pid']); |
|
| 411 | + $geodir_post_type = get_post_type((int) $_REQUEST['pid']); |
|
| 412 | 412 | elseif (isset($_REQUEST['listing_type'])) |
| 413 | 413 | $geodir_post_type = sanitize_text_field($_REQUEST['listing_type']); |
| 414 | 414 | } |
@@ -434,7 +434,7 @@ discard block |
||
| 434 | 434 | if (is_array($all_postypes) && !in_array($geodir_post_type, $all_postypes)) |
| 435 | 435 | $geodir_post_type = ''; |
| 436 | 436 | |
| 437 | - if( defined( 'DOING_AJAX' ) && isset($_REQUEST['stype'])){
|
|
| 437 | + if (defined('DOING_AJAX') && isset($_REQUEST['stype'])) {
|
|
| 438 | 438 | $geodir_post_type = sanitize_text_field($_REQUEST['stype']); |
| 439 | 439 | } |
| 440 | 440 | |
@@ -444,7 +444,7 @@ discard block |
||
| 444 | 444 | * |
| 445 | 445 | * @since 1.6.9 |
| 446 | 446 | */ |
| 447 | - return apply_filters('geodir_get_current_posttype',$geodir_post_type);
|
|
| 447 | + return apply_filters('geodir_get_current_posttype', $geodir_post_type);
|
|
| 448 | 448 | } |
| 449 | 449 | |
| 450 | 450 | /** |
@@ -458,18 +458,18 @@ discard block |
||
| 458 | 458 | */ |
| 459 | 459 | function geodir_get_default_posttype() |
| 460 | 460 | {
|
| 461 | - $post_types = apply_filters( 'geodir_get_default_posttype', geodir_get_posttypes( 'object' ) ); |
|
| 461 | + $post_types = apply_filters('geodir_get_default_posttype', geodir_get_posttypes('object'));
|
|
| 462 | 462 | |
| 463 | 463 | $stype = false; |
| 464 | - foreach ( $post_types as $post_type => $info ) {
|
|
| 464 | + foreach ($post_types as $post_type => $info) {
|
|
| 465 | 465 | global $wpdb; |
| 466 | - $has_posts = $wpdb->get_row( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_type = %s AND post_status='publish' LIMIT 1", $post_type ) ); |
|
| 467 | - if ( $has_posts ) {
|
|
| 466 | + $has_posts = $wpdb->get_row($wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_type = %s AND post_status='publish' LIMIT 1", $post_type));
|
|
| 467 | + if ($has_posts) {
|
|
| 468 | 468 | $stype = $post_type; break; |
| 469 | 469 | } |
| 470 | 470 | } |
| 471 | 471 | |
| 472 | - if(!$stype){
|
|
| 472 | + if (!$stype) {
|
|
| 473 | 473 | $stype = 'gd_place'; |
| 474 | 474 | } |
| 475 | 475 | |
@@ -494,14 +494,14 @@ discard block |
||
| 494 | 494 | switch ($output): |
| 495 | 495 | case 'object': |
| 496 | 496 | case 'Object': |
| 497 | - $post_types = json_decode(json_encode($post_types), FALSE);//(object)$post_types; |
|
| 497 | + $post_types = json_decode(json_encode($post_types), FALSE); //(object)$post_types; |
|
| 498 | 498 | break; |
| 499 | 499 | case 'array': |
| 500 | 500 | case 'Array': |
| 501 | - $post_types = (array)$post_types; |
|
| 501 | + $post_types = (array) $post_types; |
|
| 502 | 502 | break; |
| 503 | 503 | case 'options': |
| 504 | - $post_types = (array)$post_types; |
|
| 504 | + $post_types = (array) $post_types; |
|
| 505 | 505 | |
| 506 | 506 | $options = array(); |
| 507 | 507 | if (!empty($post_types)) {
|
@@ -619,15 +619,15 @@ discard block |
||
| 619 | 619 | |
| 620 | 620 | $categories = get_terms($taxonomies); |
| 621 | 621 | |
| 622 | - $html .= '<option value="0">' . __('All', 'geodirectory') . '</option>';
|
|
| 622 | + $html .= '<option value="0">'.__('All', 'geodirectory').'</option>';
|
|
| 623 | 623 | |
| 624 | 624 | foreach ($categories as $category_obj) {
|
| 625 | 625 | $select_opt = ''; |
| 626 | 626 | if ($selected == $category_obj->term_id) {
|
| 627 | 627 | $select_opt = 'selected="selected"'; |
| 628 | 628 | } |
| 629 | - $html .= '<option ' . $select_opt . ' value="' . $category_obj->term_id . '">' |
|
| 630 | - . geodir_utf8_ucfirst($category_obj->name) . '</option>'; |
|
| 629 | + $html .= '<option '.$select_opt.' value="'.$category_obj->term_id.'">' |
|
| 630 | + . geodir_utf8_ucfirst($category_obj->name).'</option>'; |
|
| 631 | 631 | } |
| 632 | 632 | |
| 633 | 633 | if ($echo) |
@@ -695,7 +695,7 @@ discard block |
||
| 695 | 695 | } elseif (isset($wp_query->tax_query->queries)) {
|
| 696 | 696 | $tax_arr = $wp_query->tax_query->queries; |
| 697 | 697 | //if tax query has 'relation' set then it will break wp_list_pluck so we remove it |
| 698 | - if(isset( $tax_arr['relation'])){unset( $tax_arr['relation']);}
|
|
| 698 | + if (isset($tax_arr['relation'])) {unset($tax_arr['relation']); }
|
|
| 699 | 699 | $taxonomies = wp_list_pluck($tax_arr, 'taxonomy'); |
| 700 | 700 | } |
| 701 | 701 | |
@@ -749,7 +749,7 @@ discard block |
||
| 749 | 749 | |
| 750 | 750 | if ((!geodir_is_page('listing')) || (is_search() && $_REQUEST['search_taxonomy'] == '')) {
|
| 751 | 751 | if ($cat_parent == 0) {
|
| 752 | - $list_class = 'main_list gd-parent-cats-list gd-cats-display-' . $cat_display; |
|
| 752 | + $list_class = 'main_list gd-parent-cats-list gd-cats-display-'.$cat_display; |
|
| 753 | 753 | $main_list_class = 'class="main_list_selecter"'; |
| 754 | 754 | } else {
|
| 755 | 755 | //$display = 'display:none'; |
@@ -759,7 +759,7 @@ discard block |
||
| 759 | 759 | |
| 760 | 760 | if ($cat_display == 'checkbox' || $cat_display == 'radio') {
|
| 761 | 761 | $p = 0; |
| 762 | - $out = '<div class="' . $list_class . ' gd-cat-row-' . $cat_parent . '" style="margin-left:' . $p . 'px;' . $display . ';">'; |
|
| 762 | + $out = '<div class="'.$list_class.' gd-cat-row-'.$cat_parent.'" style="margin-left:'.$p.'px;'.$display.';">'; |
|
| 763 | 763 | } |
| 764 | 764 | |
| 765 | 765 | foreach ($cat_terms as $cat_term) {
|
@@ -774,12 +774,12 @@ discard block |
||
| 774 | 774 | } |
| 775 | 775 | |
| 776 | 776 | if ($cat_display == 'radio') |
| 777 | - $out .= '<span style="display:block" ><input type="radio" field_type="radio" name="post_category[' . $cat_term->taxonomy . '][]" ' . $main_list_class . ' alt="' . $cat_term->taxonomy . '" title="' . geodir_utf8_ucfirst($cat_term->name) . '" value="' . $cat_term->term_id . '" ' . $checked . $onchange . ' id="gd-cat-' . $cat_term->term_id . '" >' . $term_check . geodir_utf8_ucfirst($cat_term->name) . '</span>'; |
|
| 777 | + $out .= '<span style="display:block" ><input type="radio" field_type="radio" name="post_category['.$cat_term->taxonomy.'][]" '.$main_list_class.' alt="'.$cat_term->taxonomy.'" title="'.geodir_utf8_ucfirst($cat_term->name).'" value="'.$cat_term->term_id.'" '.$checked.$onchange.' id="gd-cat-'.$cat_term->term_id.'" >'.$term_check.geodir_utf8_ucfirst($cat_term->name).'</span>'; |
|
| 778 | 778 | elseif ($cat_display == 'select' || $cat_display == 'multiselect') |
| 779 | - $out .= '<option ' . $main_list_class . ' style="margin-left:' . $p . 'px;" alt="' . $cat_term->taxonomy . '" title="' . geodir_utf8_ucfirst($cat_term->name) . '" value="' . $cat_term->term_id . '" ' . $checked . $onchange . ' >' . $term_check . geodir_utf8_ucfirst($cat_term->name) . '</option>'; |
|
| 779 | + $out .= '<option '.$main_list_class.' style="margin-left:'.$p.'px;" alt="'.$cat_term->taxonomy.'" title="'.geodir_utf8_ucfirst($cat_term->name).'" value="'.$cat_term->term_id.'" '.$checked.$onchange.' >'.$term_check.geodir_utf8_ucfirst($cat_term->name).'</option>'; |
|
| 780 | 780 | |
| 781 | 781 | else {
|
| 782 | - $out .= '<span style="display:block"><input style="display:inline-block" type="checkbox" field_type="checkbox" name="post_category[' . $cat_term->taxonomy . '][]" ' . $main_list_class . ' alt="' . $cat_term->taxonomy . '" title="' . geodir_utf8_ucfirst($cat_term->name) . '" value="' . $cat_term->term_id . '" ' . $checked . $onchange . ' id="gd-cat-' . $cat_term->term_id . '" >' . $term_check . geodir_utf8_ucfirst($cat_term->name) . '</span>'; |
|
| 782 | + $out .= '<span style="display:block"><input style="display:inline-block" type="checkbox" field_type="checkbox" name="post_category['.$cat_term->taxonomy.'][]" '.$main_list_class.' alt="'.$cat_term->taxonomy.'" title="'.geodir_utf8_ucfirst($cat_term->name).'" value="'.$cat_term->term_id.'" '.$checked.$onchange.' id="gd-cat-'.$cat_term->term_id.'" >'.$term_check.geodir_utf8_ucfirst($cat_term->name).'</span>'; |
|
| 783 | 783 | } |
| 784 | 784 | |
| 785 | 785 | // Call recurson to print sub cats |
@@ -818,7 +818,7 @@ discard block |
||
| 818 | 818 | $cat_exclude = serialize($exclude_cats); |
| 819 | 819 | |
| 820 | 820 | if (isset($_REQUEST['backandedit'])) {
|
| 821 | - $post = (object)$gd_session->get('listing');
|
|
| 821 | + $post = (object) $gd_session->get('listing');
|
|
| 822 | 822 | |
| 823 | 823 | if (!is_array($post->post_category[$cat_taxonomy])) |
| 824 | 824 | $post_category = $post->post_category[$cat_taxonomy]; |
@@ -850,7 +850,7 @@ discard block |
||
| 850 | 850 | |
| 851 | 851 | if (!empty($post_category)) {
|
| 852 | 852 | $cat1 = array_filter(explode(',', $post_category));
|
| 853 | - $post_category = ',' . implode(',', $cat1) . ',';
|
|
| 853 | + $post_category = ','.implode(',', $cat1).',';
|
|
| 854 | 854 | |
| 855 | 855 | } |
| 856 | 856 | |
@@ -861,7 +861,7 @@ discard block |
||
| 861 | 861 | foreach ($post_category_upd as $cat) {
|
| 862 | 862 | |
| 863 | 863 | if (!in_array($cat, $exclude_cats) && $cat != '') {
|
| 864 | - $post_category_change .= ',' . $cat; |
|
| 864 | + $post_category_change .= ','.$cat; |
|
| 865 | 865 | } |
| 866 | 866 | } |
| 867 | 867 | $post_category = $post_category_change; |
@@ -873,11 +873,11 @@ discard block |
||
| 873 | 873 | } |
| 874 | 874 | } |
| 875 | 875 | |
| 876 | - echo '<input type="hidden" id="cat_limit" value="' . $cat_limit . '" name="cat_limit[' . $cat_taxonomy . ']" />'; |
|
| 876 | + echo '<input type="hidden" id="cat_limit" value="'.$cat_limit.'" name="cat_limit['.$cat_taxonomy.']" />'; |
|
| 877 | 877 | |
| 878 | - echo '<input type="hidden" id="post_category" value="' . $post_category . '" name="post_category[' . $cat_taxonomy . ']" />'; |
|
| 878 | + echo '<input type="hidden" id="post_category" value="'.$post_category.'" name="post_category['.$cat_taxonomy.']" />'; |
|
| 879 | 879 | |
| 880 | - echo '<input type="hidden" id="post_category_str" value="' . $post_category_str . '" name="post_category_str[' . $cat_taxonomy . ']" />'; |
|
| 880 | + echo '<input type="hidden" id="post_category_str" value="'.$post_category_str.'" name="post_category_str['.$cat_taxonomy.']" />'; |
|
| 881 | 881 | |
| 882 | 882 | |
| 883 | 883 | ?> |
@@ -896,14 +896,14 @@ discard block |
||
| 896 | 896 | |
| 897 | 897 | function show_subcatlist(main_cat, catObj) {
|
| 898 | 898 | if (main_cat != '') {
|
| 899 | - var url = '<?php echo geodir_get_ajax_url();?>'; |
|
| 900 | - var cat_taxonomy = '<?php echo $cat_taxonomy;?>'; |
|
| 901 | - var cat_exclude = '<?php echo base64_encode($cat_exclude);?>'; |
|
| 899 | + var url = '<?php echo geodir_get_ajax_url(); ?>'; |
|
| 900 | + var cat_taxonomy = '<?php echo $cat_taxonomy; ?>'; |
|
| 901 | + var cat_exclude = '<?php echo base64_encode($cat_exclude); ?>'; |
|
| 902 | 902 | var cat_limit = jQuery('#' + cat_taxonomy).find('#cat_limit').val();
|
| 903 | - <?php if ((int)$cat_limit > 0) { ?>
|
|
| 903 | + <?php if ((int) $cat_limit > 0) { ?>
|
|
| 904 | 904 | var selected = parseInt(jQuery('#' + cat_taxonomy).find('.cat_sublist > div.post_catlist_item').length);
|
| 905 | 905 | if (cat_limit != '' && selected > 0 && selected >= cat_limit && cat_limit != 0) {
|
| 906 | - alert("<?php echo esc_attr(wp_sprintf(__('You have reached category limit of %d categories.', 'geodirectory'), (int)$cat_limit));?>");
|
|
| 906 | + alert("<?php echo esc_attr(wp_sprintf(__('You have reached category limit of %d categories.', 'geodirectory'), (int) $cat_limit)); ?>");
|
|
| 907 | 907 | return false; |
| 908 | 908 | } |
| 909 | 909 | <?php } ?> |
@@ -942,7 +942,7 @@ discard block |
||
| 942 | 942 | } |
| 943 | 943 | |
| 944 | 944 | function update_listing_cat(el) {
|
| 945 | - var cat_taxonomy = '<?php echo $cat_taxonomy;?>'; |
|
| 945 | + var cat_taxonomy = '<?php echo $cat_taxonomy; ?>'; |
|
| 946 | 946 | var cat_ids = ''; |
| 947 | 947 | var main_cat = ''; |
| 948 | 948 | var sub_cat = ''; |
@@ -1023,7 +1023,7 @@ discard block |
||
| 1023 | 1023 | <div class="main_cat_list" style=" <?php if (isset($style)) {
|
| 1024 | 1024 | echo $style; |
| 1025 | 1025 | }?> "> |
| 1026 | - <?php geodir_get_catlist($cat_taxonomy, 0); // print main categories list |
|
| 1026 | + <?php geodir_get_catlist($cat_taxonomy, 0); // print main categories list |
|
| 1027 | 1027 | ?> |
| 1028 | 1028 | </div> |
| 1029 | 1029 | <?php |
@@ -1050,9 +1050,9 @@ discard block |
||
| 1050 | 1050 | if ($exclude != '') {
|
| 1051 | 1051 | $exclude_cats = maybe_unserialize(base64_decode($exclude)); |
| 1052 | 1052 | |
| 1053 | - if(is_array( $exclude_cats)){
|
|
| 1054 | - $exclude_cats = array_map( 'intval', $exclude_cats ); |
|
| 1055 | - }else{
|
|
| 1053 | + if (is_array($exclude_cats)) {
|
|
| 1054 | + $exclude_cats = array_map('intval', $exclude_cats);
|
|
| 1055 | + } else {
|
|
| 1056 | 1056 | $exclude_cats = intval($exclude_cats); |
| 1057 | 1057 | } |
| 1058 | 1058 | |
@@ -1066,25 +1066,25 @@ discard block |
||
| 1066 | 1066 | <?php $main_cat = get_term($parrent, $request_taxonomy); ?> |
| 1067 | 1067 | |
| 1068 | 1068 | <div class="post_catlist_item" style="border:1px solid #CCCCCC; margin:5px auto; padding:5px;"> |
| 1069 | - <img alt="move icon" src="<?php echo geodir_plugin_url() . '/geodirectory-assets/images/move.png';?>" |
|
| 1069 | + <img alt="move icon" src="<?php echo geodir_plugin_url().'/geodirectory-assets/images/move.png'; ?>" |
|
| 1070 | 1070 | onclick="jQuery(this).closest('div').remove();update_listing_cat(this);" align="right"/>
|
| 1071 | 1071 | <?php /* ?> |
| 1072 | 1072 | <img src="<?php echo geodir_plugin_url().'/geodirectory-assets/images/move.png';?>" onclick="jQuery(this).closest('div').remove();show_subcatlist();" align="right" />
|
| 1073 | 1073 | <?php */ ?> |
| 1074 | 1074 | |
| 1075 | - <input type="checkbox" value="<?php echo $main_cat->term_id;?>" class="listing_main_cat" |
|
| 1075 | + <input type="checkbox" value="<?php echo $main_cat->term_id; ?>" class="listing_main_cat" |
|
| 1076 | 1076 | onchange="if(jQuery(this).is(':checked')){jQuery(this).closest('div').find('.post_default_category').prop('checked',false).show();}else{jQuery(this).closest('div').find('.post_default_category').prop('checked',false).hide();};update_listing_cat()"
|
| 1077 | 1077 | checked="checked" disabled="disabled"/> |
| 1078 | 1078 | <span> |
| 1079 | - <?php printf(__('Add listing in %s category', 'geodirectory'), geodir_ucwords($main_cat->name));?>
|
|
| 1079 | + <?php printf(__('Add listing in %s category', 'geodirectory'), geodir_ucwords($main_cat->name)); ?>
|
|
| 1080 | 1080 | </span> |
| 1081 | 1081 | <br/> |
| 1082 | 1082 | |
| 1083 | 1083 | <div class="post_default_category"> |
| 1084 | - <input type="radio" name="post_default_category" value="<?php echo $main_cat->term_id;?>" |
|
| 1085 | - onchange="update_listing_cat()" <?php if ($default) echo ' checked="checked" ';?> /> |
|
| 1084 | + <input type="radio" name="post_default_category" value="<?php echo $main_cat->term_id; ?>" |
|
| 1085 | + onchange="update_listing_cat()" <?php if ($default) echo ' checked="checked" '; ?> /> |
|
| 1086 | 1086 | <span> |
| 1087 | - <?php printf(__('Set %s as default category', 'geodirectory'), geodir_ucwords($main_cat->name));?>
|
|
| 1087 | + <?php printf(__('Set %s as default category', 'geodirectory'), geodir_ucwords($main_cat->name)); ?>
|
|
| 1088 | 1088 | </span> |
| 1089 | 1089 | </div> |
| 1090 | 1090 | |
@@ -1117,7 +1117,7 @@ discard block |
||
| 1117 | 1117 | $post_cat_str = $post_categories[$request_taxonomy]; |
| 1118 | 1118 | $post_cat_array = explode("#", $post_cat_str);
|
| 1119 | 1119 | if (is_array($post_cat_array)) {
|
| 1120 | - $post_cat_array = array_unique( $post_cat_array ); |
|
| 1120 | + $post_cat_array = array_unique($post_cat_array); |
|
| 1121 | 1121 | |
| 1122 | 1122 | foreach ($post_cat_array as $post_cat_html) {
|
| 1123 | 1123 | |
@@ -1132,7 +1132,7 @@ discard block |
||
| 1132 | 1132 | } |
| 1133 | 1133 | $post_sub_catid = ''; |
| 1134 | 1134 | if (isset($post_cat_info[1]) && !empty($post_cat_info[1])) {
|
| 1135 | - $post_sub_catid = (int)$post_cat_info[1]; |
|
| 1135 | + $post_sub_catid = (int) $post_cat_info[1]; |
|
| 1136 | 1136 | } |
| 1137 | 1137 | |
| 1138 | 1138 | geodir_addpost_categories_html($request_taxonomy, $post_maincat_id, $post_sub_catid, $post_maincat_selected, $post_maincat_default); |
@@ -1153,7 +1153,7 @@ discard block |
||
| 1153 | 1153 | } |
| 1154 | 1154 | |
| 1155 | 1155 | if (isset($post_cat_info[1]) && !empty($post_cat_info[1])) {
|
| 1156 | - $post_sub_catid = (int)$post_cat_info[1]; |
|
| 1156 | + $post_sub_catid = (int) $post_cat_info[1]; |
|
| 1157 | 1157 | } |
| 1158 | 1158 | |
| 1159 | 1159 | geodir_addpost_categories_html($request_taxonomy, $post_maincat_id, $post_sub_catid, $post_maincat_selected, $post_maincat_default); |
@@ -1185,9 +1185,9 @@ discard block |
||
| 1185 | 1185 | if (!$selected) |
| 1186 | 1186 | $option_slected = ' selected="selected" '; |
| 1187 | 1187 | |
| 1188 | - echo '<select field_type="select" id="' . sanitize_text_field($cat_taxonomy) . '" class="chosen_select" ' . $onchange . ' option-ajaxChosen="false" >'; |
|
| 1188 | + echo '<select field_type="select" id="'.sanitize_text_field($cat_taxonomy).'" class="chosen_select" '.$onchange.' option-ajaxChosen="false" >'; |
|
| 1189 | 1189 | |
| 1190 | - echo '<option value="" ' . $option_selected . ' >' . __('Select Category', 'geodirectory') . '</option>';
|
|
| 1190 | + echo '<option value="" '.$option_selected.' >'.__('Select Category', 'geodirectory').'</option>';
|
|
| 1191 | 1191 | |
| 1192 | 1192 | foreach ($cat_terms as $cat_term) {
|
| 1193 | 1193 | $option_selected = ''; |
@@ -1195,10 +1195,10 @@ discard block |
||
| 1195 | 1195 | $option_selected = ' selected="selected" '; |
| 1196 | 1196 | |
| 1197 | 1197 | // Count child terms |
| 1198 | - $child_terms = get_terms( $cat_taxonomy, array( 'parent' => $cat_term->term_id, 'hide_empty' => false, 'exclude' => $exclude_cats, 'number' => 1 ) ); |
|
| 1199 | - $has_child = !empty( $child_terms ) ? 't' : 'f'; |
|
| 1198 | + $child_terms = get_terms($cat_taxonomy, array('parent' => $cat_term->term_id, 'hide_empty' => false, 'exclude' => $exclude_cats, 'number' => 1));
|
|
| 1199 | + $has_child = !empty($child_terms) ? 't' : 'f'; |
|
| 1200 | 1200 | |
| 1201 | - echo '<option ' . $option_selected . ' alt="' . $cat_term->taxonomy . '" title="' . geodir_utf8_ucfirst($cat_term->name) . '" value="' . $cat_term->term_id . '" _hc="' . $has_child . '" >' . geodir_utf8_ucfirst($cat_term->name) . '</option>'; |
|
| 1201 | + echo '<option '.$option_selected.' alt="'.$cat_term->taxonomy.'" title="'.geodir_utf8_ucfirst($cat_term->name).'" value="'.$cat_term->term_id.'" _hc="'.$has_child.'" >'.geodir_utf8_ucfirst($cat_term->name).'</option>'; |
|
| 1202 | 1202 | } |
| 1203 | 1203 | echo '</select>'; |
| 1204 | 1204 | } |
@@ -1229,7 +1229,7 @@ discard block |
||
| 1229 | 1229 | 2 => __('Custom field updated.', 'geodirectory'),
|
| 1230 | 1230 | 3 => __('Custom field deleted.', 'geodirectory'),
|
| 1231 | 1231 | 4 => sprintf(__('%s updated.', 'geodirectory'), $post_object->labels->singular_name),
|
| 1232 | - 5 => isset($_GET['revision']) ? sprintf(__('%s restored to revision from %s', 'geodirectory'), $post_object->labels->singular_name, wp_post_revision_title((int)$_GET['revision'], false)) : false,
|
|
| 1232 | + 5 => isset($_GET['revision']) ? sprintf(__('%s restored to revision from %s', 'geodirectory'), $post_object->labels->singular_name, wp_post_revision_title((int) $_GET['revision'], false)) : false,
|
|
| 1233 | 1233 | 6 => sprintf(__('%s published. <a href="%s">View %s</a>', 'geodirectory'), $post_object->labels->singular_name, esc_url(get_permalink($post_ID)), $post_object->labels->singular_name),
|
| 1234 | 1234 | 7 => sprintf(__('%s saved.', 'geodirectory'), $post_object->labels->singular_name),
|
| 1235 | 1235 | 8 => sprintf(__('%s submitted. <a target="_blank" href="%s">Preview %s</a>', 'geodirectory'), $post_object->labels->singular_name, esc_url(add_query_arg('preview', 'true', get_permalink($post_ID))), $post_object->labels->singular_name),
|
@@ -1255,7 +1255,7 @@ discard block |
||
| 1255 | 1255 | |
| 1256 | 1256 | global $wpdb; |
| 1257 | 1257 | |
| 1258 | - $menu_icon = geodir_plugin_url() . '/geodirectory-assets/images/favicon.ico'; |
|
| 1258 | + $menu_icon = geodir_plugin_url().'/geodirectory-assets/images/favicon.ico'; |
|
| 1259 | 1259 | |
| 1260 | 1260 | if (!$listing_slug = get_option('geodir_listing_prefix'))
|
| 1261 | 1261 | $listing_slug = 'places'; |
@@ -1268,11 +1268,11 @@ discard block |
||
| 1268 | 1268 | |
| 1269 | 1269 | $gd_placetags = array(); |
| 1270 | 1270 | $gd_placetags['object_type'] = 'gd_place'; |
| 1271 | - $gd_placetags['listing_slug'] = $listing_slug . '/tags'; |
|
| 1271 | + $gd_placetags['listing_slug'] = $listing_slug.'/tags'; |
|
| 1272 | 1272 | $gd_placetags['args'] = array( |
| 1273 | 1273 | 'public' => true, |
| 1274 | 1274 | 'hierarchical' => false, |
| 1275 | - 'rewrite' => array('slug' => $listing_slug . '/tags', 'with_front' => false, 'hierarchical' => true),
|
|
| 1275 | + 'rewrite' => array('slug' => $listing_slug.'/tags', 'with_front' => false, 'hierarchical' => true),
|
|
| 1276 | 1276 | 'query_var' => true, |
| 1277 | 1277 | |
| 1278 | 1278 | 'labels' => array( |
@@ -1366,7 +1366,7 @@ discard block |
||
| 1366 | 1366 | 'menu_icon' => $menu_icon, |
| 1367 | 1367 | 'public' => true, |
| 1368 | 1368 | 'query_var' => true, |
| 1369 | - 'rewrite' => array('slug' => $listing_slug , 'with_front' => false, 'hierarchical' => true, 'feeds' => true),
|
|
| 1369 | + 'rewrite' => array('slug' => $listing_slug, 'with_front' => false, 'hierarchical' => true, 'feeds' => true),
|
|
| 1370 | 1370 | 'supports' => array('title', 'editor', 'author', 'thumbnail', 'excerpt', 'custom-fields', 'comments', /*'revisions', 'post-formats'*/),
|
| 1371 | 1371 | 'taxonomies' => array('gd_placecategory', 'gd_place_tags'));
|
| 1372 | 1372 | |
@@ -1399,12 +1399,12 @@ discard block |
||
| 1399 | 1399 | return $_REQUEST['lang']; |
| 1400 | 1400 | } |
| 1401 | 1401 | |
| 1402 | - $url = str_replace(array("http://","https://"),"",$url);
|
|
| 1402 | + $url = str_replace(array("http://", "https://"), "", $url);
|
|
| 1403 | 1403 | |
| 1404 | 1404 | // site_url() seems to work better than get_bloginfo('url') here, WPML can change get_bloginfo('url') to add the lang.
|
| 1405 | - $site_url = str_replace(array("http://","https://"),"",site_url());
|
|
| 1405 | + $site_url = str_replace(array("http://", "https://"), "", site_url());
|
|
| 1406 | 1406 | |
| 1407 | - $url = str_replace($site_url,"",$url); |
|
| 1407 | + $url = str_replace($site_url, "", $url); |
|
| 1408 | 1408 | |
| 1409 | 1409 | $segments = explode('/', trim($url, '/'));
|
| 1410 | 1410 | |
@@ -1470,9 +1470,9 @@ discard block |
||
| 1470 | 1470 | if (in_array($post->post_type, geodir_get_posttypes())) {
|
| 1471 | 1471 | |
| 1472 | 1472 | // if we dont have a GD post then try to grab it |
| 1473 | - if(!isset($post->default_category)){
|
|
| 1473 | + if (!isset($post->default_category)) {
|
|
| 1474 | 1474 | $gd_post = geodir_get_post_info($post->ID); |
| 1475 | - if(!empty($gd_post)){
|
|
| 1475 | + if (!empty($gd_post)) {
|
|
| 1476 | 1476 | $post = $gd_post; |
| 1477 | 1477 | } |
| 1478 | 1478 | } |
@@ -1482,17 +1482,17 @@ discard block |
||
| 1482 | 1482 | $slug = $post_types[$post->post_type]['rewrite']['slug']; |
| 1483 | 1483 | |
| 1484 | 1484 | // Alter the CPT slug if WPML is set to do so |
| 1485 | - if(function_exists('icl_object_id')){
|
|
| 1486 | - if ( gd_wpml_slug_translation_turned_on( $post->post_type ) && $language_code = gd_wpml_get_lang_from_url($post_link)) {
|
|
| 1485 | + if (function_exists('icl_object_id')) {
|
|
| 1486 | + if (gd_wpml_slug_translation_turned_on($post->post_type) && $language_code = gd_wpml_get_lang_from_url($post_link)) {
|
|
| 1487 | 1487 | |
| 1488 | 1488 | $org_slug = $slug; |
| 1489 | - $slug = apply_filters( 'wpml_translate_single_string', |
|
| 1489 | + $slug = apply_filters('wpml_translate_single_string',
|
|
| 1490 | 1490 | $slug, |
| 1491 | 1491 | 'WordPress', |
| 1492 | - 'URL slug: ' . $slug, |
|
| 1492 | + 'URL slug: '.$slug, |
|
| 1493 | 1493 | $language_code); |
| 1494 | 1494 | |
| 1495 | - if(!$slug){$slug = $org_slug;}
|
|
| 1495 | + if (!$slug) {$slug = $org_slug; }
|
|
| 1496 | 1496 | |
| 1497 | 1497 | } |
| 1498 | 1498 | } |
@@ -1514,11 +1514,11 @@ discard block |
||
| 1514 | 1514 | } |
| 1515 | 1515 | |
| 1516 | 1516 | $post_link = trailingslashit( |
| 1517 | - preg_replace( "/" . preg_quote( $slug, "/" ) . "/", $slug ."/%gd_taxonomy%",$post_link, 1 ) |
|
| 1517 | + preg_replace("/".preg_quote($slug, "/")."/", $slug."/%gd_taxonomy%", $post_link, 1)
|
|
| 1518 | 1518 | ); |
| 1519 | 1519 | |
| 1520 | 1520 | if ($fix_url) {
|
| 1521 | - $post_link = $site_url . $post_link; |
|
| 1521 | + $post_link = $site_url.$post_link; |
|
| 1522 | 1522 | } |
| 1523 | 1523 | |
| 1524 | 1524 | if (isset($comment_post_cache[$post->ID])) {
|
@@ -1537,12 +1537,12 @@ discard block |
||
| 1537 | 1537 | $ID = $post->ID; |
| 1538 | 1538 | $post2 = $wpdb->get_row( |
| 1539 | 1539 | $wpdb->prepare( |
| 1540 | - "SELECT * from " . $plugin_prefix . $post->post_type . "_detail WHERE post_id = %d ", |
|
| 1540 | + "SELECT * from ".$plugin_prefix.$post->post_type."_detail WHERE post_id = %d ", |
|
| 1541 | 1541 | array($post->ID) |
| 1542 | 1542 | ) |
| 1543 | 1543 | ); |
| 1544 | 1544 | |
| 1545 | - $post = (object)array_merge((array)$post, (array)$post2); |
|
| 1545 | + $post = (object) array_merge((array) $post, (array) $post2); |
|
| 1546 | 1546 | |
| 1547 | 1547 | $comment_post_cache[$post->ID] = $post; |
| 1548 | 1548 | } |
@@ -1551,7 +1551,7 @@ discard block |
||
| 1551 | 1551 | |
| 1552 | 1552 | if (false !== strpos($post_link, '%gd_taxonomy%')) {
|
| 1553 | 1553 | |
| 1554 | - if ( apply_filters("geodir_add_location_url_to_url",get_option('geodir_add_location_url'),$post->post_type,$post)) {
|
|
| 1554 | + if (apply_filters("geodir_add_location_url_to_url", get_option('geodir_add_location_url'), $post->post_type, $post)) {
|
|
| 1555 | 1555 | $location_request = ''; |
| 1556 | 1556 | |
| 1557 | 1557 | |
@@ -1565,7 +1565,7 @@ discard block |
||
| 1565 | 1565 | $post->country_slug = str_replace('[', '', $geodir_arr_locations[2]);
|
| 1566 | 1566 | $post->country_slug = str_replace(']', '', $post->country_slug);
|
| 1567 | 1567 | |
| 1568 | - $post_location = (object)array('country_slug' => $post->country_slug,
|
|
| 1568 | + $post_location = (object) array('country_slug' => $post->country_slug,
|
|
| 1569 | 1569 | 'region_slug' => $post->region_slug, |
| 1570 | 1570 | 'city_slug' => $post->city_slug |
| 1571 | 1571 | ); |
@@ -1578,7 +1578,7 @@ discard block |
||
| 1578 | 1578 | |
| 1579 | 1579 | $post_location_sql = $wpdb->get_results( |
| 1580 | 1580 | $wpdb->prepare( |
| 1581 | - "SELECT post_locations from " . $plugin_prefix . $post->post_type . "_detail WHERE post_id = %d ", |
|
| 1581 | + "SELECT post_locations from ".$plugin_prefix.$post->post_type."_detail WHERE post_id = %d ", |
|
| 1582 | 1582 | array($post->ID) |
| 1583 | 1583 | ) |
| 1584 | 1584 | ); |
@@ -1594,7 +1594,7 @@ discard block |
||
| 1594 | 1594 | $post->country_slug = str_replace('[', '', $geodir_arr_locations[2]);
|
| 1595 | 1595 | $post->country_slug = str_replace(']', '', $post->country_slug);
|
| 1596 | 1596 | |
| 1597 | - $post_location = (object)array('country_slug' => $post->country_slug,
|
|
| 1597 | + $post_location = (object) array('country_slug' => $post->country_slug,
|
|
| 1598 | 1598 | 'region_slug' => $post->region_slug, |
| 1599 | 1599 | 'city_slug' => $post->city_slug |
| 1600 | 1600 | ); |
@@ -1623,7 +1623,7 @@ discard block |
||
| 1623 | 1623 | } |
| 1624 | 1624 | $location_slug[] = $city_slug; |
| 1625 | 1625 | |
| 1626 | - $location_request .= implode('/', $location_slug) . '/';
|
|
| 1626 | + $location_request .= implode('/', $location_slug).'/';
|
|
| 1627 | 1627 | } |
| 1628 | 1628 | } |
| 1629 | 1629 | |
@@ -1639,9 +1639,9 @@ discard block |
||
| 1639 | 1639 | } else {
|
| 1640 | 1640 | $post_terms = ''; |
| 1641 | 1641 | |
| 1642 | - if(isset($_POST['post_default_category']) && $_POST['post_default_category']){
|
|
| 1642 | + if (isset($_POST['post_default_category']) && $_POST['post_default_category']) {
|
|
| 1643 | 1643 | $post_terms = absint($_POST['post_default_category']); |
| 1644 | - }elseif(isset($_POST['post_category'][$taxonomies]) && $_POST['post_category'][$taxonomies]) {
|
|
| 1644 | + }elseif (isset($_POST['post_category'][$taxonomies]) && $_POST['post_category'][$taxonomies]) {
|
|
| 1645 | 1645 | $post_terms = is_array($_POST['post_category'][$taxonomies]) ? $_POST['post_category'][$taxonomies] : explode(",", trim($_POST['post_category'][$taxonomies], ","));
|
| 1646 | 1646 | $post_terms = !empty($post_terms) ? absint($post_terms[0]) : 0; |
| 1647 | 1647 | }elseif (isset($post->{$taxonomies})) {
|
@@ -1687,14 +1687,14 @@ discard block |
||
| 1687 | 1687 | $request_term = trim($request_term, '/'); |
| 1688 | 1688 | |
| 1689 | 1689 | // Fix with WPML the location terms added twice when CPT slug is translated. |
| 1690 | - if ($sample && !empty($location_request) && geodir_is_wpml() && strpos($post_link, '%gd_taxonomy%/' . $request_term . $detailurl_separator) !== false) {
|
|
| 1690 | + if ($sample && !empty($location_request) && geodir_is_wpml() && strpos($post_link, '%gd_taxonomy%/'.$request_term.$detailurl_separator) !== false) {
|
|
| 1691 | 1691 | $post_link = str_replace('%gd_taxonomy%/', '', $post_link);
|
| 1692 | 1692 | } |
| 1693 | 1693 | |
| 1694 | 1694 | if (!empty($request_term)) |
| 1695 | - $post_link = str_replace('%gd_taxonomy%', $request_term . $detailurl_separator, $post_link);
|
|
| 1695 | + $post_link = str_replace('%gd_taxonomy%', $request_term.$detailurl_separator, $post_link);
|
|
| 1696 | 1696 | else |
| 1697 | - $post_link = str_replace('/%gd_taxonomy%', $request_term . $detailurl_separator, $post_link);
|
|
| 1697 | + $post_link = str_replace('/%gd_taxonomy%', $request_term.$detailurl_separator, $post_link);
|
|
| 1698 | 1698 | //echo $post_link ; |
| 1699 | 1699 | } |
| 1700 | 1700 | // temp cache the permalink |
@@ -1769,9 +1769,9 @@ discard block |
||
| 1769 | 1769 | $url_separator = ''; |
| 1770 | 1770 | |
| 1771 | 1771 | if (get_option('permalink_structure') != '') {
|
| 1772 | - $old_listing_slug = '/' . $listing_slug . '/'; |
|
| 1772 | + $old_listing_slug = '/'.$listing_slug.'/'; |
|
| 1773 | 1773 | $request_term = implode("/", $location_terms);
|
| 1774 | - $new_listing_slug = '/' . $listing_slug . '/' . $request_term . '/'; |
|
| 1774 | + $new_listing_slug = '/'.$listing_slug.'/'.$request_term.'/'; |
|
| 1775 | 1775 | |
| 1776 | 1776 | $termlink = substr_replace($termlink, $new_listing_slug, strpos($termlink, $old_listing_slug), strlen($old_listing_slug)); |
| 1777 | 1777 | } else {
|
@@ -1791,25 +1791,25 @@ discard block |
||
| 1791 | 1791 | // Alter the CPT slug if WPML is set to do so |
| 1792 | 1792 | if (function_exists('icl_object_id')) {
|
| 1793 | 1793 | $post_types = get_option('geodir_post_types');
|
| 1794 | - $post_type = str_replace("category","",$taxonomy);
|
|
| 1795 | - $post_type = str_replace("_tags","",$post_type);
|
|
| 1794 | + $post_type = str_replace("category", "", $taxonomy);
|
|
| 1795 | + $post_type = str_replace("_tags", "", $post_type);
|
|
| 1796 | 1796 | $slug = $post_types[$post_type]['rewrite']['slug']; |
| 1797 | 1797 | if (gd_wpml_slug_translation_turned_on($post_type)) {
|
| 1798 | 1798 | global $sitepress; |
| 1799 | 1799 | $default_lang = $sitepress->get_default_language(); |
| 1800 | 1800 | $language_code = gd_wpml_get_lang_from_url($termlink); |
| 1801 | - if (!$language_code ) {
|
|
| 1802 | - $language_code = $default_lang; |
|
| 1801 | + if (!$language_code) {
|
|
| 1802 | + $language_code = $default_lang; |
|
| 1803 | 1803 | } |
| 1804 | 1804 | |
| 1805 | 1805 | $org_slug = $slug; |
| 1806 | - $slug = apply_filters('wpml_translate_single_string', $slug, 'WordPress', 'URL slug: ' . $slug, $language_code);
|
|
| 1806 | + $slug = apply_filters('wpml_translate_single_string', $slug, 'WordPress', 'URL slug: '.$slug, $language_code);
|
|
| 1807 | 1807 | |
| 1808 | 1808 | if (!$slug) {
|
| 1809 | 1809 | $slug = $org_slug; |
| 1810 | 1810 | } |
| 1811 | 1811 | |
| 1812 | - $termlink = trailingslashit(preg_replace("/" . preg_quote($org_slug, "/") . "/", $slug ,$termlink, 1));
|
|
| 1812 | + $termlink = trailingslashit(preg_replace("/".preg_quote($org_slug, "/")."/", $slug, $termlink, 1));
|
|
| 1813 | 1813 | } |
| 1814 | 1814 | } |
| 1815 | 1815 | } |
@@ -1839,7 +1839,7 @@ discard block |
||
| 1839 | 1839 | |
| 1840 | 1840 | if (in_array($post_type, geodir_get_posttypes())) {
|
| 1841 | 1841 | if (get_option('geodir_add_location_url') && $gd_session->get('gd_multi_location') == 1) {
|
| 1842 | - if(geodir_is_page('detail') && !empty($post) && isset($post->country_slug)) {
|
|
| 1842 | + if (geodir_is_page('detail') && !empty($post) && isset($post->country_slug)) {
|
|
| 1843 | 1843 | $location_terms = array( |
| 1844 | 1844 | 'gd_country' => $post->country_slug, |
| 1845 | 1845 | 'gd_region' => $post->region_slug, |
@@ -1856,7 +1856,7 @@ discard block |
||
| 1856 | 1856 | $location_terms = implode("/", $location_terms);
|
| 1857 | 1857 | $location_terms = rtrim($location_terms, '/'); |
| 1858 | 1858 | |
| 1859 | - $link .= urldecode($location_terms) . '/'; |
|
| 1859 | + $link .= urldecode($location_terms).'/'; |
|
| 1860 | 1860 | } else {
|
| 1861 | 1861 | $link = geodir_getlink($link, $location_terms); |
| 1862 | 1862 | } |
@@ -1944,9 +1944,9 @@ discard block |
||
| 1944 | 1944 | return 0; |
| 1945 | 1945 | $where = 't.term_id = %d'; |
| 1946 | 1946 | if (!empty($taxonomy)) |
| 1947 | - return $wpdb->get_row($wpdb->prepare($tax_select . $where . " AND tt.taxonomy = %s", $term, $taxonomy), ARRAY_A); |
|
| 1947 | + return $wpdb->get_row($wpdb->prepare($tax_select.$where." AND tt.taxonomy = %s", $term, $taxonomy), ARRAY_A); |
|
| 1948 | 1948 | else |
| 1949 | - return $wpdb->get_var($wpdb->prepare($select . $where, $term)); |
|
| 1949 | + return $wpdb->get_var($wpdb->prepare($select.$where, $term)); |
|
| 1950 | 1950 | } |
| 1951 | 1951 | |
| 1952 | 1952 | $term = trim(wp_unslash($term)); |
@@ -1958,7 +1958,7 @@ discard block |
||
| 1958 | 1958 | |
| 1959 | 1959 | $where_fields = array($slug); |
| 1960 | 1960 | if (!empty($taxonomy)) {
|
| 1961 | - $parent = (int)$parent; |
|
| 1961 | + $parent = (int) $parent; |
|
| 1962 | 1962 | if ($parent > 0) {
|
| 1963 | 1963 | $where_fields[] = $parent; |
| 1964 | 1964 | $else_where_fields[] = $parent; |
@@ -2022,13 +2022,13 @@ discard block |
||
| 2022 | 2022 | $post_types = geodir_get_posttypes(); |
| 2023 | 2023 | $tax_arr = array(); |
| 2024 | 2024 | foreach ($post_types as $post_type) {
|
| 2025 | - $tax_arr[] = "'" . $post_type . "category'"; |
|
| 2025 | + $tax_arr[] = "'".$post_type."category'"; |
|
| 2026 | 2026 | } |
| 2027 | 2027 | $tax_c = implode(',', $tax_arr);
|
| 2028 | 2028 | $terms = $wpdb->get_results("SELECT * FROM $wpdb->term_taxonomy WHERE taxonomy IN ($tax_c)");
|
| 2029 | 2029 | //$terms = get_terms( $taxonomy ); |
| 2030 | 2030 | |
| 2031 | - if($terms) {
|
|
| 2031 | + if ($terms) {
|
|
| 2032 | 2032 | foreach ($terms as $term) {
|
| 2033 | 2033 | $post_type = str_replace("category", "", $term->taxonomy);
|
| 2034 | 2034 | $a_terms[$post_type][] = $term; |
@@ -2036,7 +2036,7 @@ discard block |
||
| 2036 | 2036 | } |
| 2037 | 2037 | } |
| 2038 | 2038 | |
| 2039 | - if($a_terms) {
|
|
| 2039 | + if ($a_terms) {
|
|
| 2040 | 2040 | foreach ($a_terms as $pt => $t2) {
|
| 2041 | 2041 | |
| 2042 | 2042 | foreach ($t2 as $term) {
|
@@ -2061,7 +2061,7 @@ discard block |
||
| 2061 | 2061 | } |
| 2062 | 2062 | |
| 2063 | 2063 | if (is_ssl()) {
|
| 2064 | - $terms_icons = str_replace("http:","https:",$terms_icons );
|
|
| 2064 | + $terms_icons = str_replace("http:", "https:", $terms_icons);
|
|
| 2065 | 2065 | } |
| 2066 | 2066 | |
| 2067 | 2067 | return apply_filters('geodir_get_term_icons', $terms_icons, $term_id);
|