@@ -474,15 +474,15 @@ discard block |
||
| 474 | 474 | <?php |
| 475 | 475 | |
| 476 | 476 | $default_location = geodir_get_default_location(); |
| 477 | - $city = isset($default_location->city) ? $default_location->city : ''; |
|
| 478 | - $region =isset($default_location->region) ? $default_location->region : ''; |
|
| 479 | - $country =isset($default_location->country) ? $default_location->country : ''; |
|
| 480 | - $city_latitude =isset($default_location->city_latitude) ? $default_location->city_latitude : ''; |
|
| 481 | - $city_longitude =isset($default_location->city_longitude) ? $default_location->city_longitude : ''; |
|
| 477 | + $city = isset($default_location->city) ? $default_location->city : ''; |
|
| 478 | + $region = isset($default_location->region) ? $default_location->region : ''; |
|
| 479 | + $country = isset($default_location->country) ? $default_location->country : ''; |
|
| 480 | + $city_latitude = isset($default_location->city_latitude) ? $default_location->city_latitude : ''; |
|
| 481 | + $city_longitude = isset($default_location->city_longitude) ? $default_location->city_longitude : ''; |
|
| 482 | 482 | |
| 483 | 483 | ?> |
| 484 | 484 | var geocoder = new google.maps.Geocoder(); |
| 485 | - var CITY_ADDRESS = '<?php echo $city.','.$region.','.$country;?>'; |
|
| 485 | + var CITY_ADDRESS = '<?php echo $city . ',' . $region . ',' . $country; ?>'; |
|
| 486 | 486 | var bound_lat_lng; |
| 487 | 487 | var lat = <?php echo $city_latitude; ?>; |
| 488 | 488 | var lng = <?php echo $city_longitude; ?>; |
@@ -519,7 +519,7 @@ discard block |
||
| 519 | 519 | ); |
| 520 | 520 | |
| 521 | 521 | } else {
|
| 522 | - alert("<?php _e('Geocode was not successful for the following reason:','geodirectory');?> " + status);
|
|
| 522 | + alert("<?php _e('Geocode was not successful for the following reason:', 'geodirectory'); ?> " + status);
|
|
| 523 | 523 | } |
| 524 | 524 | }); |
| 525 | 525 | |
@@ -532,7 +532,7 @@ discard block |
||
| 532 | 532 | var total_dummy_post_count = jQuery('#sub_' + active_tab).find('.selected_sample_data').val();
|
| 533 | 533 | |
| 534 | 534 | if (id == 'geodir_dummy_delete') {
|
| 535 | - if (confirm('<?php _e('Are you sure you want to delete dummy data?' , 'geodirectory'); ?>')) {
|
|
| 535 | + if (confirm('<?php _e('Are you sure you want to delete dummy data?', 'geodirectory'); ?>')) {
|
|
| 536 | 536 | jQuery('#sub_' + active_tab).find('.geodir_auto_install').hide();
|
| 537 | 537 | jQuery('#sub_' + active_tab).find('.geodir_show_progress').show();
|
| 538 | 538 | jQuery.post('<?php echo geodir_get_ajax_url(); ?>&geodir_autofill=' + id + '&posttype=' + posttype + '&_wpnonce=' + nonce,
|
@@ -551,7 +551,7 @@ discard block |
||
| 551 | 551 | jQuery.post('<?php echo geodir_get_ajax_url(); ?>&geodir_autofill=' + id + '&posttype=' + posttype + '&insert_dummy_post_index=' + dummy_post_index + '&city_bound_lat1=' + bound_lat_lng[0] + '&city_bound_lng1=' + bound_lat_lng[1] + '&city_bound_lat2=' + bound_lat_lng[2] + '&city_bound_lng2=' + bound_lat_lng[3] + '&_wpnonce=' + nonce,
|
| 552 | 552 | function (data) {
|
| 553 | 553 | |
| 554 | - jQuery(obj).closest('form').find('.dummy_post_inserted').html('<?php _e('Dummy post(s) inserted:','geodirectory');?> ' + dummy_post_index + ' <?php _e('of' ,'geodirectory'); ?> ' + total_dummy_post_count + '');
|
|
| 554 | + jQuery(obj).closest('form').find('.dummy_post_inserted').html('<?php _e('Dummy post(s) inserted:', 'geodirectory'); ?> ' + dummy_post_index + ' <?php _e('of', 'geodirectory'); ?> ' + total_dummy_post_count + '');
|
|
| 555 | 555 | dummy_post_index++; |
| 556 | 556 | if (dummy_post_index <= total_dummy_post_count) |
| 557 | 557 | geodir_autoinstall(obj, id, nonce, posttype); |
@@ -662,7 +662,7 @@ discard block |
||
| 662 | 662 | else |
| 663 | 663 | $dummy_image_url = 'http://www.wpgeodirectory.com/dummy/cat_icon'; |
| 664 | 664 | $catname = str_replace(' ', '_', $catname);
|
| 665 | - $uploaded = (array)fetch_remote_file("$dummy_image_url/" . $catname . ".png");
|
|
| 665 | + $uploaded = (array) fetch_remote_file("$dummy_image_url/" . $catname . ".png");
|
|
| 666 | 666 | |
| 667 | 667 | if (empty($uploaded['error'])) {
|
| 668 | 668 | $new_path = $uploaded['file']; |
@@ -703,7 +703,7 @@ discard block |
||
| 703 | 703 | else |
| 704 | 704 | $dummy_image_url = 'http://www.wpgeodirectory.com/dummy/cat_icon'; |
| 705 | 705 | $catname = str_replace(' ', '_', $catname);
|
| 706 | - $uploaded = (array)fetch_remote_file("$dummy_image_url/" . $catname . ".png");
|
|
| 706 | + $uploaded = (array) fetch_remote_file("$dummy_image_url/" . $catname . ".png");
|
|
| 707 | 707 | |
| 708 | 708 | if (empty($uploaded['error'])) {
|
| 709 | 709 | $new_path = $uploaded['file']; |
@@ -1015,7 +1015,7 @@ discard block |
||
| 1015 | 1015 | */ |
| 1016 | 1016 | function geodir_extend_geodirectory_setting_tab($tabs) |
| 1017 | 1017 | {
|
| 1018 | - $tabs['extend_geodirectory_settings'] = array('label' => __('Extend Geodirectory', 'geodirectory'). ' <i class="fa fa-plug"></i>', 'url' => 'http://wpgeodirectory.com', 'target' => '_blank');
|
|
| 1018 | + $tabs['extend_geodirectory_settings'] = array('label' => __('Extend Geodirectory', 'geodirectory') . ' <i class="fa fa-plug"></i>', 'url' => 'http://wpgeodirectory.com', 'target' => '_blank');
|
|
| 1019 | 1019 | return $tabs; |
| 1020 | 1020 | } |
| 1021 | 1021 | |
@@ -1168,7 +1168,7 @@ discard block |
||
| 1168 | 1168 | function geodir_post_information_save($post_id, $post) {
|
| 1169 | 1169 | global $wpdb, $current_user; |
| 1170 | 1170 | |
| 1171 | - if (isset($post->post_type) && ($post->post_type=='nav_menu_item' || $post->post_type=='page' || $post->post_type=='post')) {
|
|
| 1171 | + if (isset($post->post_type) && ($post->post_type == 'nav_menu_item' || $post->post_type == 'page' || $post->post_type == 'post')) {
|
|
| 1172 | 1172 | return; |
| 1173 | 1173 | } |
| 1174 | 1174 | |
@@ -1512,7 +1512,7 @@ discard block |
||
| 1512 | 1512 | jQuery('#gd-import-perc').text('0%');
|
| 1513 | 1513 | |
| 1514 | 1514 | jQuery('.gd-csv-form-table .filelist .file').remove();
|
| 1515 | - jQuery('#gd-import-msg').find('#message').removeClass('updated').addClass('error').html("<p><?php echo esc_attr( PLZ_SELECT_CSV_FILE );?></p>");
|
|
| 1515 | + jQuery('#gd-import-msg').find('#message').removeClass('updated').addClass('error').html("<p><?php echo esc_attr(PLZ_SELECT_CSV_FILE); ?></p>");
|
|
| 1516 | 1516 | jQuery('#gd-import-msg').show();
|
| 1517 | 1517 | |
| 1518 | 1518 | return false; |
@@ -1680,38 +1680,38 @@ discard block |
||
| 1680 | 1680 | |
| 1681 | 1681 | var gdMsg = '<p></p>'; |
| 1682 | 1682 | if (gd_invalidcount == 0 && gd_blank_address == 0 && gd_invalid_post_type == 0 && gd_invalid_title == 0) {
|
| 1683 | - gdMsg += "<p><?php echo esc_attr( CSV_INSERT_DATA );?></p>"; |
|
| 1683 | + gdMsg += "<p><?php echo esc_attr(CSV_INSERT_DATA); ?></p>"; |
|
| 1684 | 1684 | } |
| 1685 | 1685 | |
| 1686 | - var msgParse = '<p><?php echo addslashes( CSV_TOTAL_RECORD );?></p>'; |
|
| 1686 | + var msgParse = '<p><?php echo addslashes(CSV_TOTAL_RECORD); ?></p>'; |
|
| 1687 | 1687 | gdMsg += msgParse.replace("%s", gd_rowcount);
|
| 1688 | 1688 | |
| 1689 | 1689 | if (gd_invalidcount > 0) {
|
| 1690 | - msgParse = msgParse = '<p><?php echo sprintf( CSV_INVALID_DEFUALT_ADDRESS, '%s', '%d' );?></p>'; |
|
| 1690 | + msgParse = msgParse = '<p><?php echo sprintf(CSV_INVALID_DEFUALT_ADDRESS, '%s', '%d'); ?></p>'; |
|
| 1691 | 1691 | msgParse = msgParse.replace("%s", gd_invalidcount);
|
| 1692 | 1692 | msgParse = msgParse.replace("%d", gd_total_records);
|
| 1693 | 1693 | gdMsg += msgParse; |
| 1694 | 1694 | } |
| 1695 | 1695 | if (gd_blank_address > 0) {
|
| 1696 | - msgParse = '<p><?php echo addslashes( sprintf( CSV_INVALID_TOTAL_RECORD, '%s', '%d' ) );?></p>'; |
|
| 1696 | + msgParse = '<p><?php echo addslashes(sprintf(CSV_INVALID_TOTAL_RECORD, '%s', '%d')); ?></p>'; |
|
| 1697 | 1697 | msgParse = msgParse.replace("%s", gd_blank_address);
|
| 1698 | 1698 | msgParse = msgParse.replace("%d", gd_total_records);
|
| 1699 | 1699 | gdMsg += msgParse; |
| 1700 | 1700 | } |
| 1701 | 1701 | if (gd_invalid_post_type > 0) {
|
| 1702 | - msgParse = '<p><?php echo addslashes( sprintf( CSV_INVALID_POST_TYPE, '%s', '%d' ) );?></p>'; |
|
| 1702 | + msgParse = '<p><?php echo addslashes(sprintf(CSV_INVALID_POST_TYPE, '%s', '%d')); ?></p>'; |
|
| 1703 | 1703 | msgParse = msgParse.replace("%s", gd_invalid_post_type);
|
| 1704 | 1704 | msgParse = msgParse.replace("%d", gd_total_records);
|
| 1705 | 1705 | gdMsg += msgParse; |
| 1706 | 1706 | } |
| 1707 | 1707 | if (gd_invalid_title > 0) {
|
| 1708 | - msgParse = '<p><?php echo addslashes( sprintf( CSV_BLANK_POST_TITLE, '%s', '%d' ) );?></p>'; |
|
| 1708 | + msgParse = '<p><?php echo addslashes(sprintf(CSV_BLANK_POST_TITLE, '%s', '%d')); ?></p>'; |
|
| 1709 | 1709 | msgParse = msgParse.replace("%s", gd_invalid_title);
|
| 1710 | 1710 | msgParse = msgParse.replace("%d", gd_total_records);
|
| 1711 | 1711 | gdMsg += msgParse; |
| 1712 | 1712 | } |
| 1713 | 1713 | if (gd_upload_files > 0) {
|
| 1714 | - gdMsg += '<p><?php echo addslashes( sprintf( CSV_TRANSFER_IMG_FOLDER, $uploads['subdir'] ) );?></p>'; |
|
| 1714 | + gdMsg += '<p><?php echo addslashes(sprintf(CSV_TRANSFER_IMG_FOLDER, $uploads['subdir'])); ?></p>'; |
|
| 1715 | 1715 | } |
| 1716 | 1716 | gdMsg += '<p></p>'; |
| 1717 | 1717 | jQuery('#gd-import-msg').find('#message').removeClass('error').addClass('updated').html(gdMsg);
|
@@ -1721,7 +1721,7 @@ discard block |
||
| 1721 | 1721 | <table class="form-table gd-csv-form-table"> |
| 1722 | 1722 | <tbody> |
| 1723 | 1723 | <tr valign="top" class="single_select_page"> |
| 1724 | - <th class="titledesc" scope="row"><?php echo SELECT_CSV_FILE;?></th> |
|
| 1724 | + <th class="titledesc" scope="row"><?php echo SELECT_CSV_FILE; ?></th> |
|
| 1725 | 1725 | <td class="forminp"> |
| 1726 | 1726 | <div class="gtd-formfeild"> |
| 1727 | 1727 | <div class="gtd-form_row clearfix" id="<?php echo $id; ?>dropbox"> |
@@ -1756,12 +1756,12 @@ discard block |
||
| 1756 | 1756 | id="gd_import_data" class="button-primary" name="save"> |
| 1757 | 1757 | <input onclick="gdContinueImport()" type="button" value="Continue Import Data" |
| 1758 | 1758 | id="gd_continue_data" class="button-primary" style="display:none"/> |
| 1759 | - <input type="button" value="<?php _e("Terminate Import Data", 'geodirectory');?>"
|
|
| 1759 | + <input type="button" value="<?php _e("Terminate Import Data", 'geodirectory'); ?>"
|
|
| 1760 | 1760 | id="gd_stop_import" class="button-primary" name="gd_stop_import" style="display:none" |
| 1761 | 1761 | onclick="gdTerminateImport()"/> |
| 1762 | 1762 | |
| 1763 | 1763 | <div id="gd_process_data" style="display:none"><span class="spinner" |
| 1764 | - style="display:inline-block;margin:0 5px 0 5px;float:left"></span><?php _e("Wait, processing import data...", 'geodirectory');?>
|
|
| 1764 | + style="display:inline-block;margin:0 5px 0 5px;float:left"></span><?php _e("Wait, processing import data...", 'geodirectory'); ?>
|
|
| 1765 | 1765 | </div> |
| 1766 | 1766 | </div> |
| 1767 | 1767 | <div id="gd_importer" style="display:none"> |
@@ -1779,7 +1779,7 @@ discard block |
||
| 1779 | 1779 | <input type="hidden" id="gd_total_records" value="0"/> |
| 1780 | 1780 | </div> |
| 1781 | 1781 | <div class="gd-import-progress" id="gd-import-progress" style="display:none"> |
| 1782 | - <div class="gd-import-file"><b><?php _e("Import Data Status :", 'geodirectory');?> </b><font
|
|
| 1782 | + <div class="gd-import-file"><b><?php _e("Import Data Status :", 'geodirectory'); ?> </b><font
|
|
| 1783 | 1783 | id="gd-import-done">0</font> / <font id="gd-import-total">0</font> ( <font |
| 1784 | 1784 | id="gd-import-perc">0%</font> ) |
| 1785 | 1785 | <div class="gd-fileprogress"></div> |
@@ -2038,7 +2038,7 @@ discard block |
||
| 2038 | 2038 | $payment_info = array(); |
| 2039 | 2039 | $package_info = array(); |
| 2040 | 2040 | |
| 2041 | - $package_info = (array)geodir_post_package_info($package_info, '', $buffer[5]); |
|
| 2041 | + $package_info = (array) geodir_post_package_info($package_info, '', $buffer[5]); |
|
| 2042 | 2042 | $package_id = ''; |
| 2043 | 2043 | if (isset($gd_post_info['package_id']) && $gd_post_info['package_id'] != '') {
|
| 2044 | 2044 | $package_id = $gd_post_info['package_id']; |
@@ -2272,7 +2272,7 @@ discard block |
||
| 2272 | 2272 | <td class="forminp"><input name="<?php echo esc_attr($value['id']); ?>" |
| 2273 | 2273 | id="<?php echo esc_attr($value['id']); ?>" |
| 2274 | 2274 | type="<?php echo esc_attr($value['type']); ?>" |
| 2275 | - <?php if(isset($value['placeholder'])){?>placeholder="<?php echo esc_attr($value['placeholder']); ?>"<?php }?>
|
|
| 2275 | + <?php if (isset($value['placeholder'])) {?>placeholder="<?php echo esc_attr($value['placeholder']); ?>"<?php }?>
|
|
| 2276 | 2276 | style=" <?php echo esc_attr($value['css']); ?>" |
| 2277 | 2277 | value="<?php if (get_option($value['id']) !== false && get_option($value['id']) !== null) {
|
| 2278 | 2278 | echo esc_attr(stripslashes(get_option($value['id']))); |
@@ -2289,7 +2289,7 @@ discard block |
||
| 2289 | 2289 | <td class="forminp"><input name="<?php echo esc_attr($value['id']); ?>" |
| 2290 | 2290 | id="<?php echo esc_attr($value['id']); ?>" |
| 2291 | 2291 | type="<?php echo esc_attr($value['type']); ?>" |
| 2292 | - <?php if(isset($value['placeholder'])){?>placeholder="<?php echo esc_attr($value['placeholder']); ?>"<?php }?>
|
|
| 2292 | + <?php if (isset($value['placeholder'])) {?>placeholder="<?php echo esc_attr($value['placeholder']); ?>"<?php }?>
|
|
| 2293 | 2293 | style="<?php echo esc_attr($value['css']); ?>" |
| 2294 | 2294 | value="<?php if (get_option($value['id']) !== false && get_option($value['id']) !== null) {
|
| 2295 | 2295 | echo esc_attr(stripslashes(get_option($value['id']))); |
@@ -2390,7 +2390,7 @@ discard block |
||
| 2390 | 2390 | id="<?php echo esc_attr($value['id']); ?>" |
| 2391 | 2391 | style="<?php echo esc_attr($value['css']); ?>" |
| 2392 | 2392 | class="<?php if (isset($value['class'])) echo $value['class']; ?>" |
| 2393 | - data-placeholder="<?php if (isset($value['placeholder_text'])) echo $value['placeholder_text'];?>" |
|
| 2393 | + data-placeholder="<?php if (isset($value['placeholder_text'])) echo $value['placeholder_text']; ?>" |
|
| 2394 | 2394 | option-ajaxchosen="false"> |
| 2395 | 2395 | <?php |
| 2396 | 2396 | foreach ($value['options'] as $key => $val) {
|
@@ -2438,7 +2438,7 @@ discard block |
||
| 2438 | 2438 | ?> |
| 2439 | 2439 | |
| 2440 | 2440 | <tr valign="top"> |
| 2441 | - <th class="titledesc" width="40%"><?php _e('Default map language', 'geodirectory');?></th>
|
|
| 2441 | + <th class="titledesc" width="40%"><?php _e('Default map language', 'geodirectory'); ?></th>
|
|
| 2442 | 2442 | <td width="60%"> |
| 2443 | 2443 | <select name="geodir_default_map_language" style="width:60%"> |
| 2444 | 2444 | <?php |
@@ -2520,7 +2520,7 @@ discard block |
||
| 2520 | 2520 | |
| 2521 | 2521 | <tr valign="top"> |
| 2522 | 2522 | <th class="titledesc" |
| 2523 | - width="40%"><?php _e('Default post type search on map', 'geodirectory');?></th>
|
|
| 2523 | + width="40%"><?php _e('Default post type search on map', 'geodirectory'); ?></th>
|
|
| 2524 | 2524 | <td width="60%"> |
| 2525 | 2525 | <select name="geodir_default_map_search_pt" style="width:60%"> |
| 2526 | 2526 | <?php |
@@ -2561,7 +2561,7 @@ discard block |
||
| 2561 | 2561 | $cat_display = 'checkbox'; |
| 2562 | 2562 | $gd_post_types = get_option('geodir_exclude_post_type_on_map');
|
| 2563 | 2563 | $gd_cats = get_option('geodir_exclude_cat_on_map');
|
| 2564 | - $gd_cats_upgrade = (int)get_option('geodir_exclude_cat_on_map_upgrade');
|
|
| 2564 | + $gd_cats_upgrade = (int) get_option('geodir_exclude_cat_on_map_upgrade');
|
|
| 2565 | 2565 | $count = 1; |
| 2566 | 2566 | ?> |
| 2567 | 2567 | <table width="70%" class="widefat"> |
@@ -2590,7 +2590,7 @@ discard block |
||
| 2590 | 2590 | name="home_map_post_types[]" |
| 2591 | 2591 | id="<?php echo esc_attr($value['id']); ?>" |
| 2592 | 2592 | value="<?php echo $key; ?>" |
| 2593 | - class="map_post_type" <?php echo $checked;?> /> |
|
| 2593 | + class="map_post_type" <?php echo $checked; ?> /> |
|
| 2594 | 2594 | <?php echo $post_types_obj->labels->singular_name; ?></td> |
| 2595 | 2595 | <td width="40%"> |
| 2596 | 2596 | <div class="home_map_category" style="overflow:auto;width:200px;height:100px;" |
@@ -2648,12 +2648,12 @@ discard block |
||
| 2648 | 2648 | ?> |
| 2649 | 2649 | <fieldset> |
| 2650 | 2650 | <legend class="screen-reader-text"><span><?php echo $value['name'] ?></span></legend> |
| 2651 | - <label for="<?php echo $value['id'];?>"> |
|
| 2651 | + <label for="<?php echo $value['id']; ?>"> |
|
| 2652 | 2652 | <input name="<?php echo esc_attr($value['id']); ?>" |
| 2653 | 2653 | id="<?php echo esc_attr($value['id'] . $value['value']); ?>" type="radio" |
| 2654 | 2654 | value="<?php echo $value['value'] ?>" <?php if (get_option($value['id']) == $value['value']) {
|
| 2655 | 2655 | echo 'checked="checked"'; |
| 2656 | - }elseif(get_option($value['id'])=='' && $value['std']==$value['value']){echo 'checked="checked"';} ?> />
|
|
| 2656 | + }elseif (get_option($value['id']) == '' && $value['std'] == $value['value']) {echo 'checked="checked"'; } ?> />
|
|
| 2657 | 2657 | <?php echo $value['desc']; ?></label><br> |
| 2658 | 2658 | </fieldset> |
| 2659 | 2659 | <?php |
@@ -2675,7 +2675,7 @@ discard block |
||
| 2675 | 2675 | <textarea |
| 2676 | 2676 | <?php if (isset($value['args'])) echo $value['args'] . ' '; ?>name="<?php echo esc_attr($value['id']); ?>" |
| 2677 | 2677 | id="<?php echo esc_attr($value['id']); ?>" |
| 2678 | - <?php if(isset($value['placeholder'])){?>placeholder="<?php echo esc_attr($value['placeholder']); ?>"<?php }?>
|
|
| 2678 | + <?php if (isset($value['placeholder'])) {?>placeholder="<?php echo esc_attr($value['placeholder']); ?>"<?php }?>
|
|
| 2679 | 2679 | style="<?php echo esc_attr($value['css']); ?>"><?php if (get_option($value['id'])) echo esc_textarea(stripslashes(get_option($value['id']))); else echo esc_textarea($value['std']); ?></textarea><span |
| 2680 | 2680 | class="description"><?php echo $value['desc'] ?></span> |
| 2681 | 2681 | |
@@ -2722,7 +2722,7 @@ discard block |
||
| 2722 | 2722 | } |
| 2723 | 2723 | } |
| 2724 | 2724 | // |
| 2725 | - $page_setting = (int)get_option($value['id']); |
|
| 2725 | + $page_setting = (int) get_option($value['id']); |
|
| 2726 | 2726 | |
| 2727 | 2727 | $args = array('name' => $value['id'],
|
| 2728 | 2728 | 'id' => $value['id'], |
@@ -2749,7 +2749,7 @@ discard block |
||
| 2749 | 2749 | break; |
| 2750 | 2750 | case 'single_select_country' : |
| 2751 | 2751 | $countries = $geodirectory->countries->countries; |
| 2752 | - $country_setting = (string)get_option($value['id']); |
|
| 2752 | + $country_setting = (string) get_option($value['id']); |
|
| 2753 | 2753 | if (strstr($country_setting, ':')) : |
| 2754 | 2754 | $country = current(explode(':', $country_setting));
|
| 2755 | 2755 | $state = end(explode(':', $country_setting));
|
@@ -2772,7 +2772,7 @@ discard block |
||
| 2772 | 2772 | case 'multi_select_countries' : |
| 2773 | 2773 | $countries = $geodirectory->countries->countries; |
| 2774 | 2774 | asort($countries); |
| 2775 | - $selections = (array)get_option($value['id']); |
|
| 2775 | + $selections = (array) get_option($value['id']); |
|
| 2776 | 2776 | ?> |
| 2777 | 2777 | <tr valign="top"> |
| 2778 | 2778 | <th scope="row" class="titledesc"><?php echo $value['name'] ?></th> |
@@ -2794,8 +2794,8 @@ discard block |
||
| 2794 | 2794 | break; |
| 2795 | 2795 | |
| 2796 | 2796 | case 'google_analytics' : |
| 2797 | - $selections = (array)get_option($value['id']); |
|
| 2798 | - if(get_option('geodir_ga_client_id') && get_option('geodir_ga_client_secret') ) {
|
|
| 2797 | + $selections = (array) get_option($value['id']); |
|
| 2798 | + if (get_option('geodir_ga_client_id') && get_option('geodir_ga_client_secret')) {
|
|
| 2799 | 2799 | ?> |
| 2800 | 2800 | <tr valign="top"> |
| 2801 | 2801 | <th scope="row" class="titledesc"><?php echo $value['name'] ?></th> |
@@ -2806,10 +2806,10 @@ discard block |
||
| 2806 | 2806 | |
| 2807 | 2807 | $oAuthURL = "https://accounts.google.com/o/oauth2/auth?"; |
| 2808 | 2808 | $scope = "scope=https://www.googleapis.com/auth/analytics.readonly"; |
| 2809 | - $state = "&state=123";//any string |
|
| 2809 | + $state = "&state=123"; //any string |
|
| 2810 | 2810 | $redirect_uri = "&redirect_uri=" . admin_url('admin-ajax.php') . "?action=geodir_ga_callback";
|
| 2811 | 2811 | $response_type = "&response_type=code"; |
| 2812 | - $client_id = "&client_id=".get_option('geodir_ga_client_id');
|
|
| 2812 | + $client_id = "&client_id=" . get_option('geodir_ga_client_id');
|
|
| 2813 | 2813 | $access_type = "&access_type=offline"; |
| 2814 | 2814 | $approval_prompt = "&approval_prompt=force"; |
| 2815 | 2815 | |
@@ -2819,7 +2819,7 @@ discard block |
||
| 2819 | 2819 | ?> |
| 2820 | 2820 | <script> |
| 2821 | 2821 | function gd_ga_popup() {
|
| 2822 | - var win = window.open("<?php echo $auth_url;?>", "Google Analytics", "");
|
|
| 2822 | + var win = window.open("<?php echo $auth_url; ?>", "Google Analytics", "");
|
|
| 2823 | 2823 | var pollTimer = window.setInterval(function () {
|
| 2824 | 2824 | if (win.closed !== false) { // !== is required for compatibility with Opera
|
| 2825 | 2825 | window.clearInterval(pollTimer); |
@@ -2841,7 +2841,7 @@ discard block |
||
| 2841 | 2841 | } else {
|
| 2842 | 2842 | ?> |
| 2843 | 2843 | <span class="button-primary" |
| 2844 | - onclick="gd_ga_popup();"><?php _e('Authorize', 'geodirectory');?></span>
|
|
| 2844 | + onclick="gd_ga_popup();"><?php _e('Authorize', 'geodirectory'); ?></span>
|
|
| 2845 | 2845 | <?php |
| 2846 | 2846 | } |
| 2847 | 2847 | ?> |
@@ -2912,15 +2912,15 @@ discard block |
||
| 2912 | 2912 | |
| 2913 | 2913 | |
| 2914 | 2914 | <?php |
| 2915 | - if(isset($_REQUEST['active_tab']) && $_REQUEST['active_tab'] != '') |
|
| 2915 | + if (isset($_REQUEST['active_tab']) && $_REQUEST['active_tab'] != '') |
|
| 2916 | 2916 | {
|
| 2917 | 2917 | |
| 2918 | 2918 | ?> |
| 2919 | 2919 | jQuery('.geodir_option_tabs').removeClass('gd-tab-active');
|
| 2920 | - jQuery('#<?php echo $_REQUEST['active_tab'];?>').addClass('gd-tab-active');
|
|
| 2920 | + jQuery('#<?php echo $_REQUEST['active_tab']; ?>').addClass('gd-tab-active');
|
|
| 2921 | 2921 | |
| 2922 | 2922 | jQuery('.gd-content-heading').hide();
|
| 2923 | - jQuery('#sub_<?php echo $_REQUEST['active_tab'];?>').show();
|
|
| 2923 | + jQuery('#sub_<?php echo $_REQUEST['active_tab']; ?>').show();
|
|
| 2924 | 2924 | |
| 2925 | 2925 | |
| 2926 | 2926 | <?php |
@@ -3069,7 +3069,7 @@ discard block |
||
| 3069 | 3069 | <div |
| 3070 | 3070 | class="plupload-upload-uic hide-if-no-js <?php if ($multiple): ?>plupload-upload-uic-multiple<?php endif; ?>" |
| 3071 | 3071 | id="<?php echo $id; ?>plupload-upload-ui"> |
| 3072 | - <h4><?php _e('Drop files to upload', 'geodirectory');?></h4>
|
|
| 3072 | + <h4><?php _e('Drop files to upload', 'geodirectory'); ?></h4>
|
|
| 3073 | 3073 | <input id="<?php echo $id; ?>plupload-browse-button" type="button" |
| 3074 | 3074 | value="<?php _e('Select Files', 'geodirectory'); ?>" class="button"/>
|
| 3075 | 3075 | <span class="ajaxnonceplu" id="ajaxnonceplu<?php echo wp_create_nonce($id . 'pluploadan'); ?>"></span> |
@@ -3084,7 +3084,7 @@ discard block |
||
| 3084 | 3084 | id="<?php echo $id; ?>plupload-thumbs" style="border-top:1px solid #ccc; padding-top:10px;"> |
| 3085 | 3085 | </div> |
| 3086 | 3086 | <span |
| 3087 | - id="upload-msg"><?php _e('Please drag & drop the images to rearrange the order', 'geodirectory');?></span>
|
|
| 3087 | + id="upload-msg"><?php _e('Please drag & drop the images to rearrange the order', 'geodirectory'); ?></span>
|
|
| 3088 | 3088 | <span id="<?php echo $id; ?>upload-error" style="display:none"></span> |
| 3089 | 3089 | </div> |
| 3090 | 3090 | |
@@ -3462,11 +3462,11 @@ discard block |
||
| 3462 | 3462 | function geodir_hide_admin_preview_button() {
|
| 3463 | 3463 | global $post_type; |
| 3464 | 3464 | $post_types = geodir_get_posttypes(); |
| 3465 | - if(in_array($post_type, $post_types)) |
|
| 3465 | + if (in_array($post_type, $post_types)) |
|
| 3466 | 3466 | echo '<style type="text/css">#post-preview, #view-post-btn{display: none;}</style>';
|
| 3467 | 3467 | } |
| 3468 | -add_action( 'admin_head-post-new.php', 'geodir_hide_admin_preview_button' ); |
|
| 3469 | -add_action( 'admin_head-post.php', 'geodir_hide_admin_preview_button' ); |
|
| 3468 | +add_action('admin_head-post-new.php', 'geodir_hide_admin_preview_button');
|
|
| 3469 | +add_action('admin_head-post.php', 'geodir_hide_admin_preview_button');
|
|
| 3470 | 3470 | |
| 3471 | 3471 | /** |
| 3472 | 3472 | * Add the tab in left sidebar menu fro import & export page. |
@@ -3476,8 +3476,8 @@ discard block |
||
| 3476 | 3476 | * |
| 3477 | 3477 | * @return array Array of tab data. |
| 3478 | 3478 | */ |
| 3479 | -function geodir_import_export_tab( $tabs ) {
|
|
| 3480 | - $tabs['import_export'] = array( 'label' => __( 'Import & Export', 'geodirectory' ) ); |
|
| 3479 | +function geodir_import_export_tab($tabs) {
|
|
| 3480 | + $tabs['import_export'] = array('label' => __('Import & Export', 'geodirectory'));
|
|
| 3481 | 3481 | return $tabs; |
| 3482 | 3482 | } |
| 3483 | 3483 | |
@@ -3491,7 +3491,7 @@ discard block |
||
| 3491 | 3491 | * @return string Html content. |
| 3492 | 3492 | */ |
| 3493 | 3493 | function geodir_import_export_page() {
|
| 3494 | - $nonce = wp_create_nonce( 'geodir_import_export_nonce' ); |
|
| 3494 | + $nonce = wp_create_nonce('geodir_import_export_nonce');
|
|
| 3495 | 3495 | $gd_cats_sample_csv = geodir_plugin_url() . '/geodirectory-assets/gd_sample_categories.csv'; |
| 3496 | 3496 | /** |
| 3497 | 3497 | * Filter sample category data csv file url. |
@@ -3501,7 +3501,7 @@ discard block |
||
| 3501 | 3501 | * |
| 3502 | 3502 | * @param string $gd_cats_sample_csv Sample category data csv file url. |
| 3503 | 3503 | */ |
| 3504 | - $gd_cats_sample_csv = apply_filters( 'geodir_export_cats_sample_csv', $gd_cats_sample_csv ); |
|
| 3504 | + $gd_cats_sample_csv = apply_filters('geodir_export_cats_sample_csv', $gd_cats_sample_csv);
|
|
| 3505 | 3505 | |
| 3506 | 3506 | $gd_posts_sample_csv = geodir_plugin_url() . '/geodirectory-assets/place_listing.csv'; |
| 3507 | 3507 | /** |
@@ -3512,15 +3512,15 @@ discard block |
||
| 3512 | 3512 | * |
| 3513 | 3513 | * @param string $gd_posts_sample_csv Sample post data csv file url. |
| 3514 | 3514 | */ |
| 3515 | - $gd_posts_sample_csv = apply_filters( 'geodir_export_posts_sample_csv', $gd_posts_sample_csv ); |
|
| 3515 | + $gd_posts_sample_csv = apply_filters('geodir_export_posts_sample_csv', $gd_posts_sample_csv);
|
|
| 3516 | 3516 | |
| 3517 | - $gd_posttypes = geodir_get_posttypes( 'array' ); |
|
| 3517 | + $gd_posttypes = geodir_get_posttypes('array');
|
|
| 3518 | 3518 | |
| 3519 | 3519 | $gd_posttypes_option = ''; |
| 3520 | - foreach ( $gd_posttypes as $gd_posttype => $row ) {
|
|
| 3521 | - $gd_posttypes_option .= '<option value="' . $gd_posttype . '" data-cats="' . (int)geodir_get_terms_count( $gd_posttype ) . '" data-posts="' . (int)geodir_get_posts_count( $gd_posttype ) . '">' . __( $row['labels']['name'], 'geodirectory' ) . '</option>'; |
|
| 3520 | + foreach ($gd_posttypes as $gd_posttype => $row) {
|
|
| 3521 | + $gd_posttypes_option .= '<option value="' . $gd_posttype . '" data-cats="' . (int) geodir_get_terms_count($gd_posttype) . '" data-posts="' . (int) geodir_get_posts_count($gd_posttype) . '">' . __($row['labels']['name'], 'geodirectory') . '</option>'; |
|
| 3522 | 3522 | } |
| 3523 | - wp_enqueue_script( 'jquery-ui-progressbar' ); |
|
| 3523 | + wp_enqueue_script('jquery-ui-progressbar');
|
|
| 3524 | 3524 | |
| 3525 | 3525 | $gd_chunksize_options = array(); |
| 3526 | 3526 | $gd_chunksize_options[100] = 100; |
@@ -3542,7 +3542,7 @@ discard block |
||
| 3542 | 3542 | * |
| 3543 | 3543 | * @param string $gd_chunksize_options Entries options. |
| 3544 | 3544 | */ |
| 3545 | - $gd_chunksize_options = apply_filters( 'geodir_export_csv_chunksize_options', $gd_chunksize_options ); |
|
| 3545 | + $gd_chunksize_options = apply_filters('geodir_export_csv_chunksize_options', $gd_chunksize_options);
|
|
| 3546 | 3546 | |
| 3547 | 3547 | $gd_chunksize_option = ''; |
| 3548 | 3548 | foreach ($gd_chunksize_options as $value => $title) {
|
@@ -3553,38 +3553,38 @@ discard block |
||
| 3553 | 3553 | ?> |
| 3554 | 3554 | </form> |
| 3555 | 3555 | <div class="inner_content_tab_main gd-import-export"> |
| 3556 | - <h3><?php _e( 'GD Import & Export CSV', 'geodirectory' ) ;?></h3> |
|
| 3557 | - <span class="description"><?php _e( 'Import & export csv for GD listings & categories.', 'geodirectory' ) ;?></span> |
|
| 3556 | + <h3><?php _e('GD Import & Export CSV', 'geodirectory'); ?></h3>
|
|
| 3557 | + <span class="description"><?php _e('Import & export csv for GD listings & categories.', 'geodirectory'); ?></span>
|
|
| 3558 | 3558 | <div class="gd-content-heading"> |
| 3559 | 3559 | |
| 3560 | 3560 | <?php |
| 3561 | 3561 | ini_set('max_execution_time', 999999);
|
| 3562 | - $ini_max_execution_time_check = @ini_get( 'max_execution_time' ); |
|
| 3562 | + $ini_max_execution_time_check = @ini_get('max_execution_time');
|
|
| 3563 | 3563 | ini_restore('max_execution_time');
|
| 3564 | 3564 | |
| 3565 | - if($ini_max_execution_time_check != 999999){ // only show these setting to the user if we can't change the ini setting
|
|
| 3565 | + if ($ini_max_execution_time_check != 999999) { // only show these setting to the user if we can't change the ini setting
|
|
| 3566 | 3566 | ?> |
| 3567 | 3567 | <div id="gd_ie_reqs" class="metabox-holder"> |
| 3568 | 3568 | <div class="meta-box-sortables ui-sortable"> |
| 3569 | 3569 | <div class="postbox"> |
| 3570 | - <h3 class="hndle"><span style='vertical-align:top;'><?php echo __( 'PHP Requirements for GD Import & Export CSV', 'geodirectory' );?></span></h3> |
|
| 3570 | + <h3 class="hndle"><span style='vertical-align:top;'><?php echo __('PHP Requirements for GD Import & Export CSV', 'geodirectory'); ?></span></h3>
|
|
| 3571 | 3571 | <div class="inside"> |
| 3572 | - <span class="description"><?php echo __( 'Note: In case GD import & export csv not working for larger data then please check and configure following php settings.', 'geodirectory' );?></span> |
|
| 3572 | + <span class="description"><?php echo __('Note: In case GD import & export csv not working for larger data then please check and configure following php settings.', 'geodirectory'); ?></span>
|
|
| 3573 | 3573 | <table class="form-table"> |
| 3574 | 3574 | <thead> |
| 3575 | 3575 | <tr> |
| 3576 | - <th><?php _e( 'PHP Settings', 'geodirectory' );?></th><th><?php _e( 'Current Value', 'geodirectory' );?></th><th><?php _e( 'Recommended Value', 'geodirectory' );?></th> |
|
| 3576 | + <th><?php _e('PHP Settings', 'geodirectory'); ?></th><th><?php _e('Current Value', 'geodirectory'); ?></th><th><?php _e('Recommended Value', 'geodirectory'); ?></th>
|
|
| 3577 | 3577 | </tr> |
| 3578 | 3578 | </thead> |
| 3579 | 3579 | <tbody> |
| 3580 | 3580 | <tr> |
| 3581 | - <td>max_input_time</td><td><?php echo @ini_get( 'max_input_time' );?></td><td>3000</td> |
|
| 3581 | + <td>max_input_time</td><td><?php echo @ini_get('max_input_time'); ?></td><td>3000</td>
|
|
| 3582 | 3582 | </tr> |
| 3583 | 3583 | <tr> |
| 3584 | - <td>max_execution_time</td><td><?php echo @ini_get( 'max_execution_time' );?></td><td>3000</td> |
|
| 3584 | + <td>max_execution_time</td><td><?php echo @ini_get('max_execution_time'); ?></td><td>3000</td>
|
|
| 3585 | 3585 | </tr> |
| 3586 | 3586 | <tr> |
| 3587 | - <td>memory_limit</td><td><?php echo @ini_get( 'memory_limit' );?></td><td>256M</td> |
|
| 3587 | + <td>memory_limit</td><td><?php echo @ini_get('memory_limit'); ?></td><td>256M</td>
|
|
| 3588 | 3588 | </tr> |
| 3589 | 3589 | </tbody> |
| 3590 | 3590 | </table> |
@@ -3596,20 +3596,20 @@ discard block |
||
| 3596 | 3596 | <div id="gd_ie_imposts" class="metabox-holder"> |
| 3597 | 3597 | <div class="meta-box-sortables ui-sortable"> |
| 3598 | 3598 | <div id="gd_ie_im_posts" class="postbox"> |
| 3599 | - <h3 class="hndle"><span style='vertical-align:top;'><?php echo __( 'GD Listings: Import CSV', 'geodirectory' );?></span></h3> |
|
| 3599 | + <h3 class="hndle"><span style='vertical-align:top;'><?php echo __('GD Listings: Import CSV', 'geodirectory'); ?></span></h3>
|
|
| 3600 | 3600 | <div class="inside"> |
| 3601 | 3601 | <table class="form-table"> |
| 3602 | 3602 | <tbody> |
| 3603 | 3603 | <tr> |
| 3604 | 3604 | <td class="gd-imex-box"> |
| 3605 | 3605 | <div class="gd-im-choices"> |
| 3606 | - <p><input type="radio" value="update" name="gd_im_choicepost" id="gd_im_pchoice_u" /><label for="gd_im_pchoice_u"><?php _e( 'Update listing if post with post_id already exists.', 'geodirectory' );?></label></p> |
|
| 3607 | - <p><input type="radio" checked="checked" value="skip" name="gd_im_choicepost" id="gd_im_pchoice_s" /><label for="gd_im_pchoice_s"><?php _e( 'Ignore listing if post with post_id already exists.', 'geodirectory' );?></label></p> |
|
| 3606 | + <p><input type="radio" value="update" name="gd_im_choicepost" id="gd_im_pchoice_u" /><label for="gd_im_pchoice_u"><?php _e('Update listing if post with post_id already exists.', 'geodirectory'); ?></label></p>
|
|
| 3607 | + <p><input type="radio" checked="checked" value="skip" name="gd_im_choicepost" id="gd_im_pchoice_s" /><label for="gd_im_pchoice_s"><?php _e('Ignore listing if post with post_id already exists.', 'geodirectory'); ?></label></p>
|
|
| 3608 | 3608 | </div> |
| 3609 | 3609 | <div class="plupload-upload-uic hide-if-no-js" id="gd_im_postplupload-upload-ui"> |
| 3610 | 3610 | <input type="text" readonly="readonly" name="gd_im_post_file" class="gd-imex-file gd_im_post_file" id="gd_im_post" onclick="jQuery('#gd_im_postplupload-browse-button').trigger('click');" />
|
| 3611 | - <input id="gd_im_postplupload-browse-button" type="button" value="<?php echo SELECT_UPLOAD_CSV; ?>" class="gd-imex-pupload button-primary" /><input type="button" value="<?php echo esc_attr( __( 'Download Sample CSV', 'geodirectory' ) );?>" class="button-secondary" name="gd_ie_imposts_sample" id="gd_ie_imposts_sample"> |
|
| 3612 | - <input type="hidden" id="gd_ie_imposts_csv" value="<?php echo $gd_posts_sample_csv;?>" /> |
|
| 3611 | + <input id="gd_im_postplupload-browse-button" type="button" value="<?php echo SELECT_UPLOAD_CSV; ?>" class="gd-imex-pupload button-primary" /><input type="button" value="<?php echo esc_attr(__('Download Sample CSV', 'geodirectory')); ?>" class="button-secondary" name="gd_ie_imposts_sample" id="gd_ie_imposts_sample">
|
|
| 3612 | + <input type="hidden" id="gd_ie_imposts_csv" value="<?php echo $gd_posts_sample_csv; ?>" /> |
|
| 3613 | 3613 | <?php |
| 3614 | 3614 | /** |
| 3615 | 3615 | * Called just after the sample CSV download link. |
@@ -3618,7 +3618,7 @@ discard block |
||
| 3618 | 3618 | */ |
| 3619 | 3619 | do_action('geodir_sample_csv_download_link');
|
| 3620 | 3620 | ?> |
| 3621 | - <span class="ajaxnonceplu" id="ajaxnonceplu<?php echo wp_create_nonce( 'gd_im_postpluploadan' ); ?>"></span> |
|
| 3621 | + <span class="ajaxnonceplu" id="ajaxnonceplu<?php echo wp_create_nonce('gd_im_postpluploadan'); ?>"></span>
|
|
| 3622 | 3622 | <div class="filelist"></div> |
| 3623 | 3623 | </div> |
| 3624 | 3624 | <span id="gd_im_catupload-error" style="display:none"></span> |
@@ -3636,7 +3636,7 @@ discard block |
||
| 3636 | 3636 | <input type="hidden" id="gd_terminateaction" value="continue"/> |
| 3637 | 3637 | </div> |
| 3638 | 3638 | <div class="gd-import-progress" id="gd-import-progress" style="display:none"> |
| 3639 | - <div class="gd-import-file"><b><?php _e("Import Data Status :", 'geodirectory');?> </b><font
|
|
| 3639 | + <div class="gd-import-file"><b><?php _e("Import Data Status :", 'geodirectory'); ?> </b><font
|
|
| 3640 | 3640 | id="gd-import-done">0</font> / <font id="gd-import-total">0</font> ( <font |
| 3641 | 3641 | id="gd-import-perc">0%</font> ) |
| 3642 | 3642 | <div class="gd-fileprogress"></div> |
@@ -3648,10 +3648,10 @@ discard block |
||
| 3648 | 3648 | <div class="gd-imex-btns" style="display:none;"> |
| 3649 | 3649 | <input type="hidden" class="geodir_import_file" name="geodir_import_file" value="save"/> |
| 3650 | 3650 | <input onclick="gd_imex_PrepareImport(this, 'post')" type="button" value="<?php echo CSV_IMPORT_DATA; ?>" id="gd_import_data" class="button-primary" /> |
| 3651 | - <input onclick="gd_imex_ContinueImport(this, 'post')" type="button" value="<?php _e( "Continue Import Data", 'geodirectory' );?>" id="gd_continue_data" class="button-primary" style="display:none"/> |
|
| 3652 | - <input type="button" value="<?php _e("Terminate Import Data", 'geodirectory');?>" id="gd_stop_import" class="button-primary" name="gd_stop_import" style="display:none" onclick="gd_imex_TerminateImport(this, 'post')"/>
|
|
| 3651 | + <input onclick="gd_imex_ContinueImport(this, 'post')" type="button" value="<?php _e("Continue Import Data", 'geodirectory'); ?>" id="gd_continue_data" class="button-primary" style="display:none"/>
|
|
| 3652 | + <input type="button" value="<?php _e("Terminate Import Data", 'geodirectory'); ?>" id="gd_stop_import" class="button-primary" name="gd_stop_import" style="display:none" onclick="gd_imex_TerminateImport(this, 'post')"/>
|
|
| 3653 | 3653 | <div id="gd_process_data" style="display:none"> |
| 3654 | - <span class="spinner is-active" style="display:inline-block;margin:0 5px 0 5px;float:left"></span><?php _e("Wait, processing import data...", 'geodirectory');?>
|
|
| 3654 | + <span class="spinner is-active" style="display:inline-block;margin:0 5px 0 5px;float:left"></span><?php _e("Wait, processing import data...", 'geodirectory'); ?>
|
|
| 3655 | 3655 | </div> |
| 3656 | 3656 | </div> |
| 3657 | 3657 | </td> |
@@ -3665,25 +3665,25 @@ discard block |
||
| 3665 | 3665 | <div id="gd_ie_excategs" class="metabox-holder"> |
| 3666 | 3666 | <div class="meta-box-sortables ui-sortable"> |
| 3667 | 3667 | <div id="gd_ie_ex_posts" class="postbox"> |
| 3668 | - <h3 class="hndle"><span style='vertical-align:top;'><?php echo __( 'GD Listings: Export CSV', 'geodirectory' );?></span></h3> |
|
| 3668 | + <h3 class="hndle"><span style='vertical-align:top;'><?php echo __('GD Listings: Export CSV', 'geodirectory'); ?></span></h3>
|
|
| 3669 | 3669 | <div class="inside"> |
| 3670 | 3670 | <table class="form-table"> |
| 3671 | 3671 | <tbody> |
| 3672 | 3672 | <tr> |
| 3673 | 3673 | <td class="fld"><label for="gd_post_type"> |
| 3674 | - <?php _e( 'Post Type:', 'geodirectory' );?> |
|
| 3674 | + <?php _e('Post Type:', 'geodirectory'); ?>
|
|
| 3675 | 3675 | </label></td> |
| 3676 | 3676 | <td><select name="gd_post_type" id="gd_post_type" style="min-width:140px"> |
| 3677 | - <?php echo $gd_posttypes_option;?> |
|
| 3677 | + <?php echo $gd_posttypes_option; ?> |
|
| 3678 | 3678 | </select></td> |
| 3679 | 3679 | </tr> |
| 3680 | 3680 | <tr> |
| 3681 | - <td class="fld" style="vertical-align:top"><label for="gd_chunk_size"><?php _e( 'Max entries per csv file:', 'geodirectory' );?></label></td> |
|
| 3682 | - <td><select name="gd_chunk_size" id="gd_chunk_size" style="min-width:140px"><?php echo $gd_chunksize_option;?></select><span class="description"><?php _e( 'Please select the maximum number of entries per csv file (defaults to 5000, you might want to lower this to prevent memory issues on some installs)', 'geodirectory' );?></span></td> |
|
| 3681 | + <td class="fld" style="vertical-align:top"><label for="gd_chunk_size"><?php _e('Max entries per csv file:', 'geodirectory'); ?></label></td>
|
|
| 3682 | + <td><select name="gd_chunk_size" id="gd_chunk_size" style="min-width:140px"><?php echo $gd_chunksize_option; ?></select><span class="description"><?php _e('Please select the maximum number of entries per csv file (defaults to 5000, you might want to lower this to prevent memory issues on some installs)', 'geodirectory'); ?></span></td>
|
|
| 3683 | 3683 | </tr> |
| 3684 | 3684 | <tr> |
| 3685 | 3685 | <td class="fld" style="vertical-align:top"><label> |
| 3686 | - <?php _e( 'Progress:', 'geodirectory' );?> |
|
| 3686 | + <?php _e('Progress:', 'geodirectory'); ?>
|
|
| 3687 | 3687 | </label></td> |
| 3688 | 3688 | <td><div id='gd_progressbar_box'> |
| 3689 | 3689 | <div id="gd_progressbar" class="gd_progressbar"> |
@@ -3691,13 +3691,13 @@ discard block |
||
| 3691 | 3691 | </div> |
| 3692 | 3692 | </div> |
| 3693 | 3693 | <p style="display:inline-block"> |
| 3694 | - <?php _e( 'Elapsed Time:', 'geodirectory' );?> |
|
| 3694 | + <?php _e('Elapsed Time:', 'geodirectory'); ?>
|
|
| 3695 | 3695 | </p> |
| 3696 | 3696 | |
| 3697 | 3697 | <p id="gd_timer" class="gd_timer">00:00:00</p></td> |
| 3698 | 3698 | </tr> |
| 3699 | 3699 | <tr class="gd-ie-actions"> |
| 3700 | - <td style="vertical-align:top"><input type="submit" value="<?php echo esc_attr( __( 'Export CSV', 'geodirectory' ) );?>" class="button-primary" name="gd_ie_exposts_submit" id="gd_ie_exposts_submit"> |
|
| 3700 | + <td style="vertical-align:top"><input type="submit" value="<?php echo esc_attr(__('Export CSV', 'geodirectory')); ?>" class="button-primary" name="gd_ie_exposts_submit" id="gd_ie_exposts_submit">
|
|
| 3701 | 3701 | </td> |
| 3702 | 3702 | <td id="gd_ie_ex_files" class="gd-ie-files"></td> |
| 3703 | 3703 | </tr> |
@@ -3710,20 +3710,20 @@ discard block |
||
| 3710 | 3710 | <div id="gd_ie_imcategs" class="metabox-holder"> |
| 3711 | 3711 | <div class="meta-box-sortables ui-sortable"> |
| 3712 | 3712 | <div id="gd_ie_imcats" class="postbox"> |
| 3713 | - <h3 class="hndle"><span style='vertical-align:top;'><?php echo __( 'GD Categories: Import CSV', 'geodirectory' );?></span></h3> |
|
| 3713 | + <h3 class="hndle"><span style='vertical-align:top;'><?php echo __('GD Categories: Import CSV', 'geodirectory'); ?></span></h3>
|
|
| 3714 | 3714 | <div class="inside"> |
| 3715 | 3715 | <table class="form-table"> |
| 3716 | 3716 | <tbody> |
| 3717 | 3717 | <tr> |
| 3718 | 3718 | <td class="gd-imex-box"> |
| 3719 | 3719 | <div class="gd-im-choices"> |
| 3720 | - <p><input type="radio" value="update" name="gd_im_choicecat" id="gd_im_cchoice_u" /><label for="gd_im_cchoice_u"><?php _e( 'Update item if item with cat_id/cat_slug already exists.', 'geodirectory' );?></label></p> |
|
| 3721 | - <p><input type="radio" checked="checked" value="skip" name="gd_im_choicecat" id="gd_im_cchoice_s" /><label for="gd_im_cchoice_s"><?php _e( 'Ignore item if item with cat_id/cat_slug already exists.', 'geodirectory' );?></label></p> |
|
| 3720 | + <p><input type="radio" value="update" name="gd_im_choicecat" id="gd_im_cchoice_u" /><label for="gd_im_cchoice_u"><?php _e('Update item if item with cat_id/cat_slug already exists.', 'geodirectory'); ?></label></p>
|
|
| 3721 | + <p><input type="radio" checked="checked" value="skip" name="gd_im_choicecat" id="gd_im_cchoice_s" /><label for="gd_im_cchoice_s"><?php _e('Ignore item if item with cat_id/cat_slug already exists.', 'geodirectory'); ?></label></p>
|
|
| 3722 | 3722 | </div> |
| 3723 | 3723 | <div class="plupload-upload-uic hide-if-no-js" id="gd_im_catplupload-upload-ui"> |
| 3724 | 3724 | <input type="text" readonly="readonly" name="gd_im_cat_file" class="gd-imex-file gd_im_cat_file" id="gd_im_cat" onclick="jQuery('#gd_im_catplupload-browse-button').trigger('click');" />
|
| 3725 | - <input id="gd_im_catplupload-browse-button" type="button" value="<?php echo SELECT_UPLOAD_CSV; ?>" class="gd-imex-cupload button-primary" /><input type="button" value="<?php echo esc_attr( __( 'Download Sample CSV', 'geodirectory' ) );?>" class="button-secondary" name="gd_ie_imcats_sample" id="gd_ie_imcats_sample"> |
|
| 3726 | - <input type="hidden" id="gd_ie_imcats_csv" value="<?php echo $gd_cats_sample_csv;?>" /> |
|
| 3725 | + <input id="gd_im_catplupload-browse-button" type="button" value="<?php echo SELECT_UPLOAD_CSV; ?>" class="gd-imex-cupload button-primary" /><input type="button" value="<?php echo esc_attr(__('Download Sample CSV', 'geodirectory')); ?>" class="button-secondary" name="gd_ie_imcats_sample" id="gd_ie_imcats_sample">
|
|
| 3726 | + <input type="hidden" id="gd_ie_imcats_csv" value="<?php echo $gd_cats_sample_csv; ?>" /> |
|
| 3727 | 3727 | <?php |
| 3728 | 3728 | /** |
| 3729 | 3729 | * Called just after the sample CSV download link. |
@@ -3733,7 +3733,7 @@ discard block |
||
| 3733 | 3733 | */ |
| 3734 | 3734 | do_action('geodir_sample_cats_csv_download_link');
|
| 3735 | 3735 | ?> |
| 3736 | - <span class="ajaxnonceplu" id="ajaxnonceplu<?php echo wp_create_nonce( 'gd_im_catpluploadan' ); ?>"></span> |
|
| 3736 | + <span class="ajaxnonceplu" id="ajaxnonceplu<?php echo wp_create_nonce('gd_im_catpluploadan'); ?>"></span>
|
|
| 3737 | 3737 | <div class="filelist"></div> |
| 3738 | 3738 | </div> |
| 3739 | 3739 | <span id="gd_im_catupload-error" style="display:none"></span> |
@@ -3750,7 +3750,7 @@ discard block |
||
| 3750 | 3750 | <input type="hidden" id="gd_terminateaction" value="continue"/> |
| 3751 | 3751 | </div> |
| 3752 | 3752 | <div class="gd-import-progress" id="gd-import-progress" style="display:none"> |
| 3753 | - <div class="gd-import-file"><b><?php _e("Import Data Status :", 'geodirectory');?> </b><font
|
|
| 3753 | + <div class="gd-import-file"><b><?php _e("Import Data Status :", 'geodirectory'); ?> </b><font
|
|
| 3754 | 3754 | id="gd-import-done">0</font> / <font id="gd-import-total">0</font> ( <font |
| 3755 | 3755 | id="gd-import-perc">0%</font> ) |
| 3756 | 3756 | <div class="gd-fileprogress"></div> |
@@ -3762,10 +3762,10 @@ discard block |
||
| 3762 | 3762 | <div class="gd-imex-btns" style="display:none;"> |
| 3763 | 3763 | <input type="hidden" class="geodir_import_file" name="geodir_import_file" value="save"/> |
| 3764 | 3764 | <input onclick="gd_imex_PrepareImport(this, 'cat')" type="button" value="<?php echo CSV_IMPORT_DATA; ?>" id="gd_import_data" class="button-primary" /> |
| 3765 | - <input onclick="gd_imex_ContinueImport(this, 'cat')" type="button" value="<?php _e( "Continue Import Data", 'geodirectory' );?>" id="gd_continue_data" class="button-primary" style="display:none"/> |
|
| 3766 | - <input type="button" value="<?php _e("Terminate Import Data", 'geodirectory');?>" id="gd_stop_import" class="button-primary" name="gd_stop_import" style="display:none" onclick="gd_imex_TerminateImport(this, 'cat')"/>
|
|
| 3765 | + <input onclick="gd_imex_ContinueImport(this, 'cat')" type="button" value="<?php _e("Continue Import Data", 'geodirectory'); ?>" id="gd_continue_data" class="button-primary" style="display:none"/>
|
|
| 3766 | + <input type="button" value="<?php _e("Terminate Import Data", 'geodirectory'); ?>" id="gd_stop_import" class="button-primary" name="gd_stop_import" style="display:none" onclick="gd_imex_TerminateImport(this, 'cat')"/>
|
|
| 3767 | 3767 | <div id="gd_process_data" style="display:none"> |
| 3768 | - <span class="spinner is-active" style="display:inline-block;margin:0 5px 0 5px;float:left"></span><?php _e("Wait, processing import data...", 'geodirectory');?>
|
|
| 3768 | + <span class="spinner is-active" style="display:inline-block;margin:0 5px 0 5px;float:left"></span><?php _e("Wait, processing import data...", 'geodirectory'); ?>
|
|
| 3769 | 3769 | </div> |
| 3770 | 3770 | </div> |
| 3771 | 3771 | </td> |
@@ -3779,25 +3779,25 @@ discard block |
||
| 3779 | 3779 | <div id="gd_ie_excategs" class="metabox-holder"> |
| 3780 | 3780 | <div class="meta-box-sortables ui-sortable"> |
| 3781 | 3781 | <div id="gd_ie_ex_cats" class="postbox"> |
| 3782 | - <h3 class="hndle"><span style='vertical-align:top;'><?php echo __( 'GD Categories: Export CSV', 'geodirectory' );?></span></h3> |
|
| 3782 | + <h3 class="hndle"><span style='vertical-align:top;'><?php echo __('GD Categories: Export CSV', 'geodirectory'); ?></span></h3>
|
|
| 3783 | 3783 | <div class="inside"> |
| 3784 | 3784 | <table class="form-table"> |
| 3785 | 3785 | <tbody> |
| 3786 | 3786 | <tr> |
| 3787 | - <td class="fld"><label for="gd_post_type"><?php _e( 'Post Type:', 'geodirectory' );?></label></td> |
|
| 3788 | - <td><select name="gd_post_type" id="gd_post_type" style="min-width:140px"><?php echo $gd_posttypes_option;?></select></td> |
|
| 3787 | + <td class="fld"><label for="gd_post_type"><?php _e('Post Type:', 'geodirectory'); ?></label></td>
|
|
| 3788 | + <td><select name="gd_post_type" id="gd_post_type" style="min-width:140px"><?php echo $gd_posttypes_option; ?></select></td> |
|
| 3789 | 3789 | </tr> |
| 3790 | 3790 | <tr> |
| 3791 | - <td class="fld" style="vertical-align:top"><label for="gd_chunk_size"><?php _e( 'Max entries per csv file:', 'geodirectory' );?></label></td> |
|
| 3792 | - <td><select name="gd_chunk_size" id="gd_chunk_size" style="min-width:140px"><?php echo $gd_chunksize_option;?></select><span class="description"><?php _e( 'Please select the maximum number of entries per csv file (defaults to 5000, you might want to lower this to prevent memory issues on some installs)', 'geodirectory' );?></span></td> |
|
| 3791 | + <td class="fld" style="vertical-align:top"><label for="gd_chunk_size"><?php _e('Max entries per csv file:', 'geodirectory'); ?></label></td>
|
|
| 3792 | + <td><select name="gd_chunk_size" id="gd_chunk_size" style="min-width:140px"><?php echo $gd_chunksize_option; ?></select><span class="description"><?php _e('Please select the maximum number of entries per csv file (defaults to 5000, you might want to lower this to prevent memory issues on some installs)', 'geodirectory'); ?></span></td>
|
|
| 3793 | 3793 | </tr> |
| 3794 | 3794 | <tr> |
| 3795 | - <td class="fld" style="vertical-align:top"><label><?php _e( 'Progress:', 'geodirectory' );?></label></td> |
|
| 3796 | - <td><div id='gd_progressbar_box'><div id="gd_progressbar" class="gd_progressbar"><div class="gd-progress-label"></div></div></div><p style="display:inline-block"><?php _e( 'Elapsed Time:', 'geodirectory' );?></p> <p id="gd_timer" class="gd_timer">00:00:00</p></td> |
|
| 3795 | + <td class="fld" style="vertical-align:top"><label><?php _e('Progress:', 'geodirectory'); ?></label></td>
|
|
| 3796 | + <td><div id='gd_progressbar_box'><div id="gd_progressbar" class="gd_progressbar"><div class="gd-progress-label"></div></div></div><p style="display:inline-block"><?php _e('Elapsed Time:', 'geodirectory'); ?></p> <p id="gd_timer" class="gd_timer">00:00:00</p></td>
|
|
| 3797 | 3797 | </tr> |
| 3798 | 3798 | <tr class="gd-ie-actions"> |
| 3799 | 3799 | <td style="vertical-align:top"> |
| 3800 | - <input type="submit" value="<?php echo esc_attr( __( 'Export CSV', 'geodirectory' ) );?>" class="button-primary" name="gd_ie_excats_submit" id="gd_ie_excats_submit"> |
|
| 3800 | + <input type="submit" value="<?php echo esc_attr(__('Export CSV', 'geodirectory')); ?>" class="button-primary" name="gd_ie_excats_submit" id="gd_ie_excats_submit">
|
|
| 3801 | 3801 | </td> |
| 3802 | 3802 | <td id="gd_ie_ex_files" class="gd-ie-files"></td> |
| 3803 | 3803 | </tr> |
@@ -3819,7 +3819,7 @@ discard block |
||
| 3819 | 3819 | * @param array $gd_chunksize_options File chunk size options. |
| 3820 | 3820 | * @param string $nonce Wordpress security token for GD import & export. |
| 3821 | 3821 | */ |
| 3822 | - do_action( 'geodir_import_export', $gd_posttypes, $gd_chunksize_options, $nonce ); |
|
| 3822 | + do_action('geodir_import_export', $gd_posttypes, $gd_chunksize_options, $nonce);
|
|
| 3823 | 3823 | ?> |
| 3824 | 3824 | </div> |
| 3825 | 3825 | </div> |
@@ -3838,7 +3838,7 @@ discard block |
||
| 3838 | 3838 | jQuery.ajax({
|
| 3839 | 3839 | url: ajaxurl, |
| 3840 | 3840 | type: "POST", |
| 3841 | - data: 'action=geodir_import_export&task=prepare_import&_pt=' + type + '&_file=' + uploadedFile + '&_nonce=<?php echo $nonce;?>', |
|
| 3841 | + data: 'action=geodir_import_export&task=prepare_import&_pt=' + type + '&_file=' + uploadedFile + '&_nonce=<?php echo $nonce; ?>', |
|
| 3842 | 3842 | dataType: 'json', |
| 3843 | 3843 | cache: false, |
| 3844 | 3844 | success: function(data) {
|
@@ -3890,7 +3890,7 @@ discard block |
||
| 3890 | 3890 | |
| 3891 | 3891 | jQuery(cont).find('.filelist .file').remove();
|
| 3892 | 3892 | |
| 3893 | - jQuery('#gd-import-msg', cont).find('#message').removeClass('updated').addClass('error').html("<p><?php echo esc_attr( PLZ_SELECT_CSV_FILE );?></p>");
|
|
| 3893 | + jQuery('#gd-import-msg', cont).find('#message').removeClass('updated').addClass('error').html("<p><?php echo esc_attr(PLZ_SELECT_CSV_FILE); ?></p>");
|
|
| 3894 | 3894 | jQuery('#gd-import-msg', cont).show();
|
| 3895 | 3895 | |
| 3896 | 3896 | return false; |
@@ -3949,7 +3949,7 @@ discard block |
||
| 3949 | 3949 | jQuery.ajax({
|
| 3950 | 3950 | url: ajaxurl, |
| 3951 | 3951 | type: "POST", |
| 3952 | - data: 'action=geodir_import_export&task=import_' + type + '&_pt=' + type + '&_file=' + uploadedFile + gddata + '&_ch=' + choice + '&_nonce=<?php echo $nonce;?>', |
|
| 3952 | + data: 'action=geodir_import_export&task=import_' + type + '&_pt=' + type + '&_file=' + uploadedFile + gddata + '&_ch=' + choice + '&_nonce=<?php echo $nonce; ?>', |
|
| 3953 | 3953 | dataType : 'json', |
| 3954 | 3954 | cache: false, |
| 3955 | 3955 | success: function (data) {
|
@@ -4125,27 +4125,27 @@ discard block |
||
| 4125 | 4125 | |
| 4126 | 4126 | var gdMsg = '<p></p>'; |
| 4127 | 4127 | if ( processed > 0 ) {
|
| 4128 | - var msgParse = '<p><?php echo addslashes( sprintf( __( 'Total %s item(s) found.', 'geodirectory' ), '%s' ) );?></p>'; |
|
| 4128 | + var msgParse = '<p><?php echo addslashes(sprintf(__('Total %s item(s) found.', 'geodirectory'), '%s')); ?></p>';
|
|
| 4129 | 4129 | msgParse = msgParse.replace("%s", processed);
|
| 4130 | 4130 | gdMsg += msgParse; |
| 4131 | 4131 | } |
| 4132 | 4132 | |
| 4133 | 4133 | if ( updated > 0 ) {
|
| 4134 | - var msgParse = '<p><?php echo addslashes( sprintf( __( '%s / %s item(s) updated.', 'geodirectory' ), '%s', '%d' ) );?></p>'; |
|
| 4134 | + var msgParse = '<p><?php echo addslashes(sprintf(__('%s / %s item(s) updated.', 'geodirectory'), '%s', '%d')); ?></p>';
|
|
| 4135 | 4135 | msgParse = msgParse.replace("%s", updated);
|
| 4136 | 4136 | msgParse = msgParse.replace("%d", processed);
|
| 4137 | 4137 | gdMsg += msgParse; |
| 4138 | 4138 | } |
| 4139 | 4139 | |
| 4140 | 4140 | if ( created > 0 ) {
|
| 4141 | - var msgParse = '<p><?php echo addslashes( sprintf( __( '%s / %s item(s) added.', 'geodirectory' ), '%s', '%d' ) );?></p>'; |
|
| 4141 | + var msgParse = '<p><?php echo addslashes(sprintf(__('%s / %s item(s) added.', 'geodirectory'), '%s', '%d')); ?></p>';
|
|
| 4142 | 4142 | msgParse = msgParse.replace("%s", created);
|
| 4143 | 4143 | msgParse = msgParse.replace("%d", processed);
|
| 4144 | 4144 | gdMsg += msgParse; |
| 4145 | 4145 | } |
| 4146 | 4146 | |
| 4147 | 4147 | if ( skipped > 0 ) {
|
| 4148 | - var msgParse = '<p><?php echo addslashes( sprintf( __( '%s / %s item(s) ignored due to already exists.', 'geodirectory' ), '%s', '%d' ) );?></p>'; |
|
| 4148 | + var msgParse = '<p><?php echo addslashes(sprintf(__('%s / %s item(s) ignored due to already exists.', 'geodirectory'), '%s', '%d')); ?></p>';
|
|
| 4149 | 4149 | msgParse = msgParse.replace("%s", skipped);
|
| 4150 | 4150 | msgParse = msgParse.replace("%d", processed);
|
| 4151 | 4151 | gdMsg += msgParse; |
@@ -4155,21 +4155,21 @@ discard block |
||
| 4155 | 4155 | if (type=='loc') {
|
| 4156 | 4156 | invalid_addr = invalid; |
| 4157 | 4157 | } |
| 4158 | - var msgParse = '<p><?php echo addslashes( sprintf( __( '%s / %s item(s) could not be added due to blank/invalid address(city, region, country, latitude, longitude).', 'geodirectory' ), '%s', '%d' ) );?></p>'; |
|
| 4158 | + var msgParse = '<p><?php echo addslashes(sprintf(__('%s / %s item(s) could not be added due to blank/invalid address(city, region, country, latitude, longitude).', 'geodirectory'), '%s', '%d')); ?></p>';
|
|
| 4159 | 4159 | msgParse = msgParse.replace("%s", invalid_addr);
|
| 4160 | 4160 | msgParse = msgParse.replace("%d", total);
|
| 4161 | 4161 | gdMsg += msgParse; |
| 4162 | 4162 | } |
| 4163 | 4163 | |
| 4164 | 4164 | if (invalid > 0 && type!='loc') {
|
| 4165 | - var msgParse = '<p><?php echo addslashes( sprintf( __( '%s / %s item(s) could not be added due to blank title/invalid post type.', 'geodirectory' ), '%s', '%d' ) );?></p>'; |
|
| 4165 | + var msgParse = '<p><?php echo addslashes(sprintf(__('%s / %s item(s) could not be added due to blank title/invalid post type.', 'geodirectory'), '%s', '%d')); ?></p>';
|
|
| 4166 | 4166 | msgParse = msgParse.replace("%s", invalid);
|
| 4167 | 4167 | msgParse = msgParse.replace("%d", total);
|
| 4168 | 4168 | gdMsg += msgParse; |
| 4169 | 4169 | } |
| 4170 | 4170 | |
| 4171 | 4171 | if (images > 0) {
|
| 4172 | - gdMsg += '<p><?php echo addslashes( sprintf( CSV_TRANSFER_IMG_FOLDER, $uploads['subdir'] ) );?></p>'; |
|
| 4172 | + gdMsg += '<p><?php echo addslashes(sprintf(CSV_TRANSFER_IMG_FOLDER, $uploads['subdir'])); ?></p>'; |
|
| 4173 | 4173 | } |
| 4174 | 4174 | gdMsg += '<p></p>'; |
| 4175 | 4175 | jQuery('#gd-import-msg', cont).find('#message').removeClass('error').addClass('updated').html(gdMsg);
|
@@ -4318,7 +4318,7 @@ discard block |
||
| 4318 | 4318 | |
| 4319 | 4319 | function gd_process_export_posts(el, post_type, total_posts, chunk_size, pages, page) {
|
| 4320 | 4320 | if (page < 2) {
|
| 4321 | - gd_progressbar(el, 0, '0% (0 / ' + total_posts + ') <i class="fa fa-refresh fa-spin"></i><?php echo esc_attr( __( 'Exporting...', 'geodirectory' ) );?>'); |
|
| 4321 | + gd_progressbar(el, 0, '0% (0 / ' + total_posts + ') <i class="fa fa-refresh fa-spin"></i><?php echo esc_attr(__('Exporting...', 'geodirectory')); ?>');
|
|
| 4322 | 4322 | jQuery(el).find('#gd_timer').text('00:00:01');
|
| 4323 | 4323 | jQuery('#gd_ie_ex_files', el).html('');
|
| 4324 | 4324 | } |
@@ -4326,7 +4326,7 @@ discard block |
||
| 4326 | 4326 | jQuery.ajax({
|
| 4327 | 4327 | url: ajaxurl, |
| 4328 | 4328 | type: "POST", |
| 4329 | - data: 'action=geodir_import_export&task=export_posts&_pt=' + post_type + '&_n=' + chunk_size + '&_nonce=<?php echo $nonce;?>&_p=' + page, |
|
| 4329 | + data: 'action=geodir_import_export&task=export_posts&_pt=' + post_type + '&_n=' + chunk_size + '&_nonce=<?php echo $nonce; ?>&_p=' + page, |
|
| 4330 | 4330 | dataType : 'json', |
| 4331 | 4331 | cache: false, |
| 4332 | 4332 | beforeSend: function (jqXHR, settings) {},
|
@@ -4340,11 +4340,11 @@ discard block |
||
| 4340 | 4340 | } else {
|
| 4341 | 4341 | if (pages < page || pages == page) {
|
| 4342 | 4342 | window.clearInterval(timer_posts); |
| 4343 | - gd_progressbar(el, 100, '100% (' + total_posts + ' / ' + total_posts + ') <i class="fa fa-check"></i><?php echo esc_attr( __( 'Complete!', 'geodirectory' ) );?>');
|
|
| 4343 | + gd_progressbar(el, 100, '100% (' + total_posts + ' / ' + total_posts + ') <i class="fa fa-check"></i><?php echo esc_attr(__('Complete!', 'geodirectory')); ?>');
|
|
| 4344 | 4344 | } else {
|
| 4345 | 4345 | var percentage = Math.ceil(( page / pages ) * 100); |
| 4346 | 4346 | percentage = percentage > 100 ? 100 : percentage; |
| 4347 | - gd_progressbar(el, percentage, '' + percentage + '% (' + ( page * chunk_size ) + ' / ' + total_posts + ') <i class="fa fa-refresh fa-spin"></i><?php echo esc_attr( __( 'Exporting...', 'geodirectory' ) );?>');
|
|
| 4347 | + gd_progressbar(el, percentage, '' + percentage + '% (' + ( page * chunk_size ) + ' / ' + total_posts + ') <i class="fa fa-refresh fa-spin"></i><?php echo esc_attr(__('Exporting...', 'geodirectory')); ?>');
|
|
| 4348 | 4348 | } |
| 4349 | 4349 | if (typeof data.files != 'undefined' && jQuery(data.files).length ) {
|
| 4350 | 4350 | var obj_files = data.files; |
@@ -4374,7 +4374,7 @@ discard block |
||
| 4374 | 4374 | |
| 4375 | 4375 | function gd_process_export_cats(el, post_type, total_cats, chunk_size, pages, page) {
|
| 4376 | 4376 | if (page < 2) {
|
| 4377 | - gd_progressbar(el, 0, '0% (0 / ' + total_cats + ') <i class="fa fa-refresh fa-spin"></i><?php echo esc_attr( __( 'Exporting...', 'geodirectory' ) );?>'); |
|
| 4377 | + gd_progressbar(el, 0, '0% (0 / ' + total_cats + ') <i class="fa fa-refresh fa-spin"></i><?php echo esc_attr(__('Exporting...', 'geodirectory')); ?>');
|
|
| 4378 | 4378 | jQuery(el).find('#gd_timer').text('00:00:01');
|
| 4379 | 4379 | jQuery('#gd_ie_ex_files', el).html('');
|
| 4380 | 4380 | } |
@@ -4382,7 +4382,7 @@ discard block |
||
| 4382 | 4382 | jQuery.ajax({
|
| 4383 | 4383 | url: ajaxurl, |
| 4384 | 4384 | type: "POST", |
| 4385 | - data: 'action=geodir_import_export&task=export_cats&_pt=' + post_type + '&_n=' + chunk_size + '&_nonce=<?php echo $nonce;?>&_p=' + page, |
|
| 4385 | + data: 'action=geodir_import_export&task=export_cats&_pt=' + post_type + '&_n=' + chunk_size + '&_nonce=<?php echo $nonce; ?>&_p=' + page, |
|
| 4386 | 4386 | dataType : 'json', |
| 4387 | 4387 | cache: false, |
| 4388 | 4388 | beforeSend: function (jqXHR, settings) {},
|
@@ -4396,11 +4396,11 @@ discard block |
||
| 4396 | 4396 | } else {
|
| 4397 | 4397 | if (pages < page || pages == page) {
|
| 4398 | 4398 | window.clearInterval(timer_cats); |
| 4399 | - gd_progressbar(el, 100, '100% (' + total_cats + ' / ' + total_cats + ') <i class="fa fa-check"></i><?php echo esc_attr( __( 'Complete!', 'geodirectory' ) );?>');
|
|
| 4399 | + gd_progressbar(el, 100, '100% (' + total_cats + ' / ' + total_cats + ') <i class="fa fa-check"></i><?php echo esc_attr(__('Complete!', 'geodirectory')); ?>');
|
|
| 4400 | 4400 | } else {
|
| 4401 | 4401 | var percentage = Math.ceil(( page / pages ) * 100); |
| 4402 | 4402 | percentage = percentage > 100 ? 100 : percentage; |
| 4403 | - gd_progressbar(el, percentage, '' + percentage + '% (' + ( page * chunk_size ) + ' / ' + total_cats + ') <i class="fa fa-refresh fa-spin"></i><?php esc_attr_e( 'Exporting...', 'geodirectory' );?>');
|
|
| 4403 | + gd_progressbar(el, percentage, '' + percentage + '% (' + ( page * chunk_size ) + ' / ' + total_cats + ') <i class="fa fa-refresh fa-spin"></i><?php esc_attr_e('Exporting...', 'geodirectory'); ?>');
|
|
| 4404 | 4404 | } |
| 4405 | 4405 | if (typeof data.files != 'undefined' && jQuery(data.files).length ) {
|
| 4406 | 4406 | var obj_files = data.files; |
@@ -4457,8 +4457,8 @@ discard block |
||
| 4457 | 4457 | function geodir_init_filesystem() |
| 4458 | 4458 | {
|
| 4459 | 4459 | |
| 4460 | - if(!function_exists('get_filesystem_method')){
|
|
| 4461 | - require_once(ABSPATH."/wp-admin/includes/file.php"); |
|
| 4460 | + if (!function_exists('get_filesystem_method')) {
|
|
| 4461 | + require_once(ABSPATH . "/wp-admin/includes/file.php"); |
|
| 4462 | 4462 | } |
| 4463 | 4463 | $access_type = get_filesystem_method(); |
| 4464 | 4464 | if ($access_type === 'direct') {
|
@@ -4511,7 +4511,7 @@ discard block |
||
| 4511 | 4511 | * @package GeoDirectory |
| 4512 | 4512 | */ |
| 4513 | 4513 | function geodir_filesystem_notice() |
| 4514 | -{ if ( defined( 'DOING_AJAX' ) ){return;}
|
|
| 4514 | +{ if (defined('DOING_AJAX')) {return; }
|
|
| 4515 | 4515 | $access_type = get_filesystem_method(); |
| 4516 | 4516 | if ($access_type === 'direct') {
|
| 4517 | 4517 | } elseif (!defined('FTP_USER')) {
|
@@ -4546,18 +4546,18 @@ discard block |
||
| 4546 | 4546 | // try to set higher limits for import |
| 4547 | 4547 | $max_input_time = ini_get('max_input_time');
|
| 4548 | 4548 | $max_execution_time = ini_get('max_execution_time');
|
| 4549 | - $memory_limit= ini_get('memory_limit');
|
|
| 4549 | + $memory_limit = ini_get('memory_limit');
|
|
| 4550 | 4550 | |
| 4551 | - if(!$max_input_time || $max_input_time<3000){
|
|
| 4551 | + if (!$max_input_time || $max_input_time < 3000) {
|
|
| 4552 | 4552 | @ini_set('max_input_time', 3000);
|
| 4553 | 4553 | } |
| 4554 | 4554 | |
| 4555 | - if(!$max_execution_time || $max_execution_time<3000){
|
|
| 4555 | + if (!$max_execution_time || $max_execution_time < 3000) {
|
|
| 4556 | 4556 | @ini_set('max_execution_time', 3000);
|
| 4557 | 4557 | } |
| 4558 | 4558 | |
| 4559 | - if($memory_limit && str_replace('M','',$memory_limit)){
|
|
| 4560 | - if(str_replace('M','',$memory_limit)<256){
|
|
| 4559 | + if ($memory_limit && str_replace('M', '', $memory_limit)) {
|
|
| 4560 | + if (str_replace('M', '', $memory_limit) < 256) {
|
|
| 4561 | 4561 | @ini_set('memory_limit', '256M');
|
| 4562 | 4562 | } |
| 4563 | 4563 | } |
@@ -4566,43 +4566,43 @@ discard block |
||
| 4566 | 4566 | |
| 4567 | 4567 | $json = array(); |
| 4568 | 4568 | |
| 4569 | - if ( !current_user_can( 'manage_options' ) ) {
|
|
| 4570 | - wp_send_json( $json ); |
|
| 4569 | + if (!current_user_can('manage_options')) {
|
|
| 4570 | + wp_send_json($json); |
|
| 4571 | 4571 | } |
| 4572 | 4572 | |
| 4573 | - $task = isset( $_REQUEST['task'] ) ? $_REQUEST['task'] : NULL; |
|
| 4574 | - $nonce = isset( $_REQUEST['_nonce'] ) ? $_REQUEST['_nonce'] : NULL; |
|
| 4575 | - $stat = isset( $_REQUEST['_st'] ) ? $_REQUEST['_st'] : false; |
|
| 4573 | + $task = isset($_REQUEST['task']) ? $_REQUEST['task'] : NULL; |
|
| 4574 | + $nonce = isset($_REQUEST['_nonce']) ? $_REQUEST['_nonce'] : NULL; |
|
| 4575 | + $stat = isset($_REQUEST['_st']) ? $_REQUEST['_st'] : false; |
|
| 4576 | 4576 | |
| 4577 | - if ( !wp_verify_nonce( $nonce, 'geodir_import_export_nonce' ) ) {
|
|
| 4578 | - wp_send_json( $json ); |
|
| 4577 | + if (!wp_verify_nonce($nonce, 'geodir_import_export_nonce')) {
|
|
| 4578 | + wp_send_json($json); |
|
| 4579 | 4579 | } |
| 4580 | 4580 | |
| 4581 | - $post_type = isset( $_REQUEST['_pt'] ) ? $_REQUEST['_pt'] : NULL; |
|
| 4582 | - $chunk_per_page = isset( $_REQUEST['_n'] ) ? absint($_REQUEST['_n']) : NULL; |
|
| 4581 | + $post_type = isset($_REQUEST['_pt']) ? $_REQUEST['_pt'] : NULL; |
|
| 4582 | + $chunk_per_page = isset($_REQUEST['_n']) ? absint($_REQUEST['_n']) : NULL; |
|
| 4583 | 4583 | $chunk_per_page = $chunk_per_page < 50 || $chunk_per_page > 100000 ? 5000 : $chunk_per_page; |
| 4584 | - $chunk_page_no = isset( $_REQUEST['_p'] ) ? absint($_REQUEST['_p']) : 1; |
|
| 4584 | + $chunk_page_no = isset($_REQUEST['_p']) ? absint($_REQUEST['_p']) : 1; |
|
| 4585 | 4585 | |
| 4586 | 4586 | $wp_filesystem = geodir_init_filesystem(); |
| 4587 | 4587 | if (!$wp_filesystem) {
|
| 4588 | - $json['error'] = __( 'Filesystem ERROR: Could not access filesystem.', 'geodirectory' ); |
|
| 4589 | - wp_send_json( $json ); |
|
| 4588 | + $json['error'] = __('Filesystem ERROR: Could not access filesystem.', 'geodirectory');
|
|
| 4589 | + wp_send_json($json); |
|
| 4590 | 4590 | } |
| 4591 | 4591 | |
| 4592 | 4592 | if (!empty($wp_filesystem) && isset($wp_filesystem->errors) && is_wp_error($wp_filesystem->errors) && $wp_filesystem->errors->get_error_code()) {
|
| 4593 | - $json['error'] = __( 'Filesystem ERROR: ' . $wp_filesystem->errors->get_error_message(), 'geodirectory' ); |
|
| 4594 | - wp_send_json( $json ); |
|
| 4593 | + $json['error'] = __('Filesystem ERROR: ' . $wp_filesystem->errors->get_error_message(), 'geodirectory');
|
|
| 4594 | + wp_send_json($json); |
|
| 4595 | 4595 | } |
| 4596 | 4596 | |
| 4597 | - $csv_file_dir = geodir_path_import_export( false ); |
|
| 4598 | - if ( !$wp_filesystem->is_dir( $csv_file_dir ) ) {
|
|
| 4599 | - if ( !$wp_filesystem->mkdir( $csv_file_dir, FS_CHMOD_DIR ) ) {
|
|
| 4600 | - $json['error'] = __( 'ERROR: Could not create cache directory. This is usually due to inconsistent file permissions.', 'geodirectory' ); |
|
| 4601 | - wp_send_json( $json ); |
|
| 4597 | + $csv_file_dir = geodir_path_import_export(false); |
|
| 4598 | + if (!$wp_filesystem->is_dir($csv_file_dir)) {
|
|
| 4599 | + if (!$wp_filesystem->mkdir($csv_file_dir, FS_CHMOD_DIR)) {
|
|
| 4600 | + $json['error'] = __('ERROR: Could not create cache directory. This is usually due to inconsistent file permissions.', 'geodirectory');
|
|
| 4601 | + wp_send_json($json); |
|
| 4602 | 4602 | } |
| 4603 | 4603 | } |
| 4604 | 4604 | |
| 4605 | - switch ( $task ) {
|
|
| 4605 | + switch ($task) {
|
|
| 4606 | 4606 | case 'export_posts': {
|
| 4607 | 4607 | // WPML |
| 4608 | 4608 | $is_wpml = geodir_is_wpml(); |
@@ -4613,12 +4613,12 @@ discard block |
||
| 4613 | 4613 | $sitepress->switch_lang('all', true);
|
| 4614 | 4614 | } |
| 4615 | 4615 | // WPML |
| 4616 | - if ( $post_type == 'gd_event' ) {
|
|
| 4616 | + if ($post_type == 'gd_event') {
|
|
| 4617 | 4617 | //add_filter( 'geodir_imex_count_posts', 'geodir_imex_count_events', 10, 2 ); |
| 4618 | - add_filter( 'geodir_imex_export_posts_query', 'geodir_imex_get_events_query', 10, 2 ); |
|
| 4618 | + add_filter('geodir_imex_export_posts_query', 'geodir_imex_get_events_query', 10, 2);
|
|
| 4619 | 4619 | } |
| 4620 | - $file_name = $post_type . '_' . date( 'dmyHi' ); |
|
| 4621 | - $posts_count = geodir_get_posts_count( $post_type ); |
|
| 4620 | + $file_name = $post_type . '_' . date('dmyHi');
|
|
| 4621 | + $posts_count = geodir_get_posts_count($post_type); |
|
| 4622 | 4622 | $file_url_base = geodir_path_import_export() . '/'; |
| 4623 | 4623 | $file_url = $file_url_base . $file_name . '.csv'; |
| 4624 | 4624 | $file_path = $csv_file_dir . '/' . $file_name . '.csv'; |
@@ -4626,10 +4626,10 @@ discard block |
||
| 4626 | 4626 | |
| 4627 | 4627 | $chunk_file_paths = array(); |
| 4628 | 4628 | |
| 4629 | - if ( isset( $_REQUEST['_st'] ) ) {
|
|
| 4630 | - $line_count = (int)geodir_import_export_line_count( $file_path_temp ); |
|
| 4631 | - $percentage = count( $posts_count ) > 0 && $line_count > 0 ? ceil( $line_count / $posts_count ) * 100 : 0; |
|
| 4632 | - $percentage = min( $percentage, 100 ); |
|
| 4629 | + if (isset($_REQUEST['_st'])) {
|
|
| 4630 | + $line_count = (int) geodir_import_export_line_count($file_path_temp); |
|
| 4631 | + $percentage = count($posts_count) > 0 && $line_count > 0 ? ceil($line_count / $posts_count) * 100 : 0; |
|
| 4632 | + $percentage = min($percentage, 100); |
|
| 4633 | 4633 | |
| 4634 | 4634 | $json['percentage'] = $percentage; |
| 4635 | 4635 | // WPML |
@@ -4637,49 +4637,49 @@ discard block |
||
| 4637 | 4637 | $sitepress->switch_lang($active_lang, true); |
| 4638 | 4638 | } |
| 4639 | 4639 | // WPML |
| 4640 | - wp_send_json( $json ); |
|
| 4640 | + wp_send_json($json); |
|
| 4641 | 4641 | exit; |
| 4642 | 4642 | } else {
|
| 4643 | - if ( !$posts_count > 0 ) {
|
|
| 4644 | - $json['error'] = __( 'No records to export.', 'geodirectory' ); |
|
| 4643 | + if (!$posts_count > 0) {
|
|
| 4644 | + $json['error'] = __('No records to export.', 'geodirectory');
|
|
| 4645 | 4645 | } else {
|
| 4646 | 4646 | $total_posts = $posts_count; |
| 4647 | 4647 | if ($chunk_per_page > $total_posts) {
|
| 4648 | 4648 | $chunk_per_page = $total_posts; |
| 4649 | 4649 | } |
| 4650 | - $chunk_total_pages = ceil( $total_posts / $chunk_per_page ); |
|
| 4650 | + $chunk_total_pages = ceil($total_posts / $chunk_per_page); |
|
| 4651 | 4651 | |
| 4652 | 4652 | $j = $chunk_page_no; |
| 4653 | - $chunk_save_posts = geodir_imex_get_posts( $post_type, $chunk_per_page, $j ); |
|
| 4653 | + $chunk_save_posts = geodir_imex_get_posts($post_type, $chunk_per_page, $j); |
|
| 4654 | 4654 | |
| 4655 | 4655 | $per_page = 500; |
| 4656 | 4656 | if ($per_page > $chunk_per_page) {
|
| 4657 | 4657 | $per_page = $chunk_per_page; |
| 4658 | 4658 | } |
| 4659 | - $total_pages = ceil( $chunk_per_page / $per_page ); |
|
| 4659 | + $total_pages = ceil($chunk_per_page / $per_page); |
|
| 4660 | 4660 | |
| 4661 | - for ( $i = 0; $i <= $total_pages; $i++ ) {
|
|
| 4662 | - $save_posts = array_slice( $chunk_save_posts , ( $i * $per_page ), $per_page ); |
|
| 4661 | + for ($i = 0; $i <= $total_pages; $i++) {
|
|
| 4662 | + $save_posts = array_slice($chunk_save_posts, ($i * $per_page), $per_page); |
|
| 4663 | 4663 | |
| 4664 | 4664 | $clear = $i == 0 ? true : false; |
| 4665 | - geodir_save_csv_data( $file_path_temp, $save_posts, $clear ); |
|
| 4665 | + geodir_save_csv_data($file_path_temp, $save_posts, $clear); |
|
| 4666 | 4666 | } |
| 4667 | 4667 | |
| 4668 | - if ( $wp_filesystem->exists( $file_path_temp ) ) {
|
|
| 4668 | + if ($wp_filesystem->exists($file_path_temp)) {
|
|
| 4669 | 4669 | $chunk_page_no = $chunk_total_pages > 1 ? '-' . $j : ''; |
| 4670 | 4670 | $chunk_file_name = $file_name . $chunk_page_no . '.csv'; |
| 4671 | 4671 | $file_path = $csv_file_dir . '/' . $chunk_file_name; |
| 4672 | - $wp_filesystem->move( $file_path_temp, $file_path, true ); |
|
| 4672 | + $wp_filesystem->move($file_path_temp, $file_path, true); |
|
| 4673 | 4673 | |
| 4674 | 4674 | $file_url = $file_url_base . $chunk_file_name; |
| 4675 | 4675 | $chunk_file_paths[] = array('i' => $j . '.', 'u' => $file_url, 's' => size_format(filesize($file_path), 2));
|
| 4676 | 4676 | } |
| 4677 | 4677 | |
| 4678 | - if ( !empty($chunk_file_paths) ) {
|
|
| 4678 | + if (!empty($chunk_file_paths)) {
|
|
| 4679 | 4679 | $json['total'] = $posts_count; |
| 4680 | 4680 | $json['files'] = $chunk_file_paths; |
| 4681 | 4681 | } else {
|
| 4682 | - $json['error'] = __( 'ERROR: Could not create csv file. This is usually due to inconsistent file permissions.', 'geodirectory' ); |
|
| 4682 | + $json['error'] = __('ERROR: Could not create csv file. This is usually due to inconsistent file permissions.', 'geodirectory');
|
|
| 4683 | 4683 | } |
| 4684 | 4684 | } |
| 4685 | 4685 | // WPML |
@@ -4687,7 +4687,7 @@ discard block |
||
| 4687 | 4687 | $sitepress->switch_lang($active_lang, true); |
| 4688 | 4688 | } |
| 4689 | 4689 | // WPML |
| 4690 | - wp_send_json( $json ); |
|
| 4690 | + wp_send_json($json); |
|
| 4691 | 4691 | } |
| 4692 | 4692 | } |
| 4693 | 4693 | break; |
@@ -4701,9 +4701,9 @@ discard block |
||
| 4701 | 4701 | $sitepress->switch_lang('all', true);
|
| 4702 | 4702 | } |
| 4703 | 4703 | // WPML |
| 4704 | - $file_name = $post_type . 'category_' . date( 'dmyHi' ); |
|
| 4704 | + $file_name = $post_type . 'category_' . date('dmyHi');
|
|
| 4705 | 4705 | |
| 4706 | - $terms_count = geodir_get_terms_count( $post_type ); |
|
| 4706 | + $terms_count = geodir_get_terms_count($post_type); |
|
| 4707 | 4707 | $file_url_base = geodir_path_import_export() . '/'; |
| 4708 | 4708 | $file_url = $file_url_base . $file_name . '.csv'; |
| 4709 | 4709 | $file_path = $csv_file_dir . '/' . $file_name . '.csv'; |
@@ -4711,10 +4711,10 @@ discard block |
||
| 4711 | 4711 | |
| 4712 | 4712 | $chunk_file_paths = array(); |
| 4713 | 4713 | |
| 4714 | - if ( isset( $_REQUEST['_st'] ) ) {
|
|
| 4715 | - $line_count = (int)geodir_import_export_line_count( $file_path_temp ); |
|
| 4716 | - $percentage = count( $terms_count ) > 0 && $line_count > 0 ? ceil( $line_count / $terms_count ) * 100 : 0; |
|
| 4717 | - $percentage = min( $percentage, 100 ); |
|
| 4714 | + if (isset($_REQUEST['_st'])) {
|
|
| 4715 | + $line_count = (int) geodir_import_export_line_count($file_path_temp); |
|
| 4716 | + $percentage = count($terms_count) > 0 && $line_count > 0 ? ceil($line_count / $terms_count) * 100 : 0; |
|
| 4717 | + $percentage = min($percentage, 100); |
|
| 4718 | 4718 | |
| 4719 | 4719 | $json['percentage'] = $percentage; |
| 4720 | 4720 | // WPML |
@@ -4722,48 +4722,48 @@ discard block |
||
| 4722 | 4722 | $sitepress->switch_lang($active_lang, true); |
| 4723 | 4723 | } |
| 4724 | 4724 | // WPML |
| 4725 | - wp_send_json( $json ); |
|
| 4725 | + wp_send_json($json); |
|
| 4726 | 4726 | } else {
|
| 4727 | - if ( !$terms_count > 0 ) {
|
|
| 4728 | - $json['error'] = __( 'No records to export.', 'geodirectory' ); |
|
| 4727 | + if (!$terms_count > 0) {
|
|
| 4728 | + $json['error'] = __('No records to export.', 'geodirectory');
|
|
| 4729 | 4729 | } else {
|
| 4730 | 4730 | $total_terms = $terms_count; |
| 4731 | 4731 | if ($chunk_per_page > $terms_count) {
|
| 4732 | 4732 | $chunk_per_page = $terms_count; |
| 4733 | 4733 | } |
| 4734 | - $chunk_total_pages = ceil( $total_terms / $chunk_per_page ); |
|
| 4734 | + $chunk_total_pages = ceil($total_terms / $chunk_per_page); |
|
| 4735 | 4735 | |
| 4736 | 4736 | $j = $chunk_page_no; |
| 4737 | - $chunk_save_terms = geodir_imex_get_terms( $post_type, $chunk_per_page, $j ); |
|
| 4737 | + $chunk_save_terms = geodir_imex_get_terms($post_type, $chunk_per_page, $j); |
|
| 4738 | 4738 | |
| 4739 | 4739 | $per_page = 500; |
| 4740 | 4740 | if ($per_page > $chunk_per_page) {
|
| 4741 | 4741 | $per_page = $chunk_per_page; |
| 4742 | 4742 | } |
| 4743 | - $total_pages = ceil( $chunk_per_page / $per_page ); |
|
| 4743 | + $total_pages = ceil($chunk_per_page / $per_page); |
|
| 4744 | 4744 | |
| 4745 | - for ( $i = 0; $i <= $total_pages; $i++ ) {
|
|
| 4746 | - $save_terms = array_slice( $chunk_save_terms , ( $i * $per_page ), $per_page ); |
|
| 4745 | + for ($i = 0; $i <= $total_pages; $i++) {
|
|
| 4746 | + $save_terms = array_slice($chunk_save_terms, ($i * $per_page), $per_page); |
|
| 4747 | 4747 | |
| 4748 | 4748 | $clear = $i == 0 ? true : false; |
| 4749 | - geodir_save_csv_data( $file_path_temp, $save_terms, $clear ); |
|
| 4749 | + geodir_save_csv_data($file_path_temp, $save_terms, $clear); |
|
| 4750 | 4750 | } |
| 4751 | 4751 | |
| 4752 | - if ( $wp_filesystem->exists( $file_path_temp ) ) {
|
|
| 4752 | + if ($wp_filesystem->exists($file_path_temp)) {
|
|
| 4753 | 4753 | $chunk_page_no = $chunk_total_pages > 1 ? '-' . $j : ''; |
| 4754 | 4754 | $chunk_file_name = $file_name . $chunk_page_no . '.csv'; |
| 4755 | 4755 | $file_path = $csv_file_dir . '/' . $chunk_file_name; |
| 4756 | - $wp_filesystem->move( $file_path_temp, $file_path, true ); |
|
| 4756 | + $wp_filesystem->move($file_path_temp, $file_path, true); |
|
| 4757 | 4757 | |
| 4758 | 4758 | $file_url = $file_url_base . $chunk_file_name; |
| 4759 | 4759 | $chunk_file_paths[] = array('i' => $j . '.', 'u' => $file_url, 's' => size_format(filesize($file_path), 2));
|
| 4760 | 4760 | } |
| 4761 | 4761 | |
| 4762 | - if ( !empty($chunk_file_paths) ) {
|
|
| 4762 | + if (!empty($chunk_file_paths)) {
|
|
| 4763 | 4763 | $json['total'] = $terms_count; |
| 4764 | 4764 | $json['files'] = $chunk_file_paths; |
| 4765 | 4765 | } else {
|
| 4766 | - $json['error'] = __( 'ERROR: Could not create csv file. This is usually due to inconsistent file permissions.', 'geodirectory' ); |
|
| 4766 | + $json['error'] = __('ERROR: Could not create csv file. This is usually due to inconsistent file permissions.', 'geodirectory');
|
|
| 4767 | 4767 | } |
| 4768 | 4768 | } |
| 4769 | 4769 | // WPML |
@@ -4771,67 +4771,67 @@ discard block |
||
| 4771 | 4771 | $sitepress->switch_lang($active_lang, true); |
| 4772 | 4772 | } |
| 4773 | 4773 | // WPML |
| 4774 | - wp_send_json( $json ); |
|
| 4774 | + wp_send_json($json); |
|
| 4775 | 4775 | } |
| 4776 | 4776 | } |
| 4777 | 4777 | break; |
| 4778 | 4778 | case 'export_locations': {
|
| 4779 | 4779 | $file_url_base = geodir_path_import_export() . '/'; |
| 4780 | - $file_name = 'gd_locations_' . date( 'dmyHi' ); |
|
| 4780 | + $file_name = 'gd_locations_' . date('dmyHi');
|
|
| 4781 | 4781 | $file_url = $file_url_base . $file_name . '.csv'; |
| 4782 | 4782 | $file_path = $csv_file_dir . '/' . $file_name . '.csv'; |
| 4783 | 4783 | $file_path_temp = $csv_file_dir . '/gd_locations_' . $nonce . '.csv'; |
| 4784 | 4784 | |
| 4785 | - $items_count = (int)geodir_location_imex_count_locations(); |
|
| 4785 | + $items_count = (int) geodir_location_imex_count_locations(); |
|
| 4786 | 4786 | |
| 4787 | - if ( isset( $_REQUEST['_st'] ) ) {
|
|
| 4788 | - $line_count = (int)geodir_import_export_line_count( $file_path_temp ); |
|
| 4789 | - $percentage = count( $items_count ) > 0 && $line_count > 0 ? ceil( $line_count / $items_count ) * 100 : 0; |
|
| 4790 | - $percentage = min( $percentage, 100 ); |
|
| 4787 | + if (isset($_REQUEST['_st'])) {
|
|
| 4788 | + $line_count = (int) geodir_import_export_line_count($file_path_temp); |
|
| 4789 | + $percentage = count($items_count) > 0 && $line_count > 0 ? ceil($line_count / $items_count) * 100 : 0; |
|
| 4790 | + $percentage = min($percentage, 100); |
|
| 4791 | 4791 | |
| 4792 | 4792 | $json['percentage'] = $percentage; |
| 4793 | - wp_send_json( $json ); |
|
| 4793 | + wp_send_json($json); |
|
| 4794 | 4794 | } else {
|
| 4795 | 4795 | $chunk_file_paths = array(); |
| 4796 | 4796 | |
| 4797 | - if ( !$items_count > 0 ) {
|
|
| 4798 | - $json['error'] = __( 'No records to export.', 'geodirectory' ); |
|
| 4797 | + if (!$items_count > 0) {
|
|
| 4798 | + $json['error'] = __('No records to export.', 'geodirectory');
|
|
| 4799 | 4799 | } else {
|
| 4800 | - $chunk_per_page = min( $chunk_per_page, $items_count ); |
|
| 4801 | - $chunk_total_pages = ceil( $items_count / $chunk_per_page ); |
|
| 4800 | + $chunk_per_page = min($chunk_per_page, $items_count); |
|
| 4801 | + $chunk_total_pages = ceil($items_count / $chunk_per_page); |
|
| 4802 | 4802 | |
| 4803 | 4803 | $j = $chunk_page_no; |
| 4804 | - $chunk_save_items = geodir_location_imex_locations_data( $chunk_per_page, $j ); |
|
| 4804 | + $chunk_save_items = geodir_location_imex_locations_data($chunk_per_page, $j); |
|
| 4805 | 4805 | |
| 4806 | 4806 | $per_page = 500; |
| 4807 | - $per_page = min( $per_page, $chunk_per_page ); |
|
| 4808 | - $total_pages = ceil( $chunk_per_page / $per_page ); |
|
| 4807 | + $per_page = min($per_page, $chunk_per_page); |
|
| 4808 | + $total_pages = ceil($chunk_per_page / $per_page); |
|
| 4809 | 4809 | |
| 4810 | - for ( $i = 0; $i <= $total_pages; $i++ ) {
|
|
| 4811 | - $save_items = array_slice( $chunk_save_items , ( $i * $per_page ), $per_page ); |
|
| 4810 | + for ($i = 0; $i <= $total_pages; $i++) {
|
|
| 4811 | + $save_items = array_slice($chunk_save_items, ($i * $per_page), $per_page); |
|
| 4812 | 4812 | |
| 4813 | 4813 | $clear = $i == 0 ? true : false; |
| 4814 | - geodir_save_csv_data( $file_path_temp, $save_items, $clear ); |
|
| 4814 | + geodir_save_csv_data($file_path_temp, $save_items, $clear); |
|
| 4815 | 4815 | } |
| 4816 | 4816 | |
| 4817 | - if ( $wp_filesystem->exists( $file_path_temp ) ) {
|
|
| 4817 | + if ($wp_filesystem->exists($file_path_temp)) {
|
|
| 4818 | 4818 | $chunk_page_no = $chunk_total_pages > 1 ? '-' . $j : ''; |
| 4819 | 4819 | $chunk_file_name = $file_name . $chunk_page_no . '.csv'; |
| 4820 | 4820 | $file_path = $csv_file_dir . '/' . $chunk_file_name; |
| 4821 | - $wp_filesystem->move( $file_path_temp, $file_path, true ); |
|
| 4821 | + $wp_filesystem->move($file_path_temp, $file_path, true); |
|
| 4822 | 4822 | |
| 4823 | 4823 | $file_url = $file_url_base . $chunk_file_name; |
| 4824 | 4824 | $chunk_file_paths[] = array('i' => $j . '.', 'u' => $file_url, 's' => size_format(filesize($file_path), 2));
|
| 4825 | 4825 | } |
| 4826 | 4826 | |
| 4827 | - if ( !empty($chunk_file_paths) ) {
|
|
| 4827 | + if (!empty($chunk_file_paths)) {
|
|
| 4828 | 4828 | $json['total'] = $items_count; |
| 4829 | 4829 | $json['files'] = $chunk_file_paths; |
| 4830 | 4830 | } else {
|
| 4831 | - $json['error'] = __( 'Fail, something wrong to create csv file.', 'geodirectory' ); |
|
| 4831 | + $json['error'] = __('Fail, something wrong to create csv file.', 'geodirectory');
|
|
| 4832 | 4832 | } |
| 4833 | 4833 | } |
| 4834 | - wp_send_json( $json ); |
|
| 4834 | + wp_send_json($json); |
|
| 4835 | 4835 | } |
| 4836 | 4836 | } |
| 4837 | 4837 | break; |
@@ -4847,32 +4847,32 @@ discard block |
||
| 4847 | 4847 | } |
| 4848 | 4848 | // WPML |
| 4849 | 4849 | |
| 4850 | - ini_set( 'auto_detect_line_endings', true ); |
|
| 4850 | + ini_set('auto_detect_line_endings', true);
|
|
| 4851 | 4851 | |
| 4852 | 4852 | $uploads = wp_upload_dir(); |
| 4853 | 4853 | $uploads_dir = $uploads['path']; |
| 4854 | 4854 | $uploads_subdir = $uploads['subdir']; |
| 4855 | 4855 | |
| 4856 | - $csv_file = isset( $_POST['_file'] ) ? $_POST['_file'] : NULL; |
|
| 4857 | - $import_choice = isset( $_REQUEST['_ch'] ) ? $_REQUEST['_ch'] : 'skip'; |
|
| 4856 | + $csv_file = isset($_POST['_file']) ? $_POST['_file'] : NULL; |
|
| 4857 | + $import_choice = isset($_REQUEST['_ch']) ? $_REQUEST['_ch'] : 'skip'; |
|
| 4858 | 4858 | |
| 4859 | - $csv_file_arr = explode( '/', $csv_file ); |
|
| 4860 | - $csv_filename = end( $csv_file_arr ); |
|
| 4859 | + $csv_file_arr = explode('/', $csv_file);
|
|
| 4860 | + $csv_filename = end($csv_file_arr); |
|
| 4861 | 4861 | $target_path = $uploads_dir . '/temp_' . $current_user->data->ID . '/' . $csv_filename; |
| 4862 | 4862 | |
| 4863 | 4863 | $json['file'] = $csv_file; |
| 4864 | - $json['error'] = __( 'The uploaded file is not a valid csv file. Please try again.', 'geodirectory' ); |
|
| 4864 | + $json['error'] = __('The uploaded file is not a valid csv file. Please try again.', 'geodirectory');
|
|
| 4865 | 4865 | |
| 4866 | - if ( $csv_file && $wp_filesystem->is_file( $target_path ) && $wp_filesystem->exists( $target_path ) ) {
|
|
| 4867 | - $wp_filetype = wp_check_filetype_and_ext( $target_path, $csv_filename ); |
|
| 4866 | + if ($csv_file && $wp_filesystem->is_file($target_path) && $wp_filesystem->exists($target_path)) {
|
|
| 4867 | + $wp_filetype = wp_check_filetype_and_ext($target_path, $csv_filename); |
|
| 4868 | 4868 | |
| 4869 | 4869 | if (!empty($wp_filetype) && isset($wp_filetype['ext']) && geodir_strtolower($wp_filetype['ext']) == 'csv') {
|
| 4870 | 4870 | $json['error'] = NULL; |
| 4871 | 4871 | $json['rows'] = 0; |
| 4872 | 4872 | |
| 4873 | - if ( ( $handle = fopen($target_path, "r" ) ) !== FALSE ) {
|
|
| 4874 | - while ( ( $data = fgetcsv( $handle, 100000, "," ) ) !== FALSE ) {
|
|
| 4875 | - if ( !empty( $data ) ) {
|
|
| 4873 | + if (($handle = fopen($target_path, "r")) !== FALSE) {
|
|
| 4874 | + while (($data = fgetcsv($handle, 100000, ",")) !== FALSE) {
|
|
| 4875 | + if (!empty($data)) {
|
|
| 4876 | 4876 | $file[] = $data; |
| 4877 | 4877 | } |
| 4878 | 4878 | } |
@@ -4885,19 +4885,19 @@ discard block |
||
| 4885 | 4885 | $json['error'] = __('No data found in csv file.', 'geodirectory');
|
| 4886 | 4886 | } |
| 4887 | 4887 | } else {
|
| 4888 | - wp_send_json( $json ); |
|
| 4888 | + wp_send_json($json); |
|
| 4889 | 4889 | } |
| 4890 | 4890 | } else {
|
| 4891 | - wp_send_json( $json ); |
|
| 4891 | + wp_send_json($json); |
|
| 4892 | 4892 | } |
| 4893 | 4893 | |
| 4894 | - if ( $task == 'prepare_import' || !empty( $json['error'] ) ) {
|
|
| 4895 | - wp_send_json( $json ); |
|
| 4894 | + if ($task == 'prepare_import' || !empty($json['error'])) {
|
|
| 4895 | + wp_send_json($json); |
|
| 4896 | 4896 | } |
| 4897 | 4897 | |
| 4898 | 4898 | $total = $json['rows']; |
| 4899 | - $limit = isset($_POST['limit']) ? (int)$_POST['limit'] : 1; |
|
| 4900 | - $processed = isset($_POST['processed']) ? (int)$_POST['processed'] : 0; |
|
| 4899 | + $limit = isset($_POST['limit']) ? (int) $_POST['limit'] : 1; |
|
| 4900 | + $processed = isset($_POST['processed']) ? (int) $_POST['processed'] : 0; |
|
| 4901 | 4901 | |
| 4902 | 4902 | $count = $limit; |
| 4903 | 4903 | $requested_limit = $limit; |
@@ -4926,13 +4926,13 @@ discard block |
||
| 4926 | 4926 | |
| 4927 | 4927 | $post_types = geodir_get_posttypes(); |
| 4928 | 4928 | |
| 4929 | - if ( $task == 'import_cat' ) {
|
|
| 4929 | + if ($task == 'import_cat') {
|
|
| 4930 | 4930 | if (!empty($file)) {
|
| 4931 | 4931 | $columns = isset($file[0]) ? $file[0] : NULL; |
| 4932 | 4932 | |
| 4933 | 4933 | if (empty($columns) || (!empty($columns) && $columns[0] == '')) {
|
| 4934 | 4934 | $json['error'] = CSV_INVAILD_FILE; |
| 4935 | - wp_send_json( $json ); |
|
| 4935 | + wp_send_json($json); |
|
| 4936 | 4936 | exit; |
| 4937 | 4937 | } |
| 4938 | 4938 | |
@@ -4941,7 +4941,7 @@ discard block |
||
| 4941 | 4941 | |
| 4942 | 4942 | if (isset($file[$index])) {
|
| 4943 | 4943 | $row = $file[$index]; |
| 4944 | - $row = array_map( 'trim', $row ); |
|
| 4944 | + $row = array_map('trim', $row);
|
|
| 4945 | 4945 | //$row = array_map( 'utf8_encode', $row ); |
| 4946 | 4946 | |
| 4947 | 4947 | $cat_id = ''; |
@@ -4957,26 +4957,26 @@ discard block |
||
| 4957 | 4957 | $cat_language = ''; |
| 4958 | 4958 | |
| 4959 | 4959 | $c = 0; |
| 4960 | - foreach ($columns as $column ) {
|
|
| 4961 | - if ( $column == 'cat_id' ) {
|
|
| 4962 | - $cat_id = (int)$row[$c]; |
|
| 4963 | - } else if ( $column == 'cat_name' ) {
|
|
| 4960 | + foreach ($columns as $column) {
|
|
| 4961 | + if ($column == 'cat_id') {
|
|
| 4962 | + $cat_id = (int) $row[$c]; |
|
| 4963 | + } else if ($column == 'cat_name') {
|
|
| 4964 | 4964 | $cat_name = $row[$c]; |
| 4965 | - } else if ( $column == 'cat_slug' ) {
|
|
| 4965 | + } else if ($column == 'cat_slug') {
|
|
| 4966 | 4966 | $cat_slug = $row[$c]; |
| 4967 | - } else if ( $column == 'cat_posttype' ) {
|
|
| 4967 | + } else if ($column == 'cat_posttype') {
|
|
| 4968 | 4968 | $cat_posttype = $row[$c]; |
| 4969 | - } else if ( $column == 'cat_parent' ) {
|
|
| 4969 | + } else if ($column == 'cat_parent') {
|
|
| 4970 | 4970 | $cat_parent = trim($row[$c]); |
| 4971 | - } else if ( $column == 'cat_schema' && $row[$c] != '' ) {
|
|
| 4971 | + } else if ($column == 'cat_schema' && $row[$c] != '') {
|
|
| 4972 | 4972 | $cat_schema = $row[$c]; |
| 4973 | - } else if ( $column == 'cat_description' ) {
|
|
| 4973 | + } else if ($column == 'cat_description') {
|
|
| 4974 | 4974 | $cat_description = $row[$c]; |
| 4975 | - } else if ( $column == 'cat_top_description' ) {
|
|
| 4975 | + } else if ($column == 'cat_top_description') {
|
|
| 4976 | 4976 | $cat_top_description = $row[$c]; |
| 4977 | - } else if ( $column == 'cat_image' ) {
|
|
| 4977 | + } else if ($column == 'cat_image') {
|
|
| 4978 | 4978 | $cat_image = $row[$c]; |
| 4979 | - } else if ( $column == 'cat_icon' ) {
|
|
| 4979 | + } else if ($column == 'cat_icon') {
|
|
| 4980 | 4980 | $cat_icon = $row[$c]; |
| 4981 | 4981 | } |
| 4982 | 4982 | // WPML |
@@ -4987,7 +4987,7 @@ discard block |
||
| 4987 | 4987 | $c++; |
| 4988 | 4988 | } |
| 4989 | 4989 | |
| 4990 | - if ( $cat_name == '' || !in_array( $cat_posttype, $post_types ) ) {
|
|
| 4990 | + if ($cat_name == '' || !in_array($cat_posttype, $post_types)) {
|
|
| 4991 | 4991 | $invalid++; |
| 4992 | 4992 | continue; |
| 4993 | 4993 | } |
@@ -5004,8 +5004,8 @@ discard block |
||
| 5004 | 5004 | $term_data['description'] = $cat_description; |
| 5005 | 5005 | $term_data['cat_schema'] = $cat_schema; |
| 5006 | 5006 | $term_data['top_description'] = $cat_top_description; |
| 5007 | - $term_data['image'] = $cat_image != '' ? basename( $cat_image ) : ''; |
|
| 5008 | - $term_data['icon'] = $cat_icon != '' ? basename( $cat_icon ) : ''; |
|
| 5007 | + $term_data['image'] = $cat_image != '' ? basename($cat_image) : ''; |
|
| 5008 | + $term_data['icon'] = $cat_icon != '' ? basename($cat_icon) : ''; |
|
| 5009 | 5009 | |
| 5010 | 5010 | //$term_data = array_map( 'utf8_encode', $term_data ); |
| 5011 | 5011 | |
@@ -5014,14 +5014,14 @@ discard block |
||
| 5014 | 5014 | $term_data['taxonomy'] = $taxonomy; |
| 5015 | 5015 | |
| 5016 | 5016 | $term_parent_id = 0; |
| 5017 | - if ($cat_parent != "" || (int)$cat_parent > 0) {
|
|
| 5017 | + if ($cat_parent != "" || (int) $cat_parent > 0) {
|
|
| 5018 | 5018 | $term_parent = ''; |
| 5019 | 5019 | |
| 5020 | - if ( $term_parent = get_term_by( 'name', $cat_parent, $taxonomy ) ) {
|
|
| 5020 | + if ($term_parent = get_term_by('name', $cat_parent, $taxonomy)) {
|
|
| 5021 | 5021 | $term_parent = $term_parent; |
| 5022 | - } else if ( $term_parent = get_term_by( 'slug', $cat_parent, $taxonomy ) ) {
|
|
| 5022 | + } else if ($term_parent = get_term_by('slug', $cat_parent, $taxonomy)) {
|
|
| 5023 | 5023 | $term_parent = $term_parent; |
| 5024 | - } else if ( $term_parent = get_term_by( 'id', $cat_parent, $taxonomy ) ) {
|
|
| 5024 | + } else if ($term_parent = get_term_by('id', $cat_parent, $taxonomy)) {
|
|
| 5025 | 5025 | $term_parent = $term_parent; |
| 5026 | 5026 | } else {
|
| 5027 | 5027 | $term_parent_data = array(); |
@@ -5029,47 +5029,47 @@ discard block |
||
| 5029 | 5029 | //$term_parent_data = array_map( 'utf8_encode', $term_parent_data ); |
| 5030 | 5030 | $term_parent_data['taxonomy'] = $taxonomy; |
| 5031 | 5031 | |
| 5032 | - $term_parent_id = (int)geodir_imex_insert_term( $taxonomy, $term_parent_data ); |
|
| 5032 | + $term_parent_id = (int) geodir_imex_insert_term($taxonomy, $term_parent_data); |
|
| 5033 | 5033 | } |
| 5034 | 5034 | |
| 5035 | - if ( !empty( $term_parent ) && !is_wp_error( $term_parent ) ) {
|
|
| 5036 | - $term_parent_id = (int)$term_parent->term_id; |
|
| 5035 | + if (!empty($term_parent) && !is_wp_error($term_parent)) {
|
|
| 5036 | + $term_parent_id = (int) $term_parent->term_id; |
|
| 5037 | 5037 | } |
| 5038 | 5038 | } |
| 5039 | - $term_data['parent'] = (int)$term_parent_id; |
|
| 5039 | + $term_data['parent'] = (int) $term_parent_id; |
|
| 5040 | 5040 | |
| 5041 | 5041 | $term_id = NULL; |
| 5042 | - if ( $import_choice == 'update' ) {
|
|
| 5043 | - if ( $cat_id > 0 && $term = (array)term_exists( $cat_id, $taxonomy ) ) {
|
|
| 5042 | + if ($import_choice == 'update') {
|
|
| 5043 | + if ($cat_id > 0 && $term = (array) term_exists($cat_id, $taxonomy)) {
|
|
| 5044 | 5044 | $term_data['term_id'] = $term['term_id']; |
| 5045 | 5045 | |
| 5046 | - if ( $term_id = geodir_imex_update_term( $taxonomy, $term_data ) ) {
|
|
| 5046 | + if ($term_id = geodir_imex_update_term($taxonomy, $term_data)) {
|
|
| 5047 | 5047 | $updated++; |
| 5048 | 5048 | } else {
|
| 5049 | 5049 | $invalid++; |
| 5050 | 5050 | } |
| 5051 | - } else if ( $term_data['slug'] != '' && $term = (array)term_exists( $term_data['slug'], $taxonomy ) ) {
|
|
| 5051 | + } else if ($term_data['slug'] != '' && $term = (array) term_exists($term_data['slug'], $taxonomy)) {
|
|
| 5052 | 5052 | $term_data['term_id'] = $term['term_id']; |
| 5053 | 5053 | |
| 5054 | - if ( $term_id = geodir_imex_update_term( $taxonomy, $term_data ) ) {
|
|
| 5054 | + if ($term_id = geodir_imex_update_term($taxonomy, $term_data)) {
|
|
| 5055 | 5055 | $updated++; |
| 5056 | 5056 | } else {
|
| 5057 | 5057 | $invalid++; |
| 5058 | 5058 | } |
| 5059 | 5059 | } else {
|
| 5060 | - if ( $term_id = geodir_imex_insert_term( $taxonomy, $term_data ) ) {
|
|
| 5060 | + if ($term_id = geodir_imex_insert_term($taxonomy, $term_data)) {
|
|
| 5061 | 5061 | $created++; |
| 5062 | 5062 | } else {
|
| 5063 | 5063 | $invalid++; |
| 5064 | 5064 | } |
| 5065 | 5065 | } |
| 5066 | - } else if ( $import_choice == 'skip' ) {
|
|
| 5067 | - if ( $cat_id > 0 && $term = (array)term_exists( $cat_id, $taxonomy ) ) {
|
|
| 5066 | + } else if ($import_choice == 'skip') {
|
|
| 5067 | + if ($cat_id > 0 && $term = (array) term_exists($cat_id, $taxonomy)) {
|
|
| 5068 | 5068 | $skipped++; |
| 5069 | - } else if ( $term_data['slug'] != '' && $term = (array)term_exists( $term_data['slug'], $taxonomy ) ) {
|
|
| 5069 | + } else if ($term_data['slug'] != '' && $term = (array) term_exists($term_data['slug'], $taxonomy)) {
|
|
| 5070 | 5070 | $skipped++; |
| 5071 | 5071 | } else {
|
| 5072 | - if ( $term_id = geodir_imex_insert_term( $taxonomy, $term_data ) ) {
|
|
| 5072 | + if ($term_id = geodir_imex_insert_term($taxonomy, $term_data)) {
|
|
| 5073 | 5073 | $created++; |
| 5074 | 5074 | } else {
|
| 5075 | 5075 | $invalid++; |
@@ -5079,37 +5079,37 @@ discard block |
||
| 5079 | 5079 | $invalid++; |
| 5080 | 5080 | } |
| 5081 | 5081 | |
| 5082 | - if ( $term_id ) {
|
|
| 5083 | - if ( isset( $term_data['top_description'] ) ) {
|
|
| 5084 | - update_tax_meta( $term_id, 'ct_cat_top_desc', $term_data['top_description'], $cat_posttype ); |
|
| 5082 | + if ($term_id) {
|
|
| 5083 | + if (isset($term_data['top_description'])) {
|
|
| 5084 | + update_tax_meta($term_id, 'ct_cat_top_desc', $term_data['top_description'], $cat_posttype); |
|
| 5085 | 5085 | } |
| 5086 | 5086 | |
| 5087 | - if ( isset( $term_data['cat_schema'] ) ) {
|
|
| 5088 | - update_tax_meta( $term_id, 'ct_cat_schema', $term_data['cat_schema'], $cat_posttype ); |
|
| 5087 | + if (isset($term_data['cat_schema'])) {
|
|
| 5088 | + update_tax_meta($term_id, 'ct_cat_schema', $term_data['cat_schema'], $cat_posttype); |
|
| 5089 | 5089 | } |
| 5090 | 5090 | |
| 5091 | 5091 | $attachment = false; |
| 5092 | - if ( isset( $term_data['image'] ) && $term_data['image'] != '' ) {
|
|
| 5093 | - $cat_image = geodir_get_default_catimage( $term_id, $cat_posttype ); |
|
| 5094 | - $cat_image = !empty( $cat_image ) && isset( $cat_image['src'] ) ? $cat_image['src'] : ''; |
|
| 5092 | + if (isset($term_data['image']) && $term_data['image'] != '') {
|
|
| 5093 | + $cat_image = geodir_get_default_catimage($term_id, $cat_posttype); |
|
| 5094 | + $cat_image = !empty($cat_image) && isset($cat_image['src']) ? $cat_image['src'] : ''; |
|
| 5095 | 5095 | |
| 5096 | - if ( basename($cat_image) != $term_data['image'] ) {
|
|
| 5096 | + if (basename($cat_image) != $term_data['image']) {
|
|
| 5097 | 5097 | $attachment = true; |
| 5098 | - update_tax_meta( $term_id, 'ct_cat_default_img', array( 'id' => 'image', 'src' => $uploads['url'] . '/' . $term_data['image'] ), $cat_posttype ); |
|
| 5098 | + update_tax_meta($term_id, 'ct_cat_default_img', array('id' => 'image', 'src' => $uploads['url'] . '/' . $term_data['image']), $cat_posttype);
|
|
| 5099 | 5099 | } |
| 5100 | 5100 | } |
| 5101 | 5101 | |
| 5102 | - if ( isset( $term_data['icon'] ) && $term_data['icon'] != '' ) {
|
|
| 5103 | - $cat_icon = get_tax_meta( $term_id, 'ct_cat_icon', false, $cat_posttype ); |
|
| 5104 | - $cat_icon = !empty( $cat_icon ) && isset( $cat_icon['src'] ) ? $cat_icon['src'] : ''; |
|
| 5102 | + if (isset($term_data['icon']) && $term_data['icon'] != '') {
|
|
| 5103 | + $cat_icon = get_tax_meta($term_id, 'ct_cat_icon', false, $cat_posttype); |
|
| 5104 | + $cat_icon = !empty($cat_icon) && isset($cat_icon['src']) ? $cat_icon['src'] : ''; |
|
| 5105 | 5105 | |
| 5106 | - if ( basename($cat_icon) != $term_data['icon'] ) {
|
|
| 5106 | + if (basename($cat_icon) != $term_data['icon']) {
|
|
| 5107 | 5107 | $attachment = true; |
| 5108 | - update_tax_meta( $term_id, 'ct_cat_icon', array( 'id' => 'icon', 'src' => $uploads['url'] . '/' . $term_data['icon'] ), $cat_posttype ); |
|
| 5108 | + update_tax_meta($term_id, 'ct_cat_icon', array('id' => 'icon', 'src' => $uploads['url'] . '/' . $term_data['icon']), $cat_posttype);
|
|
| 5109 | 5109 | } |
| 5110 | 5110 | } |
| 5111 | 5111 | |
| 5112 | - if ( $attachment ) {
|
|
| 5112 | + if ($attachment) {
|
|
| 5113 | 5113 | $images++; |
| 5114 | 5114 | } |
| 5115 | 5115 | } |
@@ -5131,14 +5131,14 @@ discard block |
||
| 5131 | 5131 | $json['invalid'] = $invalid; |
| 5132 | 5132 | $json['images'] = $images; |
| 5133 | 5133 | |
| 5134 | - wp_send_json( $json ); |
|
| 5134 | + wp_send_json($json); |
|
| 5135 | 5135 | exit; |
| 5136 | - } else if ( $task == 'import_post' ) {
|
|
| 5136 | + } else if ($task == 'import_post') {
|
|
| 5137 | 5137 | |
| 5138 | 5138 | //run some stuff to make the import quicker |
| 5139 | - wp_defer_term_counting( true ); |
|
| 5140 | - wp_defer_comment_counting( true ); |
|
| 5141 | - $wpdb->query( 'SET autocommit = 0;' ); |
|
| 5139 | + wp_defer_term_counting(true); |
|
| 5140 | + wp_defer_comment_counting(true); |
|
| 5141 | + $wpdb->query('SET autocommit = 0;');
|
|
| 5142 | 5142 | |
| 5143 | 5143 | //remove_all_actions('publish_post');
|
| 5144 | 5144 | //remove_all_actions('transition_post_status');
|
@@ -5148,26 +5148,26 @@ discard block |
||
| 5148 | 5148 | if (!empty($file)) {
|
| 5149 | 5149 | $wp_post_statuses = get_post_statuses(); // All of the WordPress supported post statuses. |
| 5150 | 5150 | $default_status = 'publish'; |
| 5151 | - $current_date = date_i18n( 'Y-m-d', time() ); |
|
| 5151 | + $current_date = date_i18n('Y-m-d', time());
|
|
| 5152 | 5152 | |
| 5153 | 5153 | $columns = isset($file[0]) ? $file[0] : NULL; |
| 5154 | 5154 | |
| 5155 | 5155 | if (empty($columns) || (!empty($columns) && $columns[0] == '')) {
|
| 5156 | 5156 | $json['error'] = CSV_INVAILD_FILE; |
| 5157 | - wp_send_json( $json ); |
|
| 5157 | + wp_send_json($json); |
|
| 5158 | 5158 | exit; |
| 5159 | 5159 | } |
| 5160 | 5160 | |
| 5161 | - $processed_actual=0; |
|
| 5161 | + $processed_actual = 0; |
|
| 5162 | 5162 | for ($i = 1; $i <= $limit; $i++) {
|
| 5163 | 5163 | $index = $processed + $i; |
| 5164 | 5164 | $gd_post = array(); |
| 5165 | 5165 | |
| 5166 | 5166 | if (isset($file[$index])) {$processed_actual++;
|
| 5167 | 5167 | $row = $file[$index]; |
| 5168 | - $row = array_map( 'trim', $row ); |
|
| 5168 | + $row = array_map('trim', $row);
|
|
| 5169 | 5169 | //$row = array_map( 'utf8_encode', $row ); |
| 5170 | - $row = array_map( 'addslashes_gpc', $row ); |
|
| 5170 | + $row = array_map('addslashes_gpc', $row);
|
|
| 5171 | 5171 | |
| 5172 | 5172 | $post_id = ''; |
| 5173 | 5173 | $post_title = ''; |
@@ -5201,73 +5201,73 @@ discard block |
||
| 5201 | 5201 | $original_post_id = ''; |
| 5202 | 5202 | |
| 5203 | 5203 | $c = 0; |
| 5204 | - foreach ($columns as $column ) {
|
|
| 5204 | + foreach ($columns as $column) {
|
|
| 5205 | 5205 | $gd_post[$column] = $row[$c]; |
| 5206 | 5206 | |
| 5207 | - if ( $column == 'post_id' ) {
|
|
| 5207 | + if ($column == 'post_id') {
|
|
| 5208 | 5208 | $post_id = $row[$c]; |
| 5209 | - } else if ( $column == 'post_title' ) {
|
|
| 5209 | + } else if ($column == 'post_title') {
|
|
| 5210 | 5210 | $post_title = $row[$c]; |
| 5211 | - } else if ( $column == 'post_author' ) {
|
|
| 5211 | + } else if ($column == 'post_author') {
|
|
| 5212 | 5212 | $post_author = $row[$c]; |
| 5213 | - } else if ( $column == 'post_content' ) {
|
|
| 5213 | + } else if ($column == 'post_content') {
|
|
| 5214 | 5214 | $post_content = $row[$c]; |
| 5215 | - } else if ( $column == 'post_category' && $row[$c] != '' ) {
|
|
| 5216 | - $post_category_arr = explode( ',', $row[$c] ); |
|
| 5217 | - } else if ( $column == 'default_category' ) {
|
|
| 5215 | + } else if ($column == 'post_category' && $row[$c] != '') {
|
|
| 5216 | + $post_category_arr = explode(',', $row[$c]);
|
|
| 5217 | + } else if ($column == 'default_category') {
|
|
| 5218 | 5218 | $default_category = wp_kses_normalize_entities($row[$c]); |
| 5219 | - } else if ( $column == 'post_tags' && $row[$c] != '' ) {
|
|
| 5220 | - $post_tags = explode( ',', $row[$c] ); |
|
| 5221 | - } else if ( $column == 'post_type' ) {
|
|
| 5219 | + } else if ($column == 'post_tags' && $row[$c] != '') {
|
|
| 5220 | + $post_tags = explode(',', $row[$c]);
|
|
| 5221 | + } else if ($column == 'post_type') {
|
|
| 5222 | 5222 | $post_type = $row[$c]; |
| 5223 | - } else if ( $column == 'post_status' ) {
|
|
| 5224 | - $post_status = sanitize_key( $row[$c] ); |
|
| 5225 | - } else if ( $column == 'is_featured' ) {
|
|
| 5226 | - $is_featured = (int)$row[$c]; |
|
| 5227 | - } else if ( $column == 'geodir_video' ) {
|
|
| 5223 | + } else if ($column == 'post_status') {
|
|
| 5224 | + $post_status = sanitize_key($row[$c]); |
|
| 5225 | + } else if ($column == 'is_featured') {
|
|
| 5226 | + $is_featured = (int) $row[$c]; |
|
| 5227 | + } else if ($column == 'geodir_video') {
|
|
| 5228 | 5228 | $geodir_video = $row[$c]; |
| 5229 | - } else if ( $column == 'post_address' ) {
|
|
| 5229 | + } else if ($column == 'post_address') {
|
|
| 5230 | 5230 | $post_address = $row[$c]; |
| 5231 | - } else if ( $column == 'post_city' ) {
|
|
| 5231 | + } else if ($column == 'post_city') {
|
|
| 5232 | 5232 | $post_city = $row[$c]; |
| 5233 | - } else if ( $column == 'post_region' ) {
|
|
| 5233 | + } else if ($column == 'post_region') {
|
|
| 5234 | 5234 | $post_region = $row[$c]; |
| 5235 | - } else if ( $column == 'post_country' ) {
|
|
| 5235 | + } else if ($column == 'post_country') {
|
|
| 5236 | 5236 | $post_country = $row[$c]; |
| 5237 | - } else if ( $column == 'post_zip' ) {
|
|
| 5237 | + } else if ($column == 'post_zip') {
|
|
| 5238 | 5238 | $post_zip = $row[$c]; |
| 5239 | - } else if ( $column == 'post_latitude' ) {
|
|
| 5239 | + } else if ($column == 'post_latitude') {
|
|
| 5240 | 5240 | $post_latitude = $row[$c]; |
| 5241 | - } else if ( $column == 'post_longitude' ) {
|
|
| 5241 | + } else if ($column == 'post_longitude') {
|
|
| 5242 | 5242 | $post_longitude = $row[$c]; |
| 5243 | - } else if ( $column == 'geodir_timing' ) {
|
|
| 5243 | + } else if ($column == 'geodir_timing') {
|
|
| 5244 | 5244 | $geodir_timing = $row[$c]; |
| 5245 | - } else if ( $column == 'geodir_contact' ) {
|
|
| 5245 | + } else if ($column == 'geodir_contact') {
|
|
| 5246 | 5246 | $geodir_contact = $row[$c]; |
| 5247 | - } else if ( $column == 'geodir_email' ) {
|
|
| 5247 | + } else if ($column == 'geodir_email') {
|
|
| 5248 | 5248 | $geodir_email = $row[$c]; |
| 5249 | - } else if ( $column == 'geodir_website' ) {
|
|
| 5249 | + } else if ($column == 'geodir_website') {
|
|
| 5250 | 5250 | $geodir_website = $row[$c]; |
| 5251 | - } else if ( $column == 'geodir_twitter' ) {
|
|
| 5251 | + } else if ($column == 'geodir_twitter') {
|
|
| 5252 | 5252 | $geodir_twitter = $row[$c]; |
| 5253 | - } else if ( $column == 'geodir_facebook' ) {
|
|
| 5253 | + } else if ($column == 'geodir_facebook') {
|
|
| 5254 | 5254 | $geodir_facebook = $row[$c]; |
| 5255 | - } else if ( $column == 'geodir_twitter' ) {
|
|
| 5255 | + } else if ($column == 'geodir_twitter') {
|
|
| 5256 | 5256 | $geodir_twitter = $row[$c]; |
| 5257 | - } else if ( $column == 'IMAGE' && !empty( $row[$c] ) && $row[$c] != '' ) {
|
|
| 5257 | + } else if ($column == 'IMAGE' && !empty($row[$c]) && $row[$c] != '') {
|
|
| 5258 | 5258 | $post_images[] = $row[$c]; |
| 5259 | - } else if ( $column == 'alive_days' && (int)$row[$c] > 0 ) {
|
|
| 5260 | - $expire_date = date_i18n( 'Y-m-d', strtotime( $current_date . '+' . (int)$row[$c] . ' days' ) ); |
|
| 5261 | - } else if ( $column == 'expire_date' && $row[$c] != '' && geodir_strtolower($row[$c]) != 'never' ) {
|
|
| 5259 | + } else if ($column == 'alive_days' && (int) $row[$c] > 0) {
|
|
| 5260 | + $expire_date = date_i18n('Y-m-d', strtotime($current_date . '+' . (int) $row[$c] . ' days'));
|
|
| 5261 | + } else if ($column == 'expire_date' && $row[$c] != '' && geodir_strtolower($row[$c]) != 'never') {
|
|
| 5262 | 5262 | $row[$c] = str_replace('/', '-', $row[$c]);
|
| 5263 | - $expire_date = date_i18n( 'Y-m-d', strtotime( $row[$c] ) ); |
|
| 5263 | + $expire_date = date_i18n('Y-m-d', strtotime($row[$c]));
|
|
| 5264 | 5264 | } |
| 5265 | 5265 | // WPML |
| 5266 | 5266 | if ($is_wpml) {
|
| 5267 | 5267 | if ($column == 'language') {
|
| 5268 | 5268 | $language = geodir_strtolower(trim($row[$c])); |
| 5269 | 5269 | } else if ($column == 'original_post_id') {
|
| 5270 | - $original_post_id = (int)$row[$c]; |
|
| 5270 | + $original_post_id = (int) $row[$c]; |
|
| 5271 | 5271 | } |
| 5272 | 5272 | } |
| 5273 | 5273 | // WPML |
@@ -5282,24 +5282,24 @@ discard block |
||
| 5282 | 5282 | |
| 5283 | 5283 | $gd_post['IMAGE'] = $post_images; |
| 5284 | 5284 | |
| 5285 | - $post_status = !empty( $post_status ) ? sanitize_key( $post_status ) : $default_status; |
|
| 5286 | - $post_status = !empty( $wp_post_statuses ) && !isset( $wp_post_statuses[$post_status] ) ? $default_status : $post_status; |
|
| 5285 | + $post_status = !empty($post_status) ? sanitize_key($post_status) : $default_status; |
|
| 5286 | + $post_status = !empty($wp_post_statuses) && !isset($wp_post_statuses[$post_status]) ? $default_status : $post_status; |
|
| 5287 | 5287 | |
| 5288 | 5288 | $valid = true; |
| 5289 | 5289 | |
| 5290 | - if ( $post_title == '' || !in_array( $post_type, $post_types ) ) {
|
|
| 5290 | + if ($post_title == '' || !in_array($post_type, $post_types)) {
|
|
| 5291 | 5291 | $invalid++; |
| 5292 | 5292 | $valid = false; |
| 5293 | 5293 | } |
| 5294 | 5294 | |
| 5295 | - $location_allowed = function_exists( 'geodir_cpt_no_location' ) && geodir_cpt_no_location( $post_type ) ? false : true; |
|
| 5296 | - if ( $location_allowed ) {
|
|
| 5295 | + $location_allowed = function_exists('geodir_cpt_no_location') && geodir_cpt_no_location($post_type) ? false : true;
|
|
| 5296 | + if ($location_allowed) {
|
|
| 5297 | 5297 | $location_result = geodir_get_default_location(); |
| 5298 | - if ( $post_address == '' || $post_city == '' || $post_region == '' || $post_country == '' || $post_latitude == '' || $post_longitude == '' ) {
|
|
| 5298 | + if ($post_address == '' || $post_city == '' || $post_region == '' || $post_country == '' || $post_latitude == '' || $post_longitude == '') {
|
|
| 5299 | 5299 | $invalid_addr++; |
| 5300 | 5300 | $valid = false; |
| 5301 | - } else if ( !empty( $location_result ) && $location_result->location_id == 0 ) {
|
|
| 5302 | - if ( ( geodir_strtolower( $post_city ) != geodir_strtolower( $location_result->city ) ) || ( geodir_strtolower( $post_region ) != geodir_strtolower( $location_result->region ) ) || (geodir_strtolower( $post_country ) != geodir_strtolower( $location_result->country ) ) ) {
|
|
| 5301 | + } else if (!empty($location_result) && $location_result->location_id == 0) {
|
|
| 5302 | + if ((geodir_strtolower($post_city) != geodir_strtolower($location_result->city)) || (geodir_strtolower($post_region) != geodir_strtolower($location_result->region)) || (geodir_strtolower($post_country) != geodir_strtolower($location_result->country))) {
|
|
| 5303 | 5303 | $invalid_addr++; |
| 5304 | 5304 | $valid = false; |
| 5305 | 5305 | } else {
|
@@ -5310,7 +5310,7 @@ discard block |
||
| 5310 | 5310 | } |
| 5311 | 5311 | } |
| 5312 | 5312 | |
| 5313 | - if ( !$valid ) {
|
|
| 5313 | + if (!$valid) {
|
|
| 5314 | 5314 | continue; |
| 5315 | 5315 | } |
| 5316 | 5316 | |
@@ -5323,16 +5323,16 @@ discard block |
||
| 5323 | 5323 | |
| 5324 | 5324 | $post_category = array(); |
| 5325 | 5325 | $default_category_id = NULL; |
| 5326 | - if ( !empty( $post_category_arr ) ) {
|
|
| 5327 | - foreach ( $post_category_arr as $value ) {
|
|
| 5328 | - $category_name = wp_kses_normalize_entities( trim( $value ) ); |
|
| 5326 | + if (!empty($post_category_arr)) {
|
|
| 5327 | + foreach ($post_category_arr as $value) {
|
|
| 5328 | + $category_name = wp_kses_normalize_entities(trim($value)); |
|
| 5329 | 5329 | |
| 5330 | - if ( $category_name != '' ) {
|
|
| 5330 | + if ($category_name != '') {
|
|
| 5331 | 5331 | $term_category = array(); |
| 5332 | 5332 | |
| 5333 | - if ( $term = get_term_by( 'name', $category_name, $cat_taxonomy ) ) {
|
|
| 5333 | + if ($term = get_term_by('name', $category_name, $cat_taxonomy)) {
|
|
| 5334 | 5334 | $term_category = $term; |
| 5335 | - } else if ( $term = get_term_by( 'slug', $category_name, $cat_taxonomy ) ) {
|
|
| 5335 | + } else if ($term = get_term_by('slug', $category_name, $cat_taxonomy)) {
|
|
| 5336 | 5336 | $term_category = $term; |
| 5337 | 5337 | } else {
|
| 5338 | 5338 | $term_data = array(); |
@@ -5340,13 +5340,13 @@ discard block |
||
| 5340 | 5340 | //$term_data = array_map( 'utf8_encode', $term_data ); |
| 5341 | 5341 | $term_data['taxonomy'] = $cat_taxonomy; |
| 5342 | 5342 | |
| 5343 | - $term_id = geodir_imex_insert_term( $cat_taxonomy, $term_data ); |
|
| 5344 | - if ( $term_id ) {
|
|
| 5345 | - $term_category = get_term( $term_id, $cat_taxonomy ); |
|
| 5343 | + $term_id = geodir_imex_insert_term($cat_taxonomy, $term_data); |
|
| 5344 | + if ($term_id) {
|
|
| 5345 | + $term_category = get_term($term_id, $cat_taxonomy); |
|
| 5346 | 5346 | } |
| 5347 | 5347 | } |
| 5348 | 5348 | |
| 5349 | - if ( !empty( $term_category ) && !is_wp_error( $term_category ) ) {
|
|
| 5349 | + if (!empty($term_category) && !is_wp_error($term_category)) {
|
|
| 5350 | 5350 | //$post_category[] = $term_category->slug; |
| 5351 | 5351 | $post_category[] = intval($term_category->term_id); |
| 5352 | 5352 | |
@@ -5368,28 +5368,28 @@ discard block |
||
| 5368 | 5368 | $save_post['post_tags'] = $post_tags; |
| 5369 | 5369 | |
| 5370 | 5370 | $saved_post_id = NULL; |
| 5371 | - if ( $import_choice == 'update' ) {
|
|
| 5372 | - if ( $post_id > 0 && get_post( $post_id ) ) {
|
|
| 5371 | + if ($import_choice == 'update') {
|
|
| 5372 | + if ($post_id > 0 && get_post($post_id)) {
|
|
| 5373 | 5373 | $save_post['ID'] = $post_id; |
| 5374 | 5374 | |
| 5375 | - if ( wp_update_post( $save_post ) ) {
|
|
| 5375 | + if (wp_update_post($save_post)) {
|
|
| 5376 | 5376 | $saved_post_id = $post_id; |
| 5377 | 5377 | $updated++; |
| 5378 | 5378 | } |
| 5379 | 5379 | } else {
|
| 5380 | - if ( $saved_post_id = wp_insert_post( $save_post ) ) {
|
|
| 5380 | + if ($saved_post_id = wp_insert_post($save_post)) {
|
|
| 5381 | 5381 | $created++; |
| 5382 | 5382 | } |
| 5383 | 5383 | } |
| 5384 | 5384 | |
| 5385 | - if ( !$saved_post_id > 0 ) {
|
|
| 5385 | + if (!$saved_post_id > 0) {
|
|
| 5386 | 5386 | $invalid++; |
| 5387 | 5387 | } |
| 5388 | - } else if ( $import_choice == 'skip' ) {
|
|
| 5389 | - if ( $post_id > 0 && get_post( $post_id ) ) {
|
|
| 5388 | + } else if ($import_choice == 'skip') {
|
|
| 5389 | + if ($post_id > 0 && get_post($post_id)) {
|
|
| 5390 | 5390 | $skipped++; |
| 5391 | 5391 | } else {
|
| 5392 | - if ( $saved_post_id = wp_insert_post( $save_post ) ) {
|
|
| 5392 | + if ($saved_post_id = wp_insert_post($save_post)) {
|
|
| 5393 | 5393 | $created++; |
| 5394 | 5394 | } else {
|
| 5395 | 5395 | $invalid++; |
@@ -5399,19 +5399,19 @@ discard block |
||
| 5399 | 5399 | $invalid++; |
| 5400 | 5400 | } |
| 5401 | 5401 | |
| 5402 | - if ( (int)$saved_post_id > 0 ) {
|
|
| 5402 | + if ((int) $saved_post_id > 0) {
|
|
| 5403 | 5403 | // WPML |
| 5404 | 5404 | if ($is_wpml && $original_post_id > 0 && $language != '') {
|
| 5405 | 5405 | $wpml_post_type = 'post_' . $post_type; |
| 5406 | - $source_language = geodir_get_language_for_element( $original_post_id, $wpml_post_type ); |
|
| 5406 | + $source_language = geodir_get_language_for_element($original_post_id, $wpml_post_type); |
|
| 5407 | 5407 | $source_language = $source_language != '' ? $source_language : $sitepress->get_default_language(); |
| 5408 | 5408 | |
| 5409 | - $trid = $sitepress->get_element_trid( $original_post_id, $wpml_post_type ); |
|
| 5409 | + $trid = $sitepress->get_element_trid($original_post_id, $wpml_post_type); |
|
| 5410 | 5410 | |
| 5411 | - $sitepress->set_element_language_details( $saved_post_id, $wpml_post_type, $trid, $language, $source_language ); |
|
| 5411 | + $sitepress->set_element_language_details($saved_post_id, $wpml_post_type, $trid, $language, $source_language); |
|
| 5412 | 5412 | } |
| 5413 | 5413 | // WPML |
| 5414 | - $gd_post_info = geodir_get_post_info( $saved_post_id ); |
|
| 5414 | + $gd_post_info = geodir_get_post_info($saved_post_id); |
|
| 5415 | 5415 | |
| 5416 | 5416 | $gd_post['post_id'] = $saved_post_id; |
| 5417 | 5417 | $gd_post['ID'] = $saved_post_id; |
@@ -5423,7 +5423,7 @@ discard block |
||
| 5423 | 5423 | |
| 5424 | 5424 | // post location |
| 5425 | 5425 | $post_location_id = 0; |
| 5426 | - if ( $location_allowed && !empty( $location_result ) && $location_result->location_id > 0 ) {
|
|
| 5426 | + if ($location_allowed && !empty($location_result) && $location_result->location_id > 0) {
|
|
| 5427 | 5427 | $post_location_info = array( |
| 5428 | 5428 | 'city' => $post_city, |
| 5429 | 5429 | 'region' => $post_region, |
@@ -5431,21 +5431,21 @@ discard block |
||
| 5431 | 5431 | 'geo_lat' => $post_latitude, |
| 5432 | 5432 | 'geo_lng' => $post_longitude |
| 5433 | 5433 | ); |
| 5434 | - if ( $location_id = (int)geodir_add_new_location( $post_location_info ) ) {
|
|
| 5434 | + if ($location_id = (int) geodir_add_new_location($post_location_info)) {
|
|
| 5435 | 5435 | $post_location_id = $location_id; |
| 5436 | 5436 | } |
| 5437 | 5437 | } |
| 5438 | 5438 | $gd_post['post_location_id'] = $post_location_id; |
| 5439 | 5439 | |
| 5440 | 5440 | // post package info |
| 5441 | - $package_id = isset( $gd_post['package_id'] ) && !empty( $gd_post['package_id'] ) ? (int)$gd_post['package_id'] : 0; |
|
| 5441 | + $package_id = isset($gd_post['package_id']) && !empty($gd_post['package_id']) ? (int) $gd_post['package_id'] : 0; |
|
| 5442 | 5442 | if (!$package_id && !empty($gd_post_info) && isset($gd_post_info->package_id) && $gd_post_info->package_id) {
|
| 5443 | 5443 | $package_id = $gd_post_info->package_id; |
| 5444 | 5444 | } |
| 5445 | 5445 | |
| 5446 | 5446 | $package_info = array(); |
| 5447 | 5447 | if ($package_id && function_exists('geodir_get_package_info_by_id')) {
|
| 5448 | - $package_info = (array)geodir_get_package_info_by_id($package_id); |
|
| 5448 | + $package_info = (array) geodir_get_package_info_by_id($package_id); |
|
| 5449 | 5449 | |
| 5450 | 5450 | if (!(!empty($package_info) && isset($package_info['post_type']) && $package_info['post_type'] == $post_type)) {
|
| 5451 | 5451 | $package_info = array(); |
@@ -5453,18 +5453,18 @@ discard block |
||
| 5453 | 5453 | } |
| 5454 | 5454 | |
| 5455 | 5455 | if (empty($package_info)) {
|
| 5456 | - $package_info = (array)geodir_post_package_info( array(), '', $post_type ); |
|
| 5456 | + $package_info = (array) geodir_post_package_info(array(), '', $post_type); |
|
| 5457 | 5457 | } |
| 5458 | 5458 | |
| 5459 | - if (!empty($package_info)) {
|
|
| 5459 | + if (!empty($package_info)) {
|
|
| 5460 | 5460 | $package_id = $package_info['pid']; |
| 5461 | 5461 | |
| 5462 | 5462 | if (isset($gd_post['alive_days']) || isset($gd_post['expire_date'])) {
|
| 5463 | 5463 | $gd_post['expire_date'] = $expire_date; |
| 5464 | 5464 | } else {
|
| 5465 | - if ( isset( $package_info['days'] ) && (int)$package_info['days'] > 0 ) {
|
|
| 5466 | - $gd_post['alive_days'] = (int)$package_info['days']; |
|
| 5467 | - $gd_post['expire_date'] = date_i18n( 'Y-m-d', strtotime( $current_date . '+' . (int)$package_info['days'] . ' days' ) ); |
|
| 5465 | + if (isset($package_info['days']) && (int) $package_info['days'] > 0) {
|
|
| 5466 | + $gd_post['alive_days'] = (int) $package_info['days']; |
|
| 5467 | + $gd_post['expire_date'] = date_i18n('Y-m-d', strtotime($current_date . '+' . (int) $package_info['days'] . ' days'));
|
|
| 5468 | 5468 | } else {
|
| 5469 | 5469 | $gd_post['expire_date'] = 'Never'; |
| 5470 | 5470 | } |
@@ -5484,28 +5484,28 @@ discard block |
||
| 5484 | 5484 | } |
| 5485 | 5485 | |
| 5486 | 5486 | // Export franchise fields |
| 5487 | - $is_franchise_active = is_plugin_active( 'geodir_franchise/geodir_franchise.php' ) && geodir_franchise_enabled( $post_type ) ? true : false; |
|
| 5487 | + $is_franchise_active = is_plugin_active('geodir_franchise/geodir_franchise.php') && geodir_franchise_enabled($post_type) ? true : false;
|
|
| 5488 | 5488 | if ($is_franchise_active) {
|
| 5489 | - if ( isset( $gd_post['gd_is_franchise'] ) && (int)$gd_post['gd_is_franchise'] == 1 ) {
|
|
| 5489 | + if (isset($gd_post['gd_is_franchise']) && (int) $gd_post['gd_is_franchise'] == 1) {
|
|
| 5490 | 5490 | $gd_franchise_lock = array(); |
| 5491 | 5491 | |
| 5492 | - if ( isset( $gd_post['gd_franchise_lock'] ) ) {
|
|
| 5493 | - $gd_franchise_lock = str_replace(" ", "", $gd_post['gd_franchise_lock'] );
|
|
| 5494 | - $gd_franchise_lock = trim( $gd_franchise_lock ); |
|
| 5495 | - $gd_franchise_lock = explode( ",", $gd_franchise_lock ); |
|
| 5492 | + if (isset($gd_post['gd_franchise_lock'])) {
|
|
| 5493 | + $gd_franchise_lock = str_replace(" ", "", $gd_post['gd_franchise_lock']);
|
|
| 5494 | + $gd_franchise_lock = trim($gd_franchise_lock); |
|
| 5495 | + $gd_franchise_lock = explode(",", $gd_franchise_lock);
|
|
| 5496 | 5496 | } |
| 5497 | 5497 | |
| 5498 | - update_post_meta( $saved_post_id, 'gd_is_franchise', 1 ); |
|
| 5499 | - update_post_meta( $saved_post_id, 'gd_franchise_lock', $gd_franchise_lock ); |
|
| 5498 | + update_post_meta($saved_post_id, 'gd_is_franchise', 1); |
|
| 5499 | + update_post_meta($saved_post_id, 'gd_franchise_lock', $gd_franchise_lock); |
|
| 5500 | 5500 | } else {
|
| 5501 | - if ( isset( $gd_post['franchise'] ) && (int)$gd_post['franchise'] > 0 && geodir_franchise_check( (int)$gd_post['franchise'] ) ) {
|
|
| 5502 | - geodir_save_post_meta( $saved_post_id, 'franchise', (int)$gd_post['franchise'] ); |
|
| 5501 | + if (isset($gd_post['franchise']) && (int) $gd_post['franchise'] > 0 && geodir_franchise_check((int) $gd_post['franchise'])) {
|
|
| 5502 | + geodir_save_post_meta($saved_post_id, 'franchise', (int) $gd_post['franchise']); |
|
| 5503 | 5503 | } |
| 5504 | 5504 | } |
| 5505 | 5505 | } |
| 5506 | 5506 | |
| 5507 | 5507 | if (!empty($save_post['post_category']) && is_array($save_post['post_category'])) {
|
| 5508 | - $save_post['post_category'] = array_unique( array_map( 'intval', $save_post['post_category'] ) ); |
|
| 5508 | + $save_post['post_category'] = array_unique(array_map('intval', $save_post['post_category']));
|
|
| 5509 | 5509 | if ($default_category_id) {
|
| 5510 | 5510 | $save_post['post_default_category'] = $default_category_id; |
| 5511 | 5511 | $gd_post['default_category'] = $default_category_id; |
@@ -5514,12 +5514,12 @@ discard block |
||
| 5514 | 5514 | } |
| 5515 | 5515 | |
| 5516 | 5516 | // Save post info |
| 5517 | - geodir_save_post_info( $saved_post_id, $gd_post ); |
|
| 5517 | + geodir_save_post_info($saved_post_id, $gd_post); |
|
| 5518 | 5518 | // post taxonomies |
| 5519 | - if ( !empty( $save_post['post_category'] ) ) {
|
|
| 5520 | - wp_set_object_terms( $saved_post_id, $save_post['post_category'], $cat_taxonomy ); |
|
| 5519 | + if (!empty($save_post['post_category'])) {
|
|
| 5520 | + wp_set_object_terms($saved_post_id, $save_post['post_category'], $cat_taxonomy); |
|
| 5521 | 5521 | |
| 5522 | - $post_default_category = isset( $save_post['post_default_category'] ) ? $save_post['post_default_category'] : ''; |
|
| 5522 | + $post_default_category = isset($save_post['post_default_category']) ? $save_post['post_default_category'] : ''; |
|
| 5523 | 5523 | if ($default_category_id) {
|
| 5524 | 5524 | $post_default_category = $default_category_id; |
| 5525 | 5525 | } |
@@ -5533,15 +5533,15 @@ discard block |
||
| 5533 | 5533 | |
| 5534 | 5534 | $post_category_str = $post_category_str != '' ? array($cat_taxonomy => $post_category_str) : ''; |
| 5535 | 5535 | |
| 5536 | - geodir_set_postcat_structure( $saved_post_id, $cat_taxonomy, $post_default_category, $post_category_str ); |
|
| 5536 | + geodir_set_postcat_structure($saved_post_id, $cat_taxonomy, $post_default_category, $post_category_str); |
|
| 5537 | 5537 | } |
| 5538 | 5538 | |
| 5539 | - if ( !empty( $save_post['post_tags'] ) ) {
|
|
| 5540 | - wp_set_object_terms( $saved_post_id, $save_post['post_tags'], $tags_taxonomy ); |
|
| 5539 | + if (!empty($save_post['post_tags'])) {
|
|
| 5540 | + wp_set_object_terms($saved_post_id, $save_post['post_tags'], $tags_taxonomy); |
|
| 5541 | 5541 | } |
| 5542 | 5542 | |
| 5543 | 5543 | // Post images |
| 5544 | - if ( !empty( $post_images ) ) {
|
|
| 5544 | + if (!empty($post_images)) {
|
|
| 5545 | 5545 | $post_images = array_unique($post_images); |
| 5546 | 5546 | |
| 5547 | 5547 | $old_post_images_arr = array(); |
@@ -5549,30 +5549,30 @@ discard block |
||
| 5549 | 5549 | |
| 5550 | 5550 | $order = 1; |
| 5551 | 5551 | |
| 5552 | - $old_post_images = geodir_get_images( $saved_post_id ); |
|
| 5552 | + $old_post_images = geodir_get_images($saved_post_id); |
|
| 5553 | 5553 | if (!empty($old_post_images)) {
|
| 5554 | - foreach( $old_post_images as $old_post_image ) {
|
|
| 5554 | + foreach ($old_post_images as $old_post_image) {
|
|
| 5555 | 5555 | if (!empty($old_post_image) && isset($old_post_image->file) && $old_post_image->file != '') {
|
| 5556 | 5556 | $old_post_images_arr[] = $old_post_image->file; |
| 5557 | 5557 | } |
| 5558 | 5558 | } |
| 5559 | 5559 | } |
| 5560 | 5560 | |
| 5561 | - foreach ( $post_images as $post_image ) {
|
|
| 5562 | - $image_name = basename( $post_image ); |
|
| 5561 | + foreach ($post_images as $post_image) {
|
|
| 5562 | + $image_name = basename($post_image); |
|
| 5563 | 5563 | $saved_post_images_arr[] = $image_name; |
| 5564 | 5564 | |
| 5565 | - if (!empty($old_post_images_arr) && in_array( $image_name, $old_post_images_arr) ) {
|
|
| 5565 | + if (!empty($old_post_images_arr) && in_array($image_name, $old_post_images_arr)) {
|
|
| 5566 | 5566 | continue; // Skip if image already exists. |
| 5567 | 5567 | } |
| 5568 | 5568 | |
| 5569 | - $image_name_parts = explode( '.', $image_name ); |
|
| 5570 | - array_pop( $image_name_parts ); |
|
| 5571 | - $proper_image_name = implode( '.', $image_name_parts ); |
|
| 5569 | + $image_name_parts = explode('.', $image_name);
|
|
| 5570 | + array_pop($image_name_parts); |
|
| 5571 | + $proper_image_name = implode('.', $image_name_parts);
|
|
| 5572 | 5572 | |
| 5573 | - $arr_file_type = wp_check_filetype( $image_name ); |
|
| 5573 | + $arr_file_type = wp_check_filetype($image_name); |
|
| 5574 | 5574 | |
| 5575 | - if ( !empty( $arr_file_type ) ) {
|
|
| 5575 | + if (!empty($arr_file_type)) {
|
|
| 5576 | 5576 | $uploaded_file_type = $arr_file_type['type']; |
| 5577 | 5577 | |
| 5578 | 5578 | $attachment = array(); |
@@ -5585,46 +5585,46 @@ discard block |
||
| 5585 | 5585 | $attachment['is_featured'] = 0; |
| 5586 | 5586 | |
| 5587 | 5587 | $attachment_set = ''; |
| 5588 | - foreach ( $attachment as $key => $val ) {
|
|
| 5589 | - if ( $val != '' ) {
|
|
| 5588 | + foreach ($attachment as $key => $val) {
|
|
| 5589 | + if ($val != '') {
|
|
| 5590 | 5590 | $attachment_set .= $key . " = '" . $val . "', "; |
| 5591 | 5591 | } |
| 5592 | 5592 | } |
| 5593 | - $attachment_set = trim( $attachment_set, ", " ); |
|
| 5593 | + $attachment_set = trim($attachment_set, ", "); |
|
| 5594 | 5594 | |
| 5595 | 5595 | // Add new attachment |
| 5596 | - $wpdb->query( "INSERT INTO " . GEODIR_ATTACHMENT_TABLE . " SET " . $attachment_set ); |
|
| 5596 | + $wpdb->query("INSERT INTO " . GEODIR_ATTACHMENT_TABLE . " SET " . $attachment_set);
|
|
| 5597 | 5597 | |
| 5598 | 5598 | $order++; |
| 5599 | 5599 | } |
| 5600 | 5600 | } |
| 5601 | 5601 | |
| 5602 | - $saved_post_images_sql = !empty($saved_post_images_arr) ? " AND ( file NOT LIKE '%/" . implode("' AND file NOT LIKE '%/", $saved_post_images_arr) . "' )" : '';
|
|
| 5602 | + $saved_post_images_sql = !empty($saved_post_images_arr) ? " AND ( file NOT LIKE '%/" . implode("' AND file NOT LIKE '%/", $saved_post_images_arr) . "' )" : '';
|
|
| 5603 | 5603 | // Remove previous attachment |
| 5604 | - $wpdb->query( "DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id = " . (int)$saved_post_id . " " . $saved_post_images_sql ); |
|
| 5604 | + $wpdb->query("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id = " . (int) $saved_post_id . " " . $saved_post_images_sql);
|
|
| 5605 | 5605 | |
| 5606 | - if ( !empty( $saved_post_images_arr ) ) {
|
|
| 5606 | + if (!empty($saved_post_images_arr)) {
|
|
| 5607 | 5607 | $menu_order = 1; |
| 5608 | 5608 | |
| 5609 | - foreach ( $saved_post_images_arr as $img_name ) {
|
|
| 5610 | - $wpdb->query( $wpdb->prepare( "UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order = %d WHERE post_id =%d AND file LIKE %s", array( $menu_order, $saved_post_id, '%/' . $img_name ) ) ); |
|
| 5609 | + foreach ($saved_post_images_arr as $img_name) {
|
|
| 5610 | + $wpdb->query($wpdb->prepare("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order = %d WHERE post_id =%d AND file LIKE %s", array($menu_order, $saved_post_id, '%/' . $img_name)));
|
|
| 5611 | 5611 | |
| 5612 | - if( $menu_order == 1 ) {
|
|
| 5613 | - if ( $featured_image = $wpdb->get_var( $wpdb->prepare( "SELECT file FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id =%d AND file LIKE %s", array( $saved_post_id, '%/' . $img_name ) ) ) ) {
|
|
| 5614 | - $wpdb->query( $wpdb->prepare( "UPDATE " . $table . " SET featured_image = %s WHERE post_id =%d", array( $featured_image, $saved_post_id ) ) ); |
|
| 5612 | + if ($menu_order == 1) {
|
|
| 5613 | + if ($featured_image = $wpdb->get_var($wpdb->prepare("SELECT file FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id =%d AND file LIKE %s", array($saved_post_id, '%/' . $img_name)))) {
|
|
| 5614 | + $wpdb->query($wpdb->prepare("UPDATE " . $table . " SET featured_image = %s WHERE post_id =%d", array($featured_image, $saved_post_id)));
|
|
| 5615 | 5615 | } |
| 5616 | 5616 | } |
| 5617 | 5617 | $menu_order++; |
| 5618 | 5618 | } |
| 5619 | 5619 | } |
| 5620 | 5620 | |
| 5621 | - if ( $order > 1 ) {
|
|
| 5621 | + if ($order > 1) {
|
|
| 5622 | 5622 | $images++; |
| 5623 | 5623 | } |
| 5624 | 5624 | } |
| 5625 | 5625 | |
| 5626 | 5626 | /** This action is documented in geodirectory-functions/post-functions.php */ |
| 5627 | - do_action( 'geodir_after_save_listing', $saved_post_id, $gd_post ); |
|
| 5627 | + do_action('geodir_after_save_listing', $saved_post_id, $gd_post);
|
|
| 5628 | 5628 | |
| 5629 | 5629 | if (isset($is_featured)) {
|
| 5630 | 5630 | geodir_save_post_meta($saved_post_id, 'is_featured', $is_featured); |
@@ -5644,10 +5644,10 @@ discard block |
||
| 5644 | 5644 | } |
| 5645 | 5645 | |
| 5646 | 5646 | //undo some stuff to make the import quicker |
| 5647 | - wp_defer_term_counting( false ); |
|
| 5648 | - wp_defer_comment_counting( false ); |
|
| 5649 | - $wpdb->query( 'COMMIT;' ); |
|
| 5650 | - $wpdb->query( 'SET autocommit = 1;' ); |
|
| 5647 | + wp_defer_term_counting(false); |
|
| 5648 | + wp_defer_comment_counting(false); |
|
| 5649 | + $wpdb->query('COMMIT;');
|
|
| 5650 | + $wpdb->query('SET autocommit = 1;');
|
|
| 5651 | 5651 | |
| 5652 | 5652 | $json = array(); |
| 5653 | 5653 | $json['processed'] = $processed_actual; |
@@ -5658,9 +5658,9 @@ discard block |
||
| 5658 | 5658 | $json['invalid_addr'] = $invalid_addr; |
| 5659 | 5659 | $json['images'] = $images; |
| 5660 | 5660 | |
| 5661 | - wp_send_json( $json ); |
|
| 5661 | + wp_send_json($json); |
|
| 5662 | 5662 | exit; |
| 5663 | - } else if ( $task == 'import_loc' ) {
|
|
| 5663 | + } else if ($task == 'import_loc') {
|
|
| 5664 | 5664 | global $gd_post_types; |
| 5665 | 5665 | $gd_post_types = $post_types; |
| 5666 | 5666 | |
@@ -5669,7 +5669,7 @@ discard block |
||
| 5669 | 5669 | |
| 5670 | 5670 | if (empty($columns) || (!empty($columns) && $columns[0] == '')) {
|
| 5671 | 5671 | $json['error'] = __('File you are uploading is not valid. Columns does not matching.', 'geodirectory');
|
| 5672 | - wp_send_json( $json ); |
|
| 5672 | + wp_send_json($json); |
|
| 5673 | 5673 | } |
| 5674 | 5674 | |
| 5675 | 5675 | for ($i = 1; $i <= $limit; $i++) {
|
@@ -5677,59 +5677,59 @@ discard block |
||
| 5677 | 5677 | |
| 5678 | 5678 | if (isset($file[$index])) {
|
| 5679 | 5679 | $row = $file[$index]; |
| 5680 | - $row = array_map( 'trim', $row ); |
|
| 5680 | + $row = array_map('trim', $row);
|
|
| 5681 | 5681 | $data = array(); |
| 5682 | 5682 | |
| 5683 | - foreach ($columns as $c => $column ) {
|
|
| 5683 | + foreach ($columns as $c => $column) {
|
|
| 5684 | 5684 | if (in_array($column, array('location_id', 'latitude', 'longitude', 'city', 'city_slug', 'region', 'country', 'city_meta', 'city_desc', 'region_meta', 'region_desc', 'country_meta', 'country_desc'))) {
|
| 5685 | 5685 | $data[$column] = $row[$c]; |
| 5686 | 5686 | } |
| 5687 | 5687 | } |
| 5688 | 5688 | |
| 5689 | - if ( empty($data['city']) || empty($data['region']) || empty($data['country']) || empty($data['latitude']) || empty($data['longitude']) ) {
|
|
| 5689 | + if (empty($data['city']) || empty($data['region']) || empty($data['country']) || empty($data['latitude']) || empty($data['longitude'])) {
|
|
| 5690 | 5690 | $invalid++; |
| 5691 | 5691 | continue; |
| 5692 | 5692 | } |
| 5693 | 5693 | |
| 5694 | 5694 | $data['location_id'] = isset($data['location_id']) ? absint($data['location_id']) : 0; |
| 5695 | 5695 | |
| 5696 | - if ( $import_choice == 'update' ) {
|
|
| 5697 | - if ( (int)$data['location_id'] > 0 && $location = geodir_get_location_by_id( '', (int)$data['location_id'] ) ) {
|
|
| 5698 | - if ( $location_id = geodir_location_update_city( $data, true, $location ) ) {
|
|
| 5696 | + if ($import_choice == 'update') {
|
|
| 5697 | + if ((int) $data['location_id'] > 0 && $location = geodir_get_location_by_id('', (int) $data['location_id'])) {
|
|
| 5698 | + if ($location_id = geodir_location_update_city($data, true, $location)) {
|
|
| 5699 | 5699 | $updated++; |
| 5700 | 5700 | } else {
|
| 5701 | 5701 | $invalid++; |
| 5702 | 5702 | } |
| 5703 | - } else if ( !empty( $data['city_slug'] ) && $location = geodir_get_location_by_slug( 'city', array( 'city_slug' => $data['city_slug'] ) ) ) {
|
|
| 5704 | - $data['location_id'] = (int)$location->location_id; |
|
| 5703 | + } else if (!empty($data['city_slug']) && $location = geodir_get_location_by_slug('city', array('city_slug' => $data['city_slug']))) {
|
|
| 5704 | + $data['location_id'] = (int) $location->location_id; |
|
| 5705 | 5705 | |
| 5706 | - if ( $location = geodir_get_location_by_slug( 'city', array( 'city_slug' => $data['city_slug'], 'country' => $data['country'], 'region' => $data['region'] ) ) ) {
|
|
| 5707 | - $data['location_id'] = (int)$location->location_id; |
|
| 5708 | - } else if ( $location = geodir_get_location_by_slug( 'city', array( 'city_slug' => $data['city_slug'], 'region' => $data['region'] ) ) ) {
|
|
| 5709 | - $data['location_id'] = (int)$location->location_id; |
|
| 5710 | - } else if ( $location = geodir_get_location_by_slug( 'city', array( 'city_slug' => $data['city_slug'], 'country' => $data['country'] ) ) ) {
|
|
| 5711 | - $data['location_id'] = (int)$location->location_id; |
|
| 5706 | + if ($location = geodir_get_location_by_slug('city', array('city_slug' => $data['city_slug'], 'country' => $data['country'], 'region' => $data['region']))) {
|
|
| 5707 | + $data['location_id'] = (int) $location->location_id; |
|
| 5708 | + } else if ($location = geodir_get_location_by_slug('city', array('city_slug' => $data['city_slug'], 'region' => $data['region']))) {
|
|
| 5709 | + $data['location_id'] = (int) $location->location_id; |
|
| 5710 | + } else if ($location = geodir_get_location_by_slug('city', array('city_slug' => $data['city_slug'], 'country' => $data['country']))) {
|
|
| 5711 | + $data['location_id'] = (int) $location->location_id; |
|
| 5712 | 5712 | } |
| 5713 | 5713 | |
| 5714 | - if ( $location_id = geodir_location_update_city( $data, true, $location ) ) {
|
|
| 5714 | + if ($location_id = geodir_location_update_city($data, true, $location)) {
|
|
| 5715 | 5715 | $updated++; |
| 5716 | 5716 | } else {
|
| 5717 | 5717 | $invalid++; |
| 5718 | 5718 | } |
| 5719 | 5719 | } else {
|
| 5720 | - if ( $location_id = geodir_location_insert_city( $data, true ) ) {
|
|
| 5720 | + if ($location_id = geodir_location_insert_city($data, true)) {
|
|
| 5721 | 5721 | $created++; |
| 5722 | 5722 | } else {
|
| 5723 | 5723 | $invalid++; |
| 5724 | 5724 | } |
| 5725 | 5725 | } |
| 5726 | - } elseif ( $import_choice == 'skip' ) {
|
|
| 5727 | - if ( (int)$data['location_id'] > 0 && $location = geodir_get_location_by_id( '', (int)$data['location_id'] ) ) {
|
|
| 5726 | + } elseif ($import_choice == 'skip') {
|
|
| 5727 | + if ((int) $data['location_id'] > 0 && $location = geodir_get_location_by_id('', (int) $data['location_id'])) {
|
|
| 5728 | 5728 | $skipped++; |
| 5729 | - } else if ( !empty( $data['city_slug'] ) && $location = geodir_get_location_by_slug( 'city', array( 'city_slug' => $data['city_slug'] ) ) ) {
|
|
| 5729 | + } else if (!empty($data['city_slug']) && $location = geodir_get_location_by_slug('city', array('city_slug' => $data['city_slug']))) {
|
|
| 5730 | 5730 | $skipped++; |
| 5731 | 5731 | } else {
|
| 5732 | - if ( $location_id = geodir_location_insert_city( $data, true ) ) {
|
|
| 5732 | + if ($location_id = geodir_location_insert_city($data, true)) {
|
|
| 5733 | 5733 | $created++; |
| 5734 | 5734 | } else {
|
| 5735 | 5735 | $invalid++; |
@@ -5750,7 +5750,7 @@ discard block |
||
| 5750 | 5750 | $json['invalid'] = $invalid; |
| 5751 | 5751 | $json['images'] = $images; |
| 5752 | 5752 | |
| 5753 | - wp_send_json( $json ); |
|
| 5753 | + wp_send_json($json); |
|
| 5754 | 5754 | } |
| 5755 | 5755 | } |
| 5756 | 5756 | break; |
@@ -5794,29 +5794,29 @@ discard block |
||
| 5794 | 5794 | * } |
| 5795 | 5795 | * @return int|bool Term id when success, false when fail. |
| 5796 | 5796 | */ |
| 5797 | -function geodir_imex_insert_term( $taxonomy, $term_data ) {
|
|
| 5798 | - if ( empty( $taxonomy ) || empty( $term_data ) ) {
|
|
| 5797 | +function geodir_imex_insert_term($taxonomy, $term_data) {
|
|
| 5798 | + if (empty($taxonomy) || empty($term_data)) {
|
|
| 5799 | 5799 | return false; |
| 5800 | 5800 | } |
| 5801 | 5801 | |
| 5802 | - $term = isset( $term_data['name'] ) && !empty( $term_data['name'] ) ? $term_data['name'] : ''; |
|
| 5802 | + $term = isset($term_data['name']) && !empty($term_data['name']) ? $term_data['name'] : ''; |
|
| 5803 | 5803 | $args = array(); |
| 5804 | - $args['description'] = isset( $term_data['description'] ) ? $term_data['description'] : ''; |
|
| 5805 | - $args['slug'] = isset( $term_data['slug'] ) ? $term_data['slug'] : ''; |
|
| 5806 | - $args['parent'] = isset( $term_data['parent'] ) ? (int)$term_data['parent'] : ''; |
|
| 5804 | + $args['description'] = isset($term_data['description']) ? $term_data['description'] : ''; |
|
| 5805 | + $args['slug'] = isset($term_data['slug']) ? $term_data['slug'] : ''; |
|
| 5806 | + $args['parent'] = isset($term_data['parent']) ? (int) $term_data['parent'] : ''; |
|
| 5807 | 5807 | |
| 5808 | - if ( ( !empty( $args['slug'] ) && term_exists( $args['slug'], $taxonomy ) ) || empty( $args['slug'] ) ) {
|
|
| 5809 | - $term_args = array_merge( $term_data, $args ); |
|
| 5810 | - $defaults = array( 'alias_of' => '', 'description' => '', 'parent' => 0, 'slug' => ''); |
|
| 5811 | - $term_args = wp_parse_args( $term_args, $defaults ); |
|
| 5812 | - $term_args = sanitize_term( $term_args, $taxonomy, 'db' ); |
|
| 5813 | - $args['slug'] = wp_unique_term_slug( $args['slug'], (object)$term_args ); |
|
| 5808 | + if ((!empty($args['slug']) && term_exists($args['slug'], $taxonomy)) || empty($args['slug'])) {
|
|
| 5809 | + $term_args = array_merge($term_data, $args); |
|
| 5810 | + $defaults = array('alias_of' => '', 'description' => '', 'parent' => 0, 'slug' => '');
|
|
| 5811 | + $term_args = wp_parse_args($term_args, $defaults); |
|
| 5812 | + $term_args = sanitize_term($term_args, $taxonomy, 'db'); |
|
| 5813 | + $args['slug'] = wp_unique_term_slug($args['slug'], (object) $term_args); |
|
| 5814 | 5814 | } |
| 5815 | 5815 | |
| 5816 | - if( !empty( $term ) ) {
|
|
| 5817 | - $result = wp_insert_term( $term, $taxonomy, $args ); |
|
| 5818 | - if( !is_wp_error( $result ) ) {
|
|
| 5819 | - return $term_id = isset( $result['term_id'] ) ? $result['term_id'] : 0; |
|
| 5816 | + if (!empty($term)) {
|
|
| 5817 | + $result = wp_insert_term($term, $taxonomy, $args); |
|
| 5818 | + if (!is_wp_error($result)) {
|
|
| 5819 | + return $term_id = isset($result['term_id']) ? $result['term_id'] : 0; |
|
| 5820 | 5820 | } |
| 5821 | 5821 | } |
| 5822 | 5822 | |
@@ -5846,37 +5846,37 @@ discard block |
||
| 5846 | 5846 | * } |
| 5847 | 5847 | * @return int|bool Term id when success, false when fail. |
| 5848 | 5848 | */ |
| 5849 | -function geodir_imex_update_term( $taxonomy, $term_data ) {
|
|
| 5850 | - if ( empty( $taxonomy ) || empty( $term_data ) ) {
|
|
| 5849 | +function geodir_imex_update_term($taxonomy, $term_data) {
|
|
| 5850 | + if (empty($taxonomy) || empty($term_data)) {
|
|
| 5851 | 5851 | return false; |
| 5852 | 5852 | } |
| 5853 | 5853 | |
| 5854 | - $term = isset( $term_data['name'] ) && !empty( $term_data['name'] ) ? $term_data['name'] : ''; |
|
| 5855 | - $term_id = isset( $term_data['term_id'] ) && !empty( $term_data['term_id'] ) ? $term_data['term_id'] : 0; |
|
| 5854 | + $term = isset($term_data['name']) && !empty($term_data['name']) ? $term_data['name'] : ''; |
|
| 5855 | + $term_id = isset($term_data['term_id']) && !empty($term_data['term_id']) ? $term_data['term_id'] : 0; |
|
| 5856 | 5856 | |
| 5857 | 5857 | $args = array(); |
| 5858 | - $args['description'] = isset( $term_data['description'] ) ? $term_data['description'] : ''; |
|
| 5859 | - $args['slug'] = isset( $term_data['slug'] ) ? $term_data['slug'] : ''; |
|
| 5860 | - $args['parent'] = isset( $term_data['parent'] ) ? (int)$term_data['parent'] : ''; |
|
| 5858 | + $args['description'] = isset($term_data['description']) ? $term_data['description'] : ''; |
|
| 5859 | + $args['slug'] = isset($term_data['slug']) ? $term_data['slug'] : ''; |
|
| 5860 | + $args['parent'] = isset($term_data['parent']) ? (int) $term_data['parent'] : ''; |
|
| 5861 | 5861 | |
| 5862 | - if ( $term_id > 0 && $term_info = (array)get_term( $term_id, $taxonomy ) ) {
|
|
| 5862 | + if ($term_id > 0 && $term_info = (array) get_term($term_id, $taxonomy)) {
|
|
| 5863 | 5863 | $term_data['term_id'] = $term_info['term_id']; |
| 5864 | 5864 | |
| 5865 | - $result = wp_update_term( $term_data['term_id'], $taxonomy, $term_data ); |
|
| 5865 | + $result = wp_update_term($term_data['term_id'], $taxonomy, $term_data); |
|
| 5866 | 5866 | |
| 5867 | - if( !is_wp_error( $result ) ) {
|
|
| 5868 | - return $term_id = isset( $result['term_id'] ) ? $result['term_id'] : 0; |
|
| 5867 | + if (!is_wp_error($result)) {
|
|
| 5868 | + return $term_id = isset($result['term_id']) ? $result['term_id'] : 0; |
|
| 5869 | 5869 | } |
| 5870 | - } else if ( $term_data['slug'] != '' && $term_info = (array)term_exists( $term_data['slug'], $taxonomy ) ) {
|
|
| 5870 | + } else if ($term_data['slug'] != '' && $term_info = (array) term_exists($term_data['slug'], $taxonomy)) {
|
|
| 5871 | 5871 | $term_data['term_id'] = $term_info['term_id']; |
| 5872 | 5872 | |
| 5873 | - $result = wp_update_term( $term_data['term_id'], $taxonomy, $term_data ); |
|
| 5873 | + $result = wp_update_term($term_data['term_id'], $taxonomy, $term_data); |
|
| 5874 | 5874 | |
| 5875 | - if( !is_wp_error( $result ) ) {
|
|
| 5876 | - return $term_id = isset( $result['term_id'] ) ? $result['term_id'] : 0; |
|
| 5875 | + if (!is_wp_error($result)) {
|
|
| 5876 | + return $term_id = isset($result['term_id']) ? $result['term_id'] : 0; |
|
| 5877 | 5877 | } |
| 5878 | 5878 | } else {
|
| 5879 | - return geodir_imex_insert_term( $taxonomy, $term_data ); |
|
| 5879 | + return geodir_imex_insert_term($taxonomy, $term_data); |
|
| 5880 | 5880 | } |
| 5881 | 5881 | |
| 5882 | 5882 | return false; |
@@ -5891,9 +5891,9 @@ discard block |
||
| 5891 | 5891 | * @param string $post_type Post type. |
| 5892 | 5892 | * @return int Posts count. |
| 5893 | 5893 | */ |
| 5894 | -function geodir_get_posts_count( $post_type ) {
|
|
| 5895 | - $posts_count = wp_count_posts( $post_type ); |
|
| 5896 | - $posts_count = array_sum( (array)$posts_count ); |
|
| 5894 | +function geodir_get_posts_count($post_type) {
|
|
| 5895 | + $posts_count = wp_count_posts($post_type); |
|
| 5896 | + $posts_count = array_sum((array) $posts_count); |
|
| 5897 | 5897 | |
| 5898 | 5898 | /** |
| 5899 | 5899 | * Modify returned post counts for the current post type. |
@@ -5904,7 +5904,7 @@ discard block |
||
| 5904 | 5904 | * @param int $posts_count Post counts. |
| 5905 | 5905 | * @param string $post_type Post type. |
| 5906 | 5906 | */ |
| 5907 | - $posts_count = apply_filters( 'geodir_imex_count_posts', $posts_count, $post_type ); |
|
| 5907 | + $posts_count = apply_filters('geodir_imex_count_posts', $posts_count, $post_type);
|
|
| 5908 | 5908 | |
| 5909 | 5909 | return $posts_count; |
| 5910 | 5910 | } |
@@ -5922,8 +5922,8 @@ discard block |
||
| 5922 | 5922 | * @param string $post_type Post type. |
| 5923 | 5923 | * @return int Posts count. |
| 5924 | 5924 | */ |
| 5925 | -function geodir_imex_count_events( $posts_count, $post_type ) {
|
|
| 5926 | - if ( $post_type == 'gd_event' ) {
|
|
| 5925 | +function geodir_imex_count_events($posts_count, $post_type) {
|
|
| 5926 | + if ($post_type == 'gd_event') {
|
|
| 5927 | 5927 | global $wpdb, $plugin_prefix; |
| 5928 | 5928 | |
| 5929 | 5929 | $table = $plugin_prefix . $post_type . '_detail'; |
@@ -5931,7 +5931,7 @@ discard block |
||
| 5931 | 5931 | |
| 5932 | 5932 | $query = "SELECT COUNT({$wpdb->posts}.ID) AS total FROM {$wpdb->posts} INNER JOIN {$table} ON ({$table}.post_id = {$wpdb->posts}.ID) INNER JOIN {$schedule_table} ON ({$schedule_table}.event_id = {$wpdb->posts}.ID) WHERE {$wpdb->posts}.post_type = %s";
|
| 5933 | 5933 | |
| 5934 | - $posts_count = (int)$wpdb->get_var( $wpdb->prepare( $query, $post_type ) ); |
|
| 5934 | + $posts_count = (int) $wpdb->get_var($wpdb->prepare($query, $post_type)); |
|
| 5935 | 5935 | } |
| 5936 | 5936 | |
| 5937 | 5937 | return $posts_count; |
@@ -5953,15 +5953,15 @@ discard block |
||
| 5953 | 5953 | * @param int $page_no Page number. Default 0. |
| 5954 | 5954 | * @return array Array of posts data. |
| 5955 | 5955 | */ |
| 5956 | -function geodir_imex_get_posts( $post_type, $per_page = 0, $page_no = 0 ) {
|
|
| 5956 | +function geodir_imex_get_posts($post_type, $per_page = 0, $page_no = 0) {
|
|
| 5957 | 5957 | global $wp_filesystem; |
| 5958 | 5958 | |
| 5959 | - $posts = geodir_get_export_posts( $post_type, $per_page, $page_no ); |
|
| 5959 | + $posts = geodir_get_export_posts($post_type, $per_page, $page_no); |
|
| 5960 | 5960 | |
| 5961 | 5961 | $csv_rows = array(); |
| 5962 | 5962 | |
| 5963 | - if ( !empty( $posts ) ) {
|
|
| 5964 | - $is_payment_plugin = is_plugin_active( 'geodir_payment_manager/geodir_payment_manager.php' ); |
|
| 5963 | + if (!empty($posts)) {
|
|
| 5964 | + $is_payment_plugin = is_plugin_active('geodir_payment_manager/geodir_payment_manager.php');
|
|
| 5965 | 5965 | |
| 5966 | 5966 | $csv_row = array(); |
| 5967 | 5967 | $csv_row[] = 'post_id'; |
@@ -5972,7 +5972,7 @@ discard block |
||
| 5972 | 5972 | $csv_row[] = 'default_category'; |
| 5973 | 5973 | $csv_row[] = 'post_tags'; |
| 5974 | 5974 | $csv_row[] = 'post_type'; |
| 5975 | - if ( $post_type == 'gd_event' ) {
|
|
| 5975 | + if ($post_type == 'gd_event') {
|
|
| 5976 | 5976 | $csv_row[] = 'event_date'; |
| 5977 | 5977 | $csv_row[] = 'event_enddate'; |
| 5978 | 5978 | $csv_row[] = 'starttime'; |
@@ -6021,15 +6021,15 @@ discard block |
||
| 6021 | 6021 | } |
| 6022 | 6022 | // WPML |
| 6023 | 6023 | |
| 6024 | - $custom_fields = geodir_imex_get_custom_fields( $post_type ); |
|
| 6025 | - if ( !empty( $custom_fields ) ) {
|
|
| 6026 | - foreach ( $custom_fields as $custom_field ) {
|
|
| 6024 | + $custom_fields = geodir_imex_get_custom_fields($post_type); |
|
| 6025 | + if (!empty($custom_fields)) {
|
|
| 6026 | + foreach ($custom_fields as $custom_field) {
|
|
| 6027 | 6027 | $csv_row[] = $custom_field->htmlvar_name; |
| 6028 | 6028 | } |
| 6029 | 6029 | } |
| 6030 | 6030 | |
| 6031 | 6031 | // Export franchise fields |
| 6032 | - $is_franchise_active = is_plugin_active( 'geodir_franchise/geodir_franchise.php' ) && geodir_franchise_enabled( $post_type ) ? true : false; |
|
| 6032 | + $is_franchise_active = is_plugin_active('geodir_franchise/geodir_franchise.php') && geodir_franchise_enabled($post_type) ? true : false;
|
|
| 6033 | 6033 | if ($is_franchise_active) {
|
| 6034 | 6034 | $csv_row[] = 'gd_is_franchise'; |
| 6035 | 6035 | $csv_row[] = 'gd_franchise_lock'; |
@@ -6039,12 +6039,12 @@ discard block |
||
| 6039 | 6039 | $csv_rows[] = $csv_row; |
| 6040 | 6040 | |
| 6041 | 6041 | $images_count = 5; |
| 6042 | - $xx=0; |
|
| 6043 | - foreach ( $posts as $post ) {$xx++;
|
|
| 6042 | + $xx = 0; |
|
| 6043 | + foreach ($posts as $post) {$xx++;
|
|
| 6044 | 6044 | $post_id = $post['ID']; |
| 6045 | 6045 | |
| 6046 | - $gd_post_info = geodir_get_post_info( $post_id ); |
|
| 6047 | - $post_info = (array)$gd_post_info; |
|
| 6046 | + $gd_post_info = geodir_get_post_info($post_id); |
|
| 6047 | + $post_info = (array) $gd_post_info; |
|
| 6048 | 6048 | |
| 6049 | 6049 | $taxonomy_category = $post_type . 'category'; |
| 6050 | 6050 | $taxonomy_tags = $post_type . '_tags'; |
@@ -6053,14 +6053,14 @@ discard block |
||
| 6053 | 6053 | $default_category_id = $gd_post_info->default_category; |
| 6054 | 6054 | $default_category = ''; |
| 6055 | 6055 | $post_tags = ''; |
| 6056 | - $terms = wp_get_post_terms( $post_id, array( $taxonomy_category, $taxonomy_tags ) ); |
|
| 6056 | + $terms = wp_get_post_terms($post_id, array($taxonomy_category, $taxonomy_tags)); |
|
| 6057 | 6057 | |
| 6058 | - if ( !empty( $terms ) && !is_wp_error( $terms ) ) {
|
|
| 6058 | + if (!empty($terms) && !is_wp_error($terms)) {
|
|
| 6059 | 6059 | $post_category = array(); |
| 6060 | 6060 | $post_tags = array(); |
| 6061 | 6061 | |
| 6062 | - foreach ( $terms as $term ) {
|
|
| 6063 | - if ( $term->taxonomy == $taxonomy_category ) {
|
|
| 6062 | + foreach ($terms as $term) {
|
|
| 6063 | + if ($term->taxonomy == $taxonomy_category) {
|
|
| 6064 | 6064 | $post_category[] = $term->name; |
| 6065 | 6065 | |
| 6066 | 6066 | if ($default_category_id == $term->term_id) {
|
@@ -6068,7 +6068,7 @@ discard block |
||
| 6068 | 6068 | } |
| 6069 | 6069 | } |
| 6070 | 6070 | |
| 6071 | - if ( $term->taxonomy == $taxonomy_tags ) {
|
|
| 6071 | + if ($term->taxonomy == $taxonomy_tags) {
|
|
| 6072 | 6072 | $post_tags[] = $term->name; |
| 6073 | 6073 | } |
| 6074 | 6074 | } |
@@ -6076,8 +6076,8 @@ discard block |
||
| 6076 | 6076 | if (empty($default_category) && !empty($post_category)) {
|
| 6077 | 6077 | $default_category = $post_category[0]; // Set first one as default category. |
| 6078 | 6078 | } |
| 6079 | - $post_category = !empty( $post_category ) ? implode( ',', $post_category ) : ''; |
|
| 6080 | - $post_tags = !empty( $post_tags ) ? implode( ',', $post_tags ) : ''; |
|
| 6079 | + $post_category = !empty($post_category) ? implode(',', $post_category) : '';
|
|
| 6080 | + $post_tags = !empty($post_tags) ? implode(',', $post_tags) : '';
|
|
| 6081 | 6081 | } |
| 6082 | 6082 | |
| 6083 | 6083 | // Franchise data |
@@ -6085,42 +6085,42 @@ discard block |
||
| 6085 | 6085 | $franchise_info = array(); |
| 6086 | 6086 | $locked_fields = array(); |
| 6087 | 6087 | |
| 6088 | - if ($is_franchise_active && isset($post_info['franchise']) && (int)$post_info['franchise'] > 0 && geodir_franchise_check((int)$post_info['franchise'])) {
|
|
| 6088 | + if ($is_franchise_active && isset($post_info['franchise']) && (int) $post_info['franchise'] > 0 && geodir_franchise_check((int) $post_info['franchise'])) {
|
|
| 6089 | 6089 | $franchise_id = $post_info['franchise']; |
| 6090 | 6090 | $gd_franchise_info = geodir_get_post_info($franchise_id); |
| 6091 | 6091 | |
| 6092 | 6092 | if (geodir_franchise_pkg_is_active($gd_franchise_info)) {
|
| 6093 | - $franchise_info = (array)$gd_franchise_info; |
|
| 6093 | + $franchise_info = (array) $gd_franchise_info; |
|
| 6094 | 6094 | $locked_fields = geodir_franchise_get_locked_fields($franchise_id, true); |
| 6095 | 6095 | |
| 6096 | 6096 | if (!empty($locked_fields)) {
|
| 6097 | - foreach( $locked_fields as $locked_field) {
|
|
| 6097 | + foreach ($locked_fields as $locked_field) {
|
|
| 6098 | 6098 | if (isset($post_info[$locked_field]) && isset($franchise_info[$locked_field])) {
|
| 6099 | 6099 | $post_info[$locked_field] = $franchise_info[$locked_field]; |
| 6100 | 6100 | } |
| 6101 | 6101 | |
| 6102 | 6102 | if (in_array($taxonomy_category, $locked_fields) || in_array('post_tags', $locked_fields)) {
|
| 6103 | - $franchise_terms = wp_get_post_terms( $franchise_id, array( $taxonomy_category, $taxonomy_tags ) ); |
|
| 6103 | + $franchise_terms = wp_get_post_terms($franchise_id, array($taxonomy_category, $taxonomy_tags)); |
|
| 6104 | 6104 | |
| 6105 | - if ( !empty( $franchise_terms ) && !is_wp_error( $franchise_terms ) ) {
|
|
| 6105 | + if (!empty($franchise_terms) && !is_wp_error($franchise_terms)) {
|
|
| 6106 | 6106 | $franchise_post_category = array(); |
| 6107 | 6107 | $franchise_post_tags = array(); |
| 6108 | 6108 | |
| 6109 | - foreach ( $franchise_terms as $franchise_term ) {
|
|
| 6110 | - if ( $franchise_term->taxonomy == $taxonomy_category ) {
|
|
| 6109 | + foreach ($franchise_terms as $franchise_term) {
|
|
| 6110 | + if ($franchise_term->taxonomy == $taxonomy_category) {
|
|
| 6111 | 6111 | $franchise_post_category[] = $franchise_term->name; |
| 6112 | 6112 | } |
| 6113 | 6113 | |
| 6114 | - if ( $franchise_term->taxonomy == $taxonomy_tags ) {
|
|
| 6114 | + if ($franchise_term->taxonomy == $taxonomy_tags) {
|
|
| 6115 | 6115 | $franchise_post_tags[] = $franchise_term->name; |
| 6116 | 6116 | } |
| 6117 | 6117 | } |
| 6118 | 6118 | |
| 6119 | 6119 | if (in_array($taxonomy_category, $locked_fields)) {
|
| 6120 | - $post_category = !empty( $franchise_post_category ) ? implode( ',', $franchise_post_category ) : ''; |
|
| 6120 | + $post_category = !empty($franchise_post_category) ? implode(',', $franchise_post_category) : '';
|
|
| 6121 | 6121 | } |
| 6122 | 6122 | if (in_array('post_tags', $locked_fields)) {
|
| 6123 | - $post_tags = !empty( $franchise_post_tags ) ? implode( ',', $franchise_post_tags ) : ''; |
|
| 6123 | + $post_tags = !empty($franchise_post_tags) ? implode(',', $franchise_post_tags) : '';
|
|
| 6124 | 6124 | } |
| 6125 | 6125 | } |
| 6126 | 6126 | } |
@@ -6129,18 +6129,18 @@ discard block |
||
| 6129 | 6129 | } |
| 6130 | 6130 | } |
| 6131 | 6131 | |
| 6132 | - $post_images = geodir_get_images( $post_id ); |
|
| 6132 | + $post_images = geodir_get_images($post_id); |
|
| 6133 | 6133 | $current_images = array(); |
| 6134 | - if ( !empty( $post_images ) ) {
|
|
| 6135 | - foreach ( $post_images as $post_image ) {
|
|
| 6136 | - $post_image = (array)$post_image; |
|
| 6137 | - $image = !empty( $post_image ) && isset( $post_image['path'] ) && $wp_filesystem->is_file( $post_image['path'] ) && $wp_filesystem->exists( $post_image['path'] ) ? $post_image['src'] : ''; |
|
| 6138 | - if ( $image ) {
|
|
| 6134 | + if (!empty($post_images)) {
|
|
| 6135 | + foreach ($post_images as $post_image) {
|
|
| 6136 | + $post_image = (array) $post_image; |
|
| 6137 | + $image = !empty($post_image) && isset($post_image['path']) && $wp_filesystem->is_file($post_image['path']) && $wp_filesystem->exists($post_image['path']) ? $post_image['src'] : ''; |
|
| 6138 | + if ($image) {
|
|
| 6139 | 6139 | $current_images[] = $image; |
| 6140 | 6140 | } |
| 6141 | 6141 | } |
| 6142 | 6142 | |
| 6143 | - $images_count = max( $images_count, count( $current_images ) ); |
|
| 6143 | + $images_count = max($images_count, count($current_images)); |
|
| 6144 | 6144 | } |
| 6145 | 6145 | |
| 6146 | 6146 | $csv_row = array(); |
@@ -6152,7 +6152,7 @@ discard block |
||
| 6152 | 6152 | $csv_row[] = $default_category; // default_category |
| 6153 | 6153 | $csv_row[] = $post_tags; // post_tags |
| 6154 | 6154 | $csv_row[] = $post_type; // post_type |
| 6155 | - if ( $post_type == 'gd_event' ) {
|
|
| 6155 | + if ($post_type == 'gd_event') {
|
|
| 6156 | 6156 | $event_data = geodir_imex_get_event_data($post, $gd_post_info); |
| 6157 | 6157 | $csv_row[] = $event_data['event_date']; // event_date |
| 6158 | 6158 | $csv_row[] = $event_data['event_enddate']; // enddate |
@@ -6173,9 +6173,9 @@ discard block |
||
| 6173 | 6173 | $csv_row[] = $event_data['recurring_end_date']; // repeat_end |
| 6174 | 6174 | } |
| 6175 | 6175 | $csv_row[] = $post_info['post_status']; // post_status |
| 6176 | - $csv_row[] = (int)$post_info['is_featured'] == 1 ? 1 : ''; // is_featured |
|
| 6176 | + $csv_row[] = (int) $post_info['is_featured'] == 1 ? 1 : ''; // is_featured |
|
| 6177 | 6177 | if ($is_payment_plugin) {
|
| 6178 | - $csv_row[] = (int)$post_info['package_id']; // package_id |
|
| 6178 | + $csv_row[] = (int) $post_info['package_id']; // package_id |
|
| 6179 | 6179 | $csv_row[] = $post_info['expire_date'] != '' && geodir_strtolower($post_info['expire_date']) != 'never' ? date_i18n('Y-m-d', strtotime($post_info['expire_date'])) : 'Never'; // expire_date
|
| 6180 | 6180 | } |
| 6181 | 6181 | $csv_row[] = $post_info['geodir_video']; // geodir_video |
@@ -6196,14 +6196,14 @@ discard block |
||
| 6196 | 6196 | $csv_row[] = $post_info['geodir_special_offers']; // geodir_special_offers |
| 6197 | 6197 | // WPML |
| 6198 | 6198 | if ($is_wpml) {
|
| 6199 | - $csv_row[] = geodir_get_language_for_element( $post_id, 'post_' . $post_type ); |
|
| 6200 | - $csv_row[] = geodir_imex_original_post_id( $post_id, 'post_' . $post_type ); |
|
| 6199 | + $csv_row[] = geodir_get_language_for_element($post_id, 'post_' . $post_type); |
|
| 6200 | + $csv_row[] = geodir_imex_original_post_id($post_id, 'post_' . $post_type); |
|
| 6201 | 6201 | } |
| 6202 | 6202 | // WPML |
| 6203 | 6203 | |
| 6204 | - if ( !empty( $custom_fields ) ) {
|
|
| 6205 | - foreach ( $custom_fields as $custom_field ) {
|
|
| 6206 | - $csv_row[] = isset( $post_info[$custom_field->htmlvar_name] ) ? $post_info[$custom_field->htmlvar_name] : ''; |
|
| 6204 | + if (!empty($custom_fields)) {
|
|
| 6205 | + foreach ($custom_fields as $custom_field) {
|
|
| 6206 | + $csv_row[] = isset($post_info[$custom_field->htmlvar_name]) ? $post_info[$custom_field->htmlvar_name] : ''; |
|
| 6207 | 6207 | } |
| 6208 | 6208 | } |
| 6209 | 6209 | |
@@ -6214,26 +6214,26 @@ discard block |
||
| 6214 | 6214 | $franchise = ''; |
| 6215 | 6215 | |
| 6216 | 6216 | if (geodir_franchise_pkg_is_active($gd_post_info)) {
|
| 6217 | - $gd_is_franchise = (int)get_post_meta( $post_id, 'gd_is_franchise', true ); |
|
| 6218 | - $locaked_fields = $gd_is_franchise ? get_post_meta( $post_id, 'gd_franchise_lock', true ) : ''; |
|
| 6217 | + $gd_is_franchise = (int) get_post_meta($post_id, 'gd_is_franchise', true); |
|
| 6218 | + $locaked_fields = $gd_is_franchise ? get_post_meta($post_id, 'gd_franchise_lock', true) : ''; |
|
| 6219 | 6219 | $locaked_fields = (is_array($locaked_fields) && !empty($locaked_fields) ? implode(",", $locaked_fields) : '');
|
| 6220 | - $franchise = !$gd_is_franchise && isset($post_info['franchise']) && (int)$post_info['franchise'] > 0 ? (int)$post_info['franchise'] : 0; // franchise id |
|
| 6220 | + $franchise = !$gd_is_franchise && isset($post_info['franchise']) && (int) $post_info['franchise'] > 0 ? (int) $post_info['franchise'] : 0; // franchise id |
|
| 6221 | 6221 | } |
| 6222 | 6222 | |
| 6223 | - $csv_row[] = (int)$gd_is_franchise; // gd_is_franchise |
|
| 6223 | + $csv_row[] = (int) $gd_is_franchise; // gd_is_franchise |
|
| 6224 | 6224 | $csv_row[] = $locaked_fields; // gd_franchise_lock fields |
| 6225 | - $csv_row[] = (int)$franchise; // franchise id |
|
| 6225 | + $csv_row[] = (int) $franchise; // franchise id |
|
| 6226 | 6226 | } |
| 6227 | 6227 | |
| 6228 | - for ( $c = 0; $c < $images_count; $c++ ) {
|
|
| 6229 | - $csv_row[] = isset( $current_images[$c] ) ? $current_images[$c] : ''; // IMAGE |
|
| 6228 | + for ($c = 0; $c < $images_count; $c++) {
|
|
| 6229 | + $csv_row[] = isset($current_images[$c]) ? $current_images[$c] : ''; // IMAGE |
|
| 6230 | 6230 | } |
| 6231 | 6231 | |
| 6232 | 6232 | $csv_rows[] = $csv_row; |
| 6233 | 6233 | |
| 6234 | 6234 | } |
| 6235 | 6235 | |
| 6236 | - for ( $c = 0; $c < $images_count; $c++ ) {
|
|
| 6236 | + for ($c = 0; $c < $images_count; $c++) {
|
|
| 6237 | 6237 | $csv_rows[0][] = 'IMAGE'; |
| 6238 | 6238 | } |
| 6239 | 6239 | } |
@@ -6255,19 +6255,19 @@ discard block |
||
| 6255 | 6255 | * @param int $page_no Page number. Default 0. |
| 6256 | 6256 | * @return array Array of posts data. |
| 6257 | 6257 | */ |
| 6258 | -function geodir_get_export_posts( $post_type, $per_page = 0, $page_no = 0 ) {
|
|
| 6258 | +function geodir_get_export_posts($post_type, $per_page = 0, $page_no = 0) {
|
|
| 6259 | 6259 | global $wpdb, $plugin_prefix; |
| 6260 | 6260 | |
| 6261 | - if ( ! post_type_exists( $post_type ) ) |
|
| 6261 | + if (!post_type_exists($post_type)) |
|
| 6262 | 6262 | return new stdClass; |
| 6263 | 6263 | |
| 6264 | 6264 | $table = $plugin_prefix . $post_type . '_detail'; |
| 6265 | 6265 | |
| 6266 | 6266 | $limit = ''; |
| 6267 | - if ( $per_page > 0 && $page_no > 0 ) {
|
|
| 6268 | - $offset = ( $page_no - 1 ) * $per_page; |
|
| 6267 | + if ($per_page > 0 && $page_no > 0) {
|
|
| 6268 | + $offset = ($page_no - 1) * $per_page; |
|
| 6269 | 6269 | |
| 6270 | - if ( $offset > 0 ) {
|
|
| 6270 | + if ($offset > 0) {
|
|
| 6271 | 6271 | $limit = " LIMIT " . $offset . "," . $per_page; |
| 6272 | 6272 | } else {
|
| 6273 | 6273 | $limit = " LIMIT " . $per_page; |
@@ -6284,9 +6284,9 @@ discard block |
||
| 6284 | 6284 | * @param int $query The SQL query. |
| 6285 | 6285 | * @param string $post_type Post type. |
| 6286 | 6286 | */ |
| 6287 | - $query = apply_filters( 'geodir_imex_export_posts_query', $query, $post_type ); |
|
| 6287 | + $query = apply_filters('geodir_imex_export_posts_query', $query, $post_type);
|
|
| 6288 | 6288 | |
| 6289 | - $results = (array)$wpdb->get_results( $wpdb->prepare( $query, $post_type ), ARRAY_A ); |
|
| 6289 | + $results = (array) $wpdb->get_results($wpdb->prepare($query, $post_type), ARRAY_A); |
|
| 6290 | 6290 | |
| 6291 | 6291 | /** |
| 6292 | 6292 | * Modify returned post results for the current post type. |
@@ -6297,7 +6297,7 @@ discard block |
||
| 6297 | 6297 | * @param object $results An object containing all post ids. |
| 6298 | 6298 | * @param string $post_type Post type. |
| 6299 | 6299 | */ |
| 6300 | - return apply_filters( 'geodir_export_posts', $results, $post_type ); |
|
| 6300 | + return apply_filters('geodir_export_posts', $results, $post_type);
|
|
| 6301 | 6301 | } |
| 6302 | 6302 | |
| 6303 | 6303 | /** |
@@ -6314,8 +6314,8 @@ discard block |
||
| 6314 | 6314 | * @param string $post_type Post type. |
| 6315 | 6315 | * @return string The SQL query. |
| 6316 | 6316 | */ |
| 6317 | -function geodir_imex_get_events_query( $query, $post_type ) {
|
|
| 6318 | - if ( $post_type == 'gd_event' ) {
|
|
| 6317 | +function geodir_imex_get_events_query($query, $post_type) {
|
|
| 6318 | + if ($post_type == 'gd_event') {
|
|
| 6319 | 6319 | global $wpdb, $plugin_prefix; |
| 6320 | 6320 | |
| 6321 | 6321 | $table = $plugin_prefix . $post_type . '_detail'; |
@@ -6336,15 +6336,15 @@ discard block |
||
| 6336 | 6336 | * @param string $post_type Post type. |
| 6337 | 6337 | * @return int Total terms count. |
| 6338 | 6338 | */ |
| 6339 | -function geodir_get_terms_count( $post_type ) {
|
|
| 6340 | - $args = array( 'hide_empty' => 0 ); |
|
| 6339 | +function geodir_get_terms_count($post_type) {
|
|
| 6340 | + $args = array('hide_empty' => 0);
|
|
| 6341 | 6341 | |
| 6342 | - remove_all_filters( 'get_terms' ); |
|
| 6342 | + remove_all_filters('get_terms');
|
|
| 6343 | 6343 | |
| 6344 | 6344 | $taxonomy = $post_type . 'category'; |
| 6345 | 6345 | |
| 6346 | - $count_terms = wp_count_terms( $taxonomy, $args ); |
|
| 6347 | - $count_terms = !is_wp_error( $count_terms ) ? $count_terms : 0; |
|
| 6346 | + $count_terms = wp_count_terms($taxonomy, $args); |
|
| 6347 | + $count_terms = !is_wp_error($count_terms) ? $count_terms : 0; |
|
| 6348 | 6348 | |
| 6349 | 6349 | return $count_terms; |
| 6350 | 6350 | } |
@@ -6361,23 +6361,23 @@ discard block |
||
| 6361 | 6361 | * @param int $page_no Page number. Default 0. |
| 6362 | 6362 | * @return array Array of terms data. |
| 6363 | 6363 | */ |
| 6364 | -function geodir_imex_get_terms( $post_type, $per_page = 0, $page_no = 0 ) {
|
|
| 6365 | - $args = array( 'hide_empty' => 0, 'orderby' => 'id' ); |
|
| 6364 | +function geodir_imex_get_terms($post_type, $per_page = 0, $page_no = 0) {
|
|
| 6365 | + $args = array('hide_empty' => 0, 'orderby' => 'id');
|
|
| 6366 | 6366 | |
| 6367 | - remove_all_filters( 'get_terms' ); |
|
| 6367 | + remove_all_filters('get_terms');
|
|
| 6368 | 6368 | |
| 6369 | 6369 | $taxonomy = $post_type . 'category'; |
| 6370 | 6370 | |
| 6371 | - if ( $per_page > 0 && $page_no > 0 ) {
|
|
| 6372 | - $args['offset'] = ( $page_no - 1 ) * $per_page; |
|
| 6371 | + if ($per_page > 0 && $page_no > 0) {
|
|
| 6372 | + $args['offset'] = ($page_no - 1) * $per_page; |
|
| 6373 | 6373 | $args['number'] = $per_page; |
| 6374 | 6374 | } |
| 6375 | 6375 | |
| 6376 | - $terms = get_terms( $taxonomy, $args ); |
|
| 6376 | + $terms = get_terms($taxonomy, $args); |
|
| 6377 | 6377 | |
| 6378 | 6378 | $csv_rows = array(); |
| 6379 | 6379 | |
| 6380 | - if ( !empty( $terms ) ) {
|
|
| 6380 | + if (!empty($terms)) {
|
|
| 6381 | 6381 | $csv_row = array(); |
| 6382 | 6382 | $csv_row[] = 'cat_id'; |
| 6383 | 6383 | $csv_row[] = 'cat_name'; |
@@ -6398,16 +6398,16 @@ discard block |
||
| 6398 | 6398 | |
| 6399 | 6399 | $csv_rows[] = $csv_row; |
| 6400 | 6400 | |
| 6401 | - foreach ( $terms as $term ) {
|
|
| 6402 | - $cat_icon = get_tax_meta( $term->term_id, 'ct_cat_icon', false, $post_type ); |
|
| 6403 | - $cat_icon = !empty( $cat_icon ) && isset( $cat_icon['src'] ) ? $cat_icon['src'] : ''; |
|
| 6401 | + foreach ($terms as $term) {
|
|
| 6402 | + $cat_icon = get_tax_meta($term->term_id, 'ct_cat_icon', false, $post_type); |
|
| 6403 | + $cat_icon = !empty($cat_icon) && isset($cat_icon['src']) ? $cat_icon['src'] : ''; |
|
| 6404 | 6404 | |
| 6405 | - $cat_image = geodir_get_default_catimage( $term->term_id, $post_type ); |
|
| 6406 | - $cat_image = !empty( $cat_image ) && isset( $cat_image['src'] ) ? $cat_image['src'] : ''; |
|
| 6405 | + $cat_image = geodir_get_default_catimage($term->term_id, $post_type); |
|
| 6406 | + $cat_image = !empty($cat_image) && isset($cat_image['src']) ? $cat_image['src'] : ''; |
|
| 6407 | 6407 | |
| 6408 | 6408 | $cat_parent = ''; |
| 6409 | - if (isset($term->parent) && (int)$term->parent > 0 && term_exists((int)$term->parent, $taxonomy)) {
|
|
| 6410 | - $parent_term = (array)get_term_by( 'id', (int)$term->parent, $taxonomy ); |
|
| 6409 | + if (isset($term->parent) && (int) $term->parent > 0 && term_exists((int) $term->parent, $taxonomy)) {
|
|
| 6410 | + $parent_term = (array) get_term_by('id', (int) $term->parent, $taxonomy);
|
|
| 6411 | 6411 | $cat_parent = !empty($parent_term) && isset($parent_term['name']) ? $parent_term['name'] : ''; |
| 6412 | 6412 | } |
| 6413 | 6413 | |
@@ -6417,14 +6417,14 @@ discard block |
||
| 6417 | 6417 | $csv_row[] = $term->slug; |
| 6418 | 6418 | $csv_row[] = $post_type; |
| 6419 | 6419 | $csv_row[] = $cat_parent; |
| 6420 | - $csv_row[] = get_tax_meta( $term->term_id, 'ct_cat_schema', false, $post_type ); |
|
| 6420 | + $csv_row[] = get_tax_meta($term->term_id, 'ct_cat_schema', false, $post_type); |
|
| 6421 | 6421 | $csv_row[] = $term->description; |
| 6422 | - $csv_row[] = get_tax_meta( $term->term_id, 'ct_cat_top_desc', false, $post_type ); |
|
| 6422 | + $csv_row[] = get_tax_meta($term->term_id, 'ct_cat_top_desc', false, $post_type); |
|
| 6423 | 6423 | $csv_row[] = $cat_image; |
| 6424 | 6424 | $csv_row[] = $cat_icon; |
| 6425 | 6425 | // WPML |
| 6426 | 6426 | if ($is_wpml) {
|
| 6427 | - $csv_row[] = geodir_get_language_for_element( $term->term_id, 'tax_' . $taxonomy ); |
|
| 6427 | + $csv_row[] = geodir_get_language_for_element($term->term_id, 'tax_' . $taxonomy); |
|
| 6428 | 6428 | } |
| 6429 | 6429 | // WPML |
| 6430 | 6430 | |
@@ -6443,7 +6443,7 @@ discard block |
||
| 6443 | 6443 | * @param bool $relative True for relative path & False for absolute path. |
| 6444 | 6444 | * @return string Path to the cache directory. |
| 6445 | 6445 | */ |
| 6446 | -function geodir_path_import_export( $relative = true ) {
|
|
| 6446 | +function geodir_path_import_export($relative = true) {
|
|
| 6447 | 6447 | $upload_dir = wp_upload_dir(); |
| 6448 | 6448 | |
| 6449 | 6449 | return $relative ? $upload_dir['baseurl'] . '/cache' : $upload_dir['basedir'] . '/cache'; |
@@ -6462,8 +6462,8 @@ discard block |
||
| 6462 | 6462 | * @param bool $clear If true then it overwrite data otherwise add rows at the end of file. |
| 6463 | 6463 | * @return bool true if success otherwise false. |
| 6464 | 6464 | */ |
| 6465 | -function geodir_save_csv_data( $file_path, $csv_data = array(), $clear = true ) {
|
|
| 6466 | - if ( empty( $csv_data ) ) {
|
|
| 6465 | +function geodir_save_csv_data($file_path, $csv_data = array(), $clear = true) {
|
|
| 6466 | + if (empty($csv_data)) {
|
|
| 6467 | 6467 | return false; |
| 6468 | 6468 | } |
| 6469 | 6469 | |
@@ -6471,17 +6471,17 @@ discard block |
||
| 6471 | 6471 | |
| 6472 | 6472 | $mode = $clear ? 'w+' : 'a+'; |
| 6473 | 6473 | |
| 6474 | - if ( function_exists( 'fputcsv' ) ) {
|
|
| 6475 | - $file = fopen( $file_path, $mode ); |
|
| 6476 | - foreach( $csv_data as $csv_row ) {
|
|
| 6474 | + if (function_exists('fputcsv')) {
|
|
| 6475 | + $file = fopen($file_path, $mode); |
|
| 6476 | + foreach ($csv_data as $csv_row) {
|
|
| 6477 | 6477 | //$csv_row = array_map( 'utf8_decode', $csv_row ); |
| 6478 | - $write_successful = fputcsv( $file, $csv_row, ",", $enclosure = '"' ); |
|
| 6478 | + $write_successful = fputcsv($file, $csv_row, ",", $enclosure = '"'); |
|
| 6479 | 6479 | } |
| 6480 | - fclose( $file ); |
|
| 6480 | + fclose($file); |
|
| 6481 | 6481 | } else {
|
| 6482 | - foreach( $csv_data as $csv_row ) {
|
|
| 6482 | + foreach ($csv_data as $csv_row) {
|
|
| 6483 | 6483 | //$csv_row = array_map( 'utf8_decode', $csv_row ); |
| 6484 | - $wp_filesystem->put_contents( $file_path, $csv_row ); |
|
| 6484 | + $wp_filesystem->put_contents($file_path, $csv_row); |
|
| 6485 | 6485 | } |
| 6486 | 6486 | } |
| 6487 | 6487 | |
@@ -6499,14 +6499,14 @@ discard block |
||
| 6499 | 6499 | * @param string $file Full path to file. |
| 6500 | 6500 | * @return int No of file rows. |
| 6501 | 6501 | */ |
| 6502 | -function geodir_import_export_line_count( $file ) {
|
|
| 6502 | +function geodir_import_export_line_count($file) {
|
|
| 6503 | 6503 | global $wp_filesystem; |
| 6504 | 6504 | |
| 6505 | - if ( $wp_filesystem->is_file( $file ) && $wp_filesystem->exists( $file ) ) {
|
|
| 6506 | - $contents = $wp_filesystem->get_contents_array( $file ); |
|
| 6505 | + if ($wp_filesystem->is_file($file) && $wp_filesystem->exists($file)) {
|
|
| 6506 | + $contents = $wp_filesystem->get_contents_array($file); |
|
| 6507 | 6507 | |
| 6508 | - if ( !empty( $contents ) && is_array( $contents ) ) {
|
|
| 6509 | - return count( $contents ) - 1; |
|
| 6508 | + if (!empty($contents) && is_array($contents)) {
|
|
| 6509 | + return count($contents) - 1; |
|
| 6510 | 6510 | } |
| 6511 | 6511 | } |
| 6512 | 6512 | |
@@ -6523,11 +6523,11 @@ discard block |
||
| 6523 | 6523 | * @param string $post_type The post type. |
| 6524 | 6524 | * @return object Queried object. |
| 6525 | 6525 | */ |
| 6526 | -function geodir_imex_get_custom_fields( $post_type ) {
|
|
| 6526 | +function geodir_imex_get_custom_fields($post_type) {
|
|
| 6527 | 6527 | global $wpdb; |
| 6528 | 6528 | |
| 6529 | - $sql = $wpdb->prepare("SELECT htmlvar_name FROM " . GEODIR_CUSTOM_FIELDS_TABLE . " WHERE post_type=%s AND is_active='1' AND is_admin!='1' AND field_type != 'fieldset' AND htmlvar_name != '' ORDER BY id ASC", array( $post_type ) );
|
|
| 6530 | - $rows = $wpdb->get_results( $sql ); |
|
| 6529 | + $sql = $wpdb->prepare("SELECT htmlvar_name FROM " . GEODIR_CUSTOM_FIELDS_TABLE . " WHERE post_type=%s AND is_active='1' AND is_admin!='1' AND field_type != 'fieldset' AND htmlvar_name != '' ORDER BY id ASC", array($post_type));
|
|
| 6530 | + $rows = $wpdb->get_results($sql); |
|
| 6531 | 6531 | |
| 6532 | 6532 | return $rows; |
| 6533 | 6533 | } |
@@ -6609,9 +6609,9 @@ discard block |
||
| 6609 | 6609 | $post_table = $plugin_prefix . $post_type . '_detail'; |
| 6610 | 6610 | |
| 6611 | 6611 | $query = $wpdb->prepare("SELECT * FROM " . $post_table . " WHERE post_id = %d", array($master_post_id));
|
| 6612 | - $data = (array)$wpdb->get_row($query); |
|
| 6612 | + $data = (array) $wpdb->get_row($query); |
|
| 6613 | 6613 | |
| 6614 | - if ( !empty( $data ) ) {
|
|
| 6614 | + if (!empty($data)) {
|
|
| 6615 | 6615 | $data['post_id'] = $tr_post_id; |
| 6616 | 6616 | unset($data['default_category'], $data['marker_json'], $data['featured_image'], $data[$post_type . 'category'], $data['overall_rating'], $data['rating_count'], $data['ratings']); |
| 6617 | 6617 | |
@@ -6639,7 +6639,7 @@ discard block |
||
| 6639 | 6639 | global $sitepress, $wpdb; |
| 6640 | 6640 | $post_type = get_post_type($master_post_id); |
| 6641 | 6641 | |
| 6642 | - remove_filter('get_term', array($sitepress,'get_term_adjust_id')); // AVOID filtering to current language
|
|
| 6642 | + remove_filter('get_term', array($sitepress, 'get_term_adjust_id')); // AVOID filtering to current language
|
|
| 6643 | 6643 | |
| 6644 | 6644 | $taxonomies = get_object_taxonomies($post_type); |
| 6645 | 6645 | foreach ($taxonomies as $taxonomy) {
|
@@ -6648,9 +6648,9 @@ discard block |
||
| 6648 | 6648 | |
| 6649 | 6649 | if ($terms) {
|
| 6650 | 6650 | foreach ($terms as $term) {
|
| 6651 | - $tr_id = apply_filters( 'translate_object_id',$term->term_id, $taxonomy, false, $lang); |
|
| 6651 | + $tr_id = apply_filters('translate_object_id', $term->term_id, $taxonomy, false, $lang);
|
|
| 6652 | 6652 | |
| 6653 | - if (!is_null($tr_id)){
|
|
| 6653 | + if (!is_null($tr_id)) {
|
|
| 6654 | 6654 | // not using get_term - unfiltered get_term |
| 6655 | 6655 | $translated_term = $wpdb->get_row($wpdb->prepare("
|
| 6656 | 6656 | SELECT * FROM {$wpdb->terms} t JOIN {$wpdb->term_taxonomy} x ON x.term_id = t.term_id WHERE t.term_id = %d AND x.taxonomy = %s", $tr_id, $taxonomy));
|
@@ -6659,8 +6659,8 @@ discard block |
||
| 6659 | 6659 | } |
| 6660 | 6660 | } |
| 6661 | 6661 | |
| 6662 | - if (!is_taxonomy_hierarchical($taxonomy)){
|
|
| 6663 | - $terms_array = array_unique( array_map( 'intval', $terms_array ) ); |
|
| 6662 | + if (!is_taxonomy_hierarchical($taxonomy)) {
|
|
| 6663 | + $terms_array = array_unique(array_map('intval', $terms_array));
|
|
| 6664 | 6664 | } |
| 6665 | 6665 | |
| 6666 | 6666 | wp_set_post_terms($tr_post_id, $terms_array, $taxonomy); |
@@ -6693,9 +6693,9 @@ discard block |
||
| 6693 | 6693 | $query = $wpdb->prepare("SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE mime_type like %s AND post_id = %d ORDER BY menu_order ASC", array('%image%', $master_post_id));
|
| 6694 | 6694 | $post_images = $wpdb->get_results($query); |
| 6695 | 6695 | |
| 6696 | - if ( !empty( $post_images ) ) {
|
|
| 6697 | - foreach ( $post_images as $post_image) {
|
|
| 6698 | - $image_data = (array)$post_image; |
|
| 6696 | + if (!empty($post_images)) {
|
|
| 6697 | + foreach ($post_images as $post_image) {
|
|
| 6698 | + $image_data = (array) $post_image; |
|
| 6699 | 6699 | unset($image_data['ID']); |
| 6700 | 6700 | $image_data['post_id'] = $tr_post_id; |
| 6701 | 6701 | |
@@ -6721,10 +6721,10 @@ discard block |
||
| 6721 | 6721 | * @return array Event data array. |
| 6722 | 6722 | */ |
| 6723 | 6723 | function geodir_imex_get_event_data($post, $gd_post_info) {
|
| 6724 | - $event_date = isset( $post['event_date'] ) && $post['event_date'] != '' && $post['event_date'] != '0000-00-00 00:00:00' ? date_i18n( 'd/m/Y', strtotime( $post['event_date'] ) ) : ''; |
|
| 6724 | + $event_date = isset($post['event_date']) && $post['event_date'] != '' && $post['event_date'] != '0000-00-00 00:00:00' ? date_i18n('d/m/Y', strtotime($post['event_date'])) : '';
|
|
| 6725 | 6725 | $event_enddate = $event_date; |
| 6726 | - $starttime = isset( $post['starttime'] ) && $post['starttime'] != '' && $post['starttime'] != '00:00:00' ? date_i18n( 'H:i', strtotime( $post['starttime'] ) ) : ''; |
|
| 6727 | - $endtime = isset( $post['endtime'] ) && $post['endtime'] != '' && $post['endtime'] != '00:00:00' ? date_i18n( 'H:i', strtotime( $post['endtime'] ) ) : ''; |
|
| 6726 | + $starttime = isset($post['starttime']) && $post['starttime'] != '' && $post['starttime'] != '00:00:00' ? date_i18n('H:i', strtotime($post['starttime'])) : '';
|
|
| 6727 | + $endtime = isset($post['endtime']) && $post['endtime'] != '' && $post['endtime'] != '00:00:00' ? date_i18n('H:i', strtotime($post['endtime'])) : '';
|
|
| 6728 | 6728 | |
| 6729 | 6729 | $is_recurring_event = ''; |
| 6730 | 6730 | $event_duration_days = ''; |
@@ -6742,15 +6742,15 @@ discard block |
||
| 6742 | 6742 | |
| 6743 | 6743 | $recurring_data = isset($gd_post_info->recurring_dates) ? maybe_unserialize($gd_post_info->recurring_dates) : array(); |
| 6744 | 6744 | if (!empty($recurring_data)) {
|
| 6745 | - $event_date = isset( $recurring_data['event_start'] ) && $recurring_data['event_start'] != '' && $recurring_data['event_start'] != '0000-00-00 00:00:00' ? date_i18n( 'd/m/Y', strtotime( $recurring_data['event_start'] ) ) : $event_date; |
|
| 6746 | - $event_enddate = isset( $recurring_data['event_end'] ) && $recurring_data['event_end'] != '' && $recurring_data['event_end'] != '0000-00-00 00:00:00' ? date_i18n( 'd/m/Y', strtotime( $recurring_data['event_end'] ) ) : $event_date; |
|
| 6747 | - $starttime = isset( $recurring_data['starttime'] ) && $recurring_data['starttime'] != '' && $recurring_data['starttime'] != '00:00:00' ? date_i18n( 'H:i', strtotime( $recurring_data['starttime'] ) ) : $starttime; |
|
| 6748 | - $endtime = isset( $recurring_data['endtime'] ) && $recurring_data['endtime'] != '' && $recurring_data['endtime'] != '00:00:00' ? date_i18n( 'H:i', strtotime( $recurring_data['endtime'] ) ) : $endtime; |
|
| 6745 | + $event_date = isset($recurring_data['event_start']) && $recurring_data['event_start'] != '' && $recurring_data['event_start'] != '0000-00-00 00:00:00' ? date_i18n('d/m/Y', strtotime($recurring_data['event_start'])) : $event_date;
|
|
| 6746 | + $event_enddate = isset($recurring_data['event_end']) && $recurring_data['event_end'] != '' && $recurring_data['event_end'] != '0000-00-00 00:00:00' ? date_i18n('d/m/Y', strtotime($recurring_data['event_end'])) : $event_date;
|
|
| 6747 | + $starttime = isset($recurring_data['starttime']) && $recurring_data['starttime'] != '' && $recurring_data['starttime'] != '00:00:00' ? date_i18n('H:i', strtotime($recurring_data['starttime'])) : $starttime;
|
|
| 6748 | + $endtime = isset($recurring_data['endtime']) && $recurring_data['endtime'] != '' && $recurring_data['endtime'] != '00:00:00' ? date_i18n('H:i', strtotime($recurring_data['endtime'])) : $endtime;
|
|
| 6749 | 6749 | $is_whole_day_event = !empty($recurring_data['all_day']) ? 1 : ''; |
| 6750 | 6750 | $different_times = !empty($recurring_data['different_times']) ? true : false; |
| 6751 | 6751 | |
| 6752 | - $recurring_pkg = geodir_event_recurring_pkg( $gd_post_info ); |
|
| 6753 | - $is_recurring = isset( $gd_post_info->is_recurring ) && (int)$gd_post_info->is_recurring == 0 ? false : true; |
|
| 6752 | + $recurring_pkg = geodir_event_recurring_pkg($gd_post_info); |
|
| 6753 | + $is_recurring = isset($gd_post_info->is_recurring) && (int) $gd_post_info->is_recurring == 0 ? false : true; |
|
| 6754 | 6754 | |
| 6755 | 6755 | if ($recurring_pkg && $is_recurring) {
|
| 6756 | 6756 | $recurring_dates = $event_date; |
@@ -6760,13 +6760,13 @@ discard block |
||
| 6760 | 6760 | $recurring_type = !empty($recurring_data['repeat_type']) && in_array($recurring_data['repeat_type'], array('day', 'week', 'month', 'year', 'custom')) ? $recurring_data['repeat_type'] : 'custom';
|
| 6761 | 6761 | |
| 6762 | 6762 | if (!empty($recurring_data['event_recurring_dates'])) {
|
| 6763 | - $event_recurring_dates = explode( ',', $recurring_data['event_recurring_dates'] ); |
|
| 6763 | + $event_recurring_dates = explode(',', $recurring_data['event_recurring_dates']);
|
|
| 6764 | 6764 | |
| 6765 | 6765 | if (!empty($event_recurring_dates)) {
|
| 6766 | 6766 | $recurring_dates = array(); |
| 6767 | 6767 | |
| 6768 | 6768 | foreach ($event_recurring_dates as $date) {
|
| 6769 | - $recurring_dates[] = date_i18n( 'd/m/Y', strtotime( $date ) ); |
|
| 6769 | + $recurring_dates[] = date_i18n('d/m/Y', strtotime($date));
|
|
| 6770 | 6770 | } |
| 6771 | 6771 | |
| 6772 | 6772 | $recurring_dates = implode(",", $recurring_dates);
|
@@ -6782,7 +6782,7 @@ discard block |
||
| 6782 | 6782 | $times = array(); |
| 6783 | 6783 | |
| 6784 | 6784 | foreach ($recurring_data['starttimes'] as $time) {
|
| 6785 | - $times[] = $time != '00:00:00' ? date_i18n( 'H:i', strtotime( $time ) ) : '00:00'; |
|
| 6785 | + $times[] = $time != '00:00:00' ? date_i18n('H:i', strtotime($time)) : '00:00';
|
|
| 6786 | 6786 | } |
| 6787 | 6787 | |
| 6788 | 6788 | $event_starttimes = implode(",", $times);
|
@@ -6792,7 +6792,7 @@ discard block |
||
| 6792 | 6792 | $times = array(); |
| 6793 | 6793 | |
| 6794 | 6794 | foreach ($recurring_data['endtimes'] as $time) {
|
| 6795 | - $times[] = $time != '00:00:00' ? date_i18n( 'H:i', strtotime( $time ) ) : '00:00'; |
|
| 6795 | + $times[] = $time != '00:00:00' ? date_i18n('H:i', strtotime($time)) : '00:00';
|
|
| 6796 | 6796 | } |
| 6797 | 6797 | |
| 6798 | 6798 | $event_endtimes = implode(",", $times);
|
@@ -6804,8 +6804,8 @@ discard block |
||
| 6804 | 6804 | } |
| 6805 | 6805 | } |
| 6806 | 6806 | } else {
|
| 6807 | - $event_duration_days = isset($recurring_data['duration_x']) ? (int)$recurring_data['duration_x'] : 1; |
|
| 6808 | - $recurring_interval = !empty($recurring_data['repeat_x']) && (int)$recurring_data['repeat_x'] > 0 ? $recurring_data['repeat_x'] : 1; |
|
| 6807 | + $event_duration_days = isset($recurring_data['duration_x']) ? (int) $recurring_data['duration_x'] : 1; |
|
| 6808 | + $recurring_interval = !empty($recurring_data['repeat_x']) && (int) $recurring_data['repeat_x'] > 0 ? $recurring_data['repeat_x'] : 1; |
|
| 6809 | 6809 | |
| 6810 | 6810 | if (($recurring_type == 'week' || $recurring_type == 'month') && !empty($recurring_data['repeat_days'])) {
|
| 6811 | 6811 | $week_days = array('Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat');
|
@@ -6821,11 +6821,11 @@ discard block |
||
| 6821 | 6821 | } |
| 6822 | 6822 | |
| 6823 | 6823 | $recurring_week_nos = $recurring_type == 'month' && !empty($recurring_data['repeat_weeks']) ? implode(",", $recurring_data['repeat_weeks']) : $recurring_week_nos;
|
| 6824 | - if (!empty($recurring_data['repeat_end_type']) && (int)$recurring_data['repeat_end_type'] == 1) {
|
|
| 6825 | - $recurring_end_date = isset($recurring_data['repeat_end']) && $recurring_data['repeat_end'] != '' && $recurring_data['repeat_end'] != '0000-00-00 00:00:00' ? date_i18n( 'd/m/Y', strtotime( $recurring_data['repeat_end'] ) ) : ''; |
|
| 6824 | + if (!empty($recurring_data['repeat_end_type']) && (int) $recurring_data['repeat_end_type'] == 1) {
|
|
| 6825 | + $recurring_end_date = isset($recurring_data['repeat_end']) && $recurring_data['repeat_end'] != '' && $recurring_data['repeat_end'] != '0000-00-00 00:00:00' ? date_i18n('d/m/Y', strtotime($recurring_data['repeat_end'])) : '';
|
|
| 6826 | 6826 | $max_recurring_count = empty($recurring_end_date) ? 1 : ''; |
| 6827 | 6827 | } else {
|
| 6828 | - $max_recurring_count = (!empty($recurring_data['max_repeat']) && (int)$recurring_data['max_repeat'] > 0 ? (int)$recurring_data['max_repeat'] : 1); |
|
| 6828 | + $max_recurring_count = (!empty($recurring_data['max_repeat']) && (int) $recurring_data['max_repeat'] > 0 ? (int) $recurring_data['max_repeat'] : 1); |
|
| 6829 | 6829 | } |
| 6830 | 6830 | } |
| 6831 | 6831 | } |
@@ -6889,9 +6889,9 @@ discard block |
||
| 6889 | 6889 | * @return array Event data array. |
| 6890 | 6890 | */ |
| 6891 | 6891 | function geodir_imex_process_event_data($gd_post) {
|
| 6892 | - $recurring_pkg = geodir_event_recurring_pkg( (object)$gd_post ); |
|
| 6892 | + $recurring_pkg = geodir_event_recurring_pkg((object) $gd_post); |
|
| 6893 | 6893 | |
| 6894 | - $is_recurring = isset( $gd_post['is_recurring_event'] ) && (int)$gd_post['is_recurring_event'] == 0 ? false : true; |
|
| 6894 | + $is_recurring = isset($gd_post['is_recurring_event']) && (int) $gd_post['is_recurring_event'] == 0 ? false : true; |
|
| 6895 | 6895 | $event_date = isset($gd_post['event_date']) && $gd_post['event_date'] != '' ? geodir_imex_get_date_ymd($gd_post['event_date']) : ''; |
| 6896 | 6896 | $event_enddate = isset($gd_post['event_enddate']) && $gd_post['event_enddate'] != '' ? geodir_imex_get_date_ymd($gd_post['event_enddate']) : $event_date; |
| 6897 | 6897 | $all_day = isset($gd_post['is_whole_day_event']) && !empty($gd_post['is_whole_day_event']) ? true : false; |
@@ -6938,17 +6938,17 @@ discard block |
||
| 6938 | 6938 | $event_recurring_dates = implode(",", $event_recurring_dates);
|
| 6939 | 6939 | } |
| 6940 | 6940 | } else {
|
| 6941 | - $duration_x = !empty( $gd_post['event_duration_days'] ) ? (int)$gd_post['event_duration_days'] : 1; |
|
| 6942 | - $repeat_x = !empty( $gd_post['recurring_interval'] ) ? (int)$gd_post['recurring_interval'] : 1; |
|
| 6943 | - $max_repeat = !empty( $gd_post['max_recurring_count'] ) ? (int)$gd_post['max_recurring_count'] : 1; |
|
| 6944 | - $repeat_end = !empty( $gd_post['recurring_end_date'] ) ? geodir_imex_get_date_ymd($gd_post['recurring_end_date']) : ''; |
|
| 6941 | + $duration_x = !empty($gd_post['event_duration_days']) ? (int) $gd_post['event_duration_days'] : 1; |
|
| 6942 | + $repeat_x = !empty($gd_post['recurring_interval']) ? (int) $gd_post['recurring_interval'] : 1; |
|
| 6943 | + $max_repeat = !empty($gd_post['max_recurring_count']) ? (int) $gd_post['max_recurring_count'] : 1; |
|
| 6944 | + $repeat_end = !empty($gd_post['recurring_end_date']) ? geodir_imex_get_date_ymd($gd_post['recurring_end_date']) : ''; |
|
| 6945 | 6945 | |
| 6946 | 6946 | $repeat_end_type = $repeat_end != '' ? 1 : 0; |
| 6947 | 6947 | $max_repeat = $repeat_end != '' ? '' : $max_repeat; |
| 6948 | 6948 | |
| 6949 | 6949 | $week_days = array_flip(array('sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'));
|
| 6950 | 6950 | |
| 6951 | - $a_repeat_days = isset($gd_post['recurring_week_days']) && trim($gd_post['recurring_week_days'])!='' ? explode(',', trim($gd_post['recurring_week_days'])) : array();
|
|
| 6951 | + $a_repeat_days = isset($gd_post['recurring_week_days']) && trim($gd_post['recurring_week_days']) != '' ? explode(',', trim($gd_post['recurring_week_days'])) : array();
|
|
| 6952 | 6952 | $repeat_days = array(); |
| 6953 | 6953 | if (!empty($a_repeat_days)) {
|
| 6954 | 6954 | foreach ($a_repeat_days as $repeat_day) {
|
@@ -6966,7 +6966,7 @@ discard block |
||
| 6966 | 6966 | $repeat_weeks = array(); |
| 6967 | 6967 | if (!empty($a_repeat_weeks)) {
|
| 6968 | 6968 | foreach ($a_repeat_weeks as $repeat_week) {
|
| 6969 | - $repeat_weeks[] = (int)$repeat_week; |
|
| 6969 | + $repeat_weeks[] = (int) $repeat_week; |
|
| 6970 | 6970 | } |
| 6971 | 6971 | |
| 6972 | 6972 | $repeat_weeks = array_unique($repeat_weeks); |
@@ -7087,7 +7087,7 @@ discard block |
||
| 7087 | 7087 | */ |
| 7088 | 7088 | function geodir_admin_upgrade_notice() {
|
| 7089 | 7089 | $class = "error"; |
| 7090 | - $message = __("Please update core GeoDirectory or some addons may not function correctly.","geodirectory");
|
|
| 7090 | + $message = __("Please update core GeoDirectory or some addons may not function correctly.", "geodirectory");
|
|
| 7091 | 7091 | echo"<div class=\"$class\"> <p>$message</p></div>"; |
| 7092 | 7092 | } |
| 7093 | 7093 | |
@@ -7102,7 +7102,7 @@ discard block |
||
| 7102 | 7102 | * @param (object) $r |
| 7103 | 7103 | * @return (string) $output |
| 7104 | 7104 | */ |
| 7105 | -function geodire_admin_upgrade_notice( $plugin_data, $r ) |
|
| 7105 | +function geodire_admin_upgrade_notice($plugin_data, $r) |
|
| 7106 | 7106 | {
|
| 7107 | 7107 | // readme contents |
| 7108 | 7108 | $args = array( |
@@ -7110,7 +7110,7 @@ discard block |
||
| 7110 | 7110 | 'redirection' => 5 |
| 7111 | 7111 | ); |
| 7112 | 7112 | $url = "http://plugins.svn.wordpress.org/geodirectory/trunk/readme.txt"; |
| 7113 | - $data = wp_remote_get( $url, $args ); |
|
| 7113 | + $data = wp_remote_get($url, $args); |
|
| 7114 | 7114 | |
| 7115 | 7115 | if (!is_wp_error($data) && $data['response']['code'] == 200) {
|
| 7116 | 7116 | |
@@ -7125,20 +7125,20 @@ discard block |
||
| 7125 | 7125 | function geodir_in_plugin_update_message($content) {
|
| 7126 | 7126 | // Output Upgrade Notice |
| 7127 | 7127 | $matches = null; |
| 7128 | - $regexp = '~==\s*Upgrade Notice\s*==\s*=\s*(.*)\s*=(.*)(=\s*' . preg_quote( GEODIRECTORY_VERSION ) . '\s*=|$)~Uis'; |
|
| 7128 | + $regexp = '~==\s*Upgrade Notice\s*==\s*=\s*(.*)\s*=(.*)(=\s*' . preg_quote(GEODIRECTORY_VERSION) . '\s*=|$)~Uis'; |
|
| 7129 | 7129 | $upgrade_notice = ''; |
| 7130 | - if ( preg_match( $regexp, $content, $matches ) ) {
|
|
| 7131 | - if(empty($matches)){return;}
|
|
| 7130 | + if (preg_match($regexp, $content, $matches)) {
|
|
| 7131 | + if (empty($matches)) {return; }
|
|
| 7132 | 7132 | //print_r($matches ); |
| 7133 | - $version = trim( $matches[1] ); |
|
| 7134 | - if($version && $version>GEODIRECTORY_VERSION){
|
|
| 7133 | + $version = trim($matches[1]); |
|
| 7134 | + if ($version && $version > GEODIRECTORY_VERSION) {
|
|
| 7135 | 7135 | |
| 7136 | 7136 | |
| 7137 | - $notices = (array) preg_split('~[\r\n]+~', trim( $matches[2] ) );
|
|
| 7138 | - if ( version_compare( WC_VERSION, $version, '<' ) ) {
|
|
| 7137 | + $notices = (array) preg_split('~[\r\n]+~', trim($matches[2]));
|
|
| 7138 | + if (version_compare(WC_VERSION, $version, '<')) {
|
|
| 7139 | 7139 | $upgrade_notice .= '<div class="geodir_plugin_upgrade_notice">'; |
| 7140 | - foreach ( $notices as $index => $line ) {
|
|
| 7141 | - $upgrade_notice .= wp_kses_post( preg_replace( '~\[([^\]]*)\]\(([^\)]*)\)~', '<a href="${2}">${1}</a>', $line ) );
|
|
| 7140 | + foreach ($notices as $index => $line) {
|
|
| 7141 | + $upgrade_notice .= wp_kses_post(preg_replace('~\[([^\]]*)\]\(([^\)]*)\)~', '<a href="${2}">${1}</a>', $line));
|
|
| 7142 | 7142 | } |
| 7143 | 7143 | $upgrade_notice .= '</div> '; |
| 7144 | 7144 | } |
@@ -7162,7 +7162,7 @@ discard block |
||
| 7162 | 7162 | $default_language = $sitepress->get_default_language(); |
| 7163 | 7163 | if ($current_language != 'all' && $current_language != $default_language) {
|
| 7164 | 7164 | ?> |
| 7165 | - <div class="updated error notice-success" id="message"><p style="color:red"><strong><?php _e('Saving GeoDirectory pages settings on a different language breaks pages settings. Try to save after switching to default language.', 'geodirectory');?></strong></p></div>
|
|
| 7165 | + <div class="updated error notice-success" id="message"><p style="color:red"><strong><?php _e('Saving GeoDirectory pages settings on a different language breaks pages settings. Try to save after switching to default language.', 'geodirectory'); ?></strong></p></div>
|
|
| 7166 | 7166 | <?php |
| 7167 | 7167 | } |
| 7168 | 7168 | } |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | */ |
| 63 | 63 | function geodir_get_admin_option_form($current_tab) |
| 64 | 64 | {
|
| 65 | - geodir_admin_option_form($current_tab);// defined in admin template tags.php |
|
| 65 | + geodir_admin_option_form($current_tab); // defined in admin template tags.php |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | add_action('geodir_update_options_compatibility_settings', 'geodir_update_options_compatibility_settings');
|
| 71 | 71 | add_action('geodir_update_options_default_location_settings', 'geodir_location_form_submit');
|
| 72 | 72 | add_action('geodir_before_admin_panel', 'geodir_before_admin_panel'); // this function is in admin_functions.php
|
| 73 | -add_action('geodir_before_update_options', 'geodir_before_update_options',10,2);
|
|
| 73 | +add_action('geodir_before_update_options', 'geodir_before_update_options', 10, 2);
|
|
| 74 | 74 | |
| 75 | 75 | //add_action('geodir_before_admin_panel', 'geodir_autoinstall_admin_header');
|
| 76 | 76 | |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | |
| 237 | 237 | } |
| 238 | 238 | |
| 239 | -add_action('save_post', 'geodir_post_information_save',10,2);
|
|
| 239 | +add_action('save_post', 'geodir_post_information_save', 10, 2);
|
|
| 240 | 240 | |
| 241 | 241 | |
| 242 | 242 | |
@@ -263,7 +263,7 @@ discard block |
||
| 263 | 263 | |
| 264 | 264 | $gd_taxonomy = geodir_get_taxonomies($geodir_post_type); |
| 265 | 265 | |
| 266 | - if(!empty($gd_taxonomy)) {
|
|
| 266 | + if (!empty($gd_taxonomy)) {
|
|
| 267 | 267 | foreach ($gd_taxonomy as $tax) {
|
| 268 | 268 | |
| 269 | 269 | remove_meta_box($tax . 'div', $geodir_post_type, 'normal'); |
@@ -416,7 +416,7 @@ discard block |
||
| 416 | 416 | global $wpdb; |
| 417 | 417 | $listing_type = ($_REQUEST['listing_type'] != '') ? $_REQUEST['listing_type'] : 'gd_place'; |
| 418 | 418 | ?> |
| 419 | - <input type="hidden" name="listing_type" id="new_post_type" value="<?php echo $listing_type;?>"/> |
|
| 419 | + <input type="hidden" name="listing_type" id="new_post_type" value="<?php echo $listing_type; ?>"/> |
|
| 420 | 420 | <input type="hidden" name="manage_field_type" class="manage_field_type" value="<?php echo $_REQUEST['subtab']; ?>"/> |
| 421 | 421 | <ul> |
| 422 | 422 | |
@@ -441,11 +441,11 @@ discard block |
||
| 441 | 441 | |
| 442 | 442 | |
| 443 | 443 | ?> |
| 444 | - <li <?php echo $display;?>> |
|
| 445 | - <a id="gt-<?php echo $val['field_type'];?>-_-<?php echo $val['htmlvar_name'];?>" |
|
| 446 | - title="<?php echo $val['site_title'];?>" |
|
| 447 | - class="gt-draggable-form-items gt-<?php echo $val['field_type'];?> geodir-sort-<?php echo $val['htmlvar_name'];?>" |
|
| 448 | - href="javascript:void(0);"><b></b><?php _e($val['site_title'], 'geodirectory');?></a> |
|
| 444 | + <li <?php echo $display; ?>> |
|
| 445 | + <a id="gt-<?php echo $val['field_type']; ?>-_-<?php echo $val['htmlvar_name']; ?>" |
|
| 446 | + title="<?php echo $val['site_title']; ?>" |
|
| 447 | + class="gt-draggable-form-items gt-<?php echo $val['field_type']; ?> geodir-sort-<?php echo $val['htmlvar_name']; ?>" |
|
| 448 | + href="javascript:void(0);"><b></b><?php _e($val['site_title'], 'geodirectory'); ?></a> |
|
| 449 | 449 | </li><?php |
| 450 | 450 | |
| 451 | 451 | } |
@@ -513,40 +513,40 @@ discard block |
||
| 513 | 513 | |
| 514 | 514 | $listing_type = ($_REQUEST['listing_type'] != '') ? $_REQUEST['listing_type'] : 'gd_place'; |
| 515 | 515 | ?> |
| 516 | - <input type="hidden" name="listing_type" id="new_post_type" value="<?php echo $listing_type;?>"/> |
|
| 516 | + <input type="hidden" name="listing_type" id="new_post_type" value="<?php echo $listing_type; ?>"/> |
|
| 517 | 517 | <input type="hidden" name="manage_field_type" class="manage_field_type" value="<?php echo $_REQUEST['subtab']; ?>"/> |
| 518 | 518 | <ul class="full"> |
| 519 | 519 | <li><a id="gt-fieldset" class="gt-draggable-form-items gt-fieldset" |
| 520 | - href="javascript:void(0);"><?php _e('Fieldset', 'geodirectory');?></a></li>
|
|
| 520 | + href="javascript:void(0);"><?php _e('Fieldset', 'geodirectory'); ?></a></li>
|
|
| 521 | 521 | </ul> |
| 522 | 522 | <ul> |
| 523 | 523 | <li><a id="gt-text" class="gt-draggable-form-items gt-text" |
| 524 | - href="javascript:void(0);"><b></b><?php _e('Text', 'geodirectory');?></a></li>
|
|
| 524 | + href="javascript:void(0);"><b></b><?php _e('Text', 'geodirectory'); ?></a></li>
|
|
| 525 | 525 | <li><a id="gt-datepicker" class="gt-draggable-form-items gt-datepicker" |
| 526 | - href="javascript:void(0);"><b></b><?php _e('Date', 'geodirectory');?></a></li>
|
|
| 526 | + href="javascript:void(0);"><b></b><?php _e('Date', 'geodirectory'); ?></a></li>
|
|
| 527 | 527 | <li><a id="gt-textarea" class="gt-draggable-form-items gt-textarea" |
| 528 | - href="javascript:void(0);"><b></b><?php _e('Textarea', 'geodirectory');?></a></li>
|
|
| 528 | + href="javascript:void(0);"><b></b><?php _e('Textarea', 'geodirectory'); ?></a></li>
|
|
| 529 | 529 | <li><a id="gt-time" class="gt-draggable-form-items gt-time" |
| 530 | - href="javascript:void(0);"><b></b><?php _e('Time', 'geodirectory');?></a></li>
|
|
| 530 | + href="javascript:void(0);"><b></b><?php _e('Time', 'geodirectory'); ?></a></li>
|
|
| 531 | 531 | <li><a id="gt-checkbox" class="gt-draggable-form-items gt-checkbox" |
| 532 | - href="javascript:void(0);"><b></b><?php _e('Checkbox', 'geodirectory');?></a></li>
|
|
| 532 | + href="javascript:void(0);"><b></b><?php _e('Checkbox', 'geodirectory'); ?></a></li>
|
|
| 533 | 533 | <li><a id="gt-phone" class="gt-draggable-form-items gt-phone" |
| 534 | - href="javascript:void(0);"><b></b><?php _e('Phone', 'geodirectory');?></a></li>
|
|
| 534 | + href="javascript:void(0);"><b></b><?php _e('Phone', 'geodirectory'); ?></a></li>
|
|
| 535 | 535 | <li><a id="gt-radio" class="gt-draggable-form-items gt-radio" |
| 536 | - href="javascript:void(0);"><b></b><?php _e('Radio', 'geodirectory');?></a></li>
|
|
| 536 | + href="javascript:void(0);"><b></b><?php _e('Radio', 'geodirectory'); ?></a></li>
|
|
| 537 | 537 | <li><a id="gt-email" class="gt-draggable-form-items gt-email" |
| 538 | - href="javascript:void(0);"><b></b><?php _e('Email', 'geodirectory');?></a></li>
|
|
| 538 | + href="javascript:void(0);"><b></b><?php _e('Email', 'geodirectory'); ?></a></li>
|
|
| 539 | 539 | <li><a id="gt-select" class="gt-draggable-form-items gt-select" |
| 540 | - href="javascript:void(0);"><b></b><?php _e('Select', 'geodirectory');?></a></li>
|
|
| 541 | - <!--<li><a id="gt-taxonomy" class="gt-draggable-form-items gt-select" href="javascript:void(0);"><b></b><?php _e('Taxonomy', 'geodirectory');?></a></li>-->
|
|
| 540 | + href="javascript:void(0);"><b></b><?php _e('Select', 'geodirectory'); ?></a></li>
|
|
| 541 | + <!--<li><a id="gt-taxonomy" class="gt-draggable-form-items gt-select" href="javascript:void(0);"><b></b><?php _e('Taxonomy', 'geodirectory'); ?></a></li>-->
|
|
| 542 | 542 | <li><a id="gt-multiselect" class="gt-draggable-form-items gt-multiselect" |
| 543 | - href="javascript:void(0);"><b></b><?php _e('Multi Select', 'geodirectory');?></a></li>
|
|
| 543 | + href="javascript:void(0);"><b></b><?php _e('Multi Select', 'geodirectory'); ?></a></li>
|
|
| 544 | 544 | <li><a id="gt-url" class="gt-draggable-form-items gt-url" |
| 545 | - href="javascript:void(0);"><b></b><?php _e('URL', 'geodirectory');?></a></li>
|
|
| 545 | + href="javascript:void(0);"><b></b><?php _e('URL', 'geodirectory'); ?></a></li>
|
|
| 546 | 546 | <li><a id="gt-html" class="gt-draggable-form-items gt-html" |
| 547 | - href="javascript:void(0);"><b></b><?php _e('HTML', 'geodirectory');?></a></li>
|
|
| 547 | + href="javascript:void(0);"><b></b><?php _e('HTML', 'geodirectory'); ?></a></li>
|
|
| 548 | 548 | <li><a id="gt-file" class="gt-draggable-form-items gt-file" |
| 549 | - href="javascript:void(0);"><b></b><?php _e('File Upload', 'geodirectory');?></a></li>
|
|
| 549 | + href="javascript:void(0);"><b></b><?php _e('File Upload', 'geodirectory'); ?></a></li>
|
|
| 550 | 550 | |
| 551 | 551 | </ul> |
| 552 | 552 | |
@@ -663,7 +663,7 @@ discard block |
||
| 663 | 663 | |
| 664 | 664 | switch ($sub_tab) {
|
| 665 | 665 | case 'custom_fields': |
| 666 | - $note = sprintf(__('Click on any box below to add a field of that type on add %s listing form. You must be use a fieldset to group your fields.', 'geodirectory'), get_post_type_singular_label($listing_type));;
|
|
| 666 | + $note = sprintf(__('Click on any box below to add a field of that type on add %s listing form. You must be use a fieldset to group your fields.', 'geodirectory'), get_post_type_singular_label($listing_type)); ;
|
|
| 667 | 667 | break; |
| 668 | 668 | |
| 669 | 669 | case 'sorting_options': |
@@ -717,7 +717,7 @@ discard block |
||
| 717 | 717 | |
| 718 | 718 | switch ($sub_tab) {
|
| 719 | 719 | case 'custom_fields': |
| 720 | - $note = sprintf(__('Click to expand and view field related settings. You may drag and drop to arrange fields order on add %s listing form too.', 'geodirectory'), get_post_type_singular_label($listing_type));;
|
|
| 720 | + $note = sprintf(__('Click to expand and view field related settings. You may drag and drop to arrange fields order on add %s listing form too.', 'geodirectory'), get_post_type_singular_label($listing_type)); ;
|
|
| 721 | 721 | break; |
| 722 | 722 | |
| 723 | 723 | case 'sorting_options': |
@@ -816,13 +816,13 @@ discard block |
||
| 816 | 816 | $filter_arr['is_error_during_diagnose'] = true; |
| 817 | 817 | |
| 818 | 818 | if ($fix) {
|
| 819 | - $ms_bak_count = $wpdb->get_var("SELECT COUNT(*) FROM " . $table . "_ms_bak");// get backup table count
|
|
| 820 | - $new_table_count = $wpdb->get_var("SELECT COUNT(*) FROM " . $wpdb->prefix . "$table");// get new table count
|
|
| 819 | + $ms_bak_count = $wpdb->get_var("SELECT COUNT(*) FROM " . $table . "_ms_bak"); // get backup table count
|
|
| 820 | + $new_table_count = $wpdb->get_var("SELECT COUNT(*) FROM " . $wpdb->prefix . "$table"); // get new table count
|
|
| 821 | 821 | |
| 822 | 822 | if ($ms_bak_count == $new_table_count) {// if they are the same count rename to bak2
|
| 823 | 823 | //$filter_arr['output_str'] .= "<li>".sprintf( __('-->PROBLEM: %s table count is the same as new table, contact support' , 'geodirectory'), $table )."</li>" ;
|
| 824 | 824 | |
| 825 | - $wpdb->query("RENAME TABLE " . $table . "_ms_bak TO " . $table . "_ms_bak2");// rename bak table to new table
|
|
| 825 | + $wpdb->query("RENAME TABLE " . $table . "_ms_bak TO " . $table . "_ms_bak2"); // rename bak table to new table
|
|
| 826 | 826 | |
| 827 | 827 | if ($wpdb->query("SHOW TABLES LIKE '" . $table . "_ms_bak2'") && $wpdb->query("SHOW TABLES LIKE '" . $table . "_ms_bak'") == 0) {
|
| 828 | 828 | $filter_arr['output_str'] .= "<li>" . __('-->FIXED: Renamed and backed up the tables', 'geodirectory') . "</li>";
|
@@ -832,8 +832,8 @@ discard block |
||
| 832 | 832 | |
| 833 | 833 | } elseif ($ms_bak_count > $new_table_count) {//if backup is greater then restore it
|
| 834 | 834 | |
| 835 | - $wpdb->query("RENAME TABLE " . $wpdb->prefix . "$table TO " . $table . "_ms_bak2");// rename new table to bak2
|
|
| 836 | - $wpdb->query("RENAME TABLE " . $table . "_ms_bak TO " . $wpdb->prefix . "$table");// rename bak table to new table
|
|
| 835 | + $wpdb->query("RENAME TABLE " . $wpdb->prefix . "$table TO " . $table . "_ms_bak2"); // rename new table to bak2
|
|
| 836 | + $wpdb->query("RENAME TABLE " . $table . "_ms_bak TO " . $wpdb->prefix . "$table"); // rename bak table to new table
|
|
| 837 | 837 | |
| 838 | 838 | if ($wpdb->query("SHOW TABLES LIKE '" . $table . "_ms_bak2'") && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "$table'") && $wpdb->query("SHOW TABLES LIKE '$table'") == 0) {
|
| 839 | 839 | $filter_arr['output_str'] .= "<li>" . sprintf(__('-->FIXED: restored largest table %s', 'geodirectory'), $table) . "</li>";
|
@@ -843,7 +843,7 @@ discard block |
||
| 843 | 843 | |
| 844 | 844 | } elseif ($new_table_count > $ms_bak_count) {// we cant do much so rename the table to stop errors
|
| 845 | 845 | |
| 846 | - $wpdb->query("RENAME TABLE " . $table . "_ms_bak TO " . $table . "_ms_bak2");// rename ms_bak table to ms_bak2
|
|
| 846 | + $wpdb->query("RENAME TABLE " . $table . "_ms_bak TO " . $table . "_ms_bak2"); // rename ms_bak table to ms_bak2
|
|
| 847 | 847 | |
| 848 | 848 | if ($wpdb->query("SHOW TABLES LIKE '" . $table . "_ms_bak'") == 0) {
|
| 849 | 849 | $filter_arr['output_str'] .= "<li>" . sprintf(__('-->FIXED: table %s_ms_bak renamed and backed up', 'geodirectory'), $table) . "</li>";
|
@@ -1027,7 +1027,7 @@ discard block |
||
| 1027 | 1027 | $post_categories[$p->post_type . 'category'] = str_replace("d:", "", $post_categories[$p->post_type . 'category']);
|
| 1028 | 1028 | foreach (explode(",", $post_categories[$p->post_type . 'category']) as $cat_part) {
|
| 1029 | 1029 | if (is_numeric($cat_part)) {
|
| 1030 | - $raw_cats[] = (int)$cat_part; |
|
| 1030 | + $raw_cats[] = (int) $cat_part; |
|
| 1031 | 1031 | } |
| 1032 | 1032 | } |
| 1033 | 1033 | |
@@ -1337,9 +1337,9 @@ discard block |
||
| 1337 | 1337 | ////////////////////////////////// |
| 1338 | 1338 | $option_value = get_option('geodir_home_page');
|
| 1339 | 1339 | $page = get_post($option_value); |
| 1340 | - if(!empty($page)){$page_found = $page->ID;}else{$page_found = '';}
|
|
| 1340 | + if (!empty($page)) {$page_found = $page->ID; } else {$page_found = ''; }
|
|
| 1341 | 1341 | |
| 1342 | - if(!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status=='publish') |
|
| 1342 | + if (!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status == 'publish') |
|
| 1343 | 1343 | $output_str .= "<li>" . __('GD Home page exists with proper setting.', 'geodirectory') . "</li>";
|
| 1344 | 1344 | else {
|
| 1345 | 1345 | $is_error_during_diagnose = true; |
@@ -1362,9 +1362,9 @@ discard block |
||
| 1362 | 1362 | ////////////////////////////////// |
| 1363 | 1363 | $option_value = get_option('geodir_add_listing_page');
|
| 1364 | 1364 | $page = get_post($option_value); |
| 1365 | - if(!empty($page)){$page_found = $page->ID;}else{$page_found = '';}
|
|
| 1365 | + if (!empty($page)) {$page_found = $page->ID; } else {$page_found = ''; }
|
|
| 1366 | 1366 | |
| 1367 | - if(!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status=='publish') |
|
| 1367 | + if (!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status == 'publish') |
|
| 1368 | 1368 | $output_str .= "<li>" . __('Add Listing page exists with proper setting.', 'geodirectory') . "</li>";
|
| 1369 | 1369 | else {
|
| 1370 | 1370 | $is_error_during_diagnose = true; |
@@ -1388,9 +1388,9 @@ discard block |
||
| 1388 | 1388 | ////////////////////////////////// |
| 1389 | 1389 | $option_value = get_option('geodir_preview_page');
|
| 1390 | 1390 | $page = get_post($option_value); |
| 1391 | - if(!empty($page)){$page_found = $page->ID;}else{$page_found = '';}
|
|
| 1391 | + if (!empty($page)) {$page_found = $page->ID; } else {$page_found = ''; }
|
|
| 1392 | 1392 | |
| 1393 | - if(!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status=='publish') |
|
| 1393 | + if (!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status == 'publish') |
|
| 1394 | 1394 | $output_str .= "<li>" . __('Listing Preview page exists with proper setting.', 'geodirectory') . "</li>";
|
| 1395 | 1395 | else {
|
| 1396 | 1396 | $is_error_during_diagnose = true; |
@@ -1413,9 +1413,9 @@ discard block |
||
| 1413 | 1413 | ////////////////////////////////// |
| 1414 | 1414 | $option_value = get_option('geodir_success_page');
|
| 1415 | 1415 | $page = get_post($option_value); |
| 1416 | - if(!empty($page)){$page_found = $page->ID;}else{$page_found = '';}
|
|
| 1416 | + if (!empty($page)) {$page_found = $page->ID; } else {$page_found = ''; }
|
|
| 1417 | 1417 | |
| 1418 | - if(!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status=='publish') |
|
| 1418 | + if (!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status == 'publish') |
|
| 1419 | 1419 | $output_str .= "<li>" . __('Listing Success page exists with proper setting.', 'geodirectory') . "</li>";
|
| 1420 | 1420 | else {
|
| 1421 | 1421 | $is_error_during_diagnose = true; |
@@ -1438,9 +1438,9 @@ discard block |
||
| 1438 | 1438 | ////////////////////////////////// |
| 1439 | 1439 | $option_value = get_option('geodir_info_page');
|
| 1440 | 1440 | $page = get_post($option_value); |
| 1441 | - if(!empty($page)){$page_found = $page->ID;}else{$page_found = '';}
|
|
| 1441 | + if (!empty($page)) {$page_found = $page->ID; } else {$page_found = ''; }
|
|
| 1442 | 1442 | |
| 1443 | - if(!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status=='publish') |
|
| 1443 | + if (!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status == 'publish') |
|
| 1444 | 1444 | $output_str .= "<li>" . __('Info page exists with proper setting.', 'geodirectory') . "</li>";
|
| 1445 | 1445 | else {
|
| 1446 | 1446 | $is_error_during_diagnose = true; |
@@ -1463,9 +1463,9 @@ discard block |
||
| 1463 | 1463 | ////////////////////////////////// |
| 1464 | 1464 | $option_value = get_option('geodir_login_page');
|
| 1465 | 1465 | $page = get_post($option_value); |
| 1466 | - if(!empty($page)){$page_found = $page->ID;}else{$page_found = '';}
|
|
| 1466 | + if (!empty($page)) {$page_found = $page->ID; } else {$page_found = ''; }
|
|
| 1467 | 1467 | |
| 1468 | - if(!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status=='publish') |
|
| 1468 | + if (!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status == 'publish') |
|
| 1469 | 1469 | $output_str .= "<li>" . __('Login page exists with proper setting.', 'geodirectory') . "</li>";
|
| 1470 | 1470 | else {
|
| 1471 | 1471 | $is_error_during_diagnose = true; |
@@ -1488,9 +1488,9 @@ discard block |
||
| 1488 | 1488 | ////////////////////////////////// |
| 1489 | 1489 | $option_value = get_option('geodir_location_page');
|
| 1490 | 1490 | $page = get_post($option_value); |
| 1491 | - if(!empty($page)){$page_found = $page->ID;}else{$page_found = '';}
|
|
| 1491 | + if (!empty($page)) {$page_found = $page->ID; } else {$page_found = ''; }
|
|
| 1492 | 1492 | |
| 1493 | - if(!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status=='publish') |
|
| 1493 | + if (!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status == 'publish') |
|
| 1494 | 1494 | $output_str .= "<li>" . __('Location page exists with proper setting.', 'geodirectory') . "</li>";
|
| 1495 | 1495 | else {
|
| 1496 | 1496 | $is_error_during_diagnose = true; |
@@ -1508,13 +1508,13 @@ discard block |
||
| 1508 | 1508 | /* Diagnose Location Page Ends */ |
| 1509 | 1509 | //////////////////////////////// |
| 1510 | 1510 | |
| 1511 | - $page_chk_arr = array('output_str'=>$output_str,'is_error_during_diagnose'=>$is_error_during_diagnose );
|
|
| 1511 | + $page_chk_arr = array('output_str'=>$output_str, 'is_error_during_diagnose'=>$is_error_during_diagnose);
|
|
| 1512 | 1512 | /** |
| 1513 | 1513 | * This action is called at the end of the GD Tools page check function. |
| 1514 | 1514 | * |
| 1515 | 1515 | * @since 1.5.2 |
| 1516 | 1516 | */ |
| 1517 | - $page_chk_arr = apply_filters('geodir_diagnose_default_pages',$page_chk_arr);
|
|
| 1517 | + $page_chk_arr = apply_filters('geodir_diagnose_default_pages', $page_chk_arr);
|
|
| 1518 | 1518 | |
| 1519 | 1519 | $output_str = $page_chk_arr['output_str']; |
| 1520 | 1520 | $is_error_during_diagnose = $page_chk_arr['is_error_during_diagnose']; |
@@ -1711,7 +1711,7 @@ discard block |
||
| 1711 | 1711 | |
| 1712 | 1712 | if (($handle = fopen($target_path, "r")) !== FALSE) {
|
| 1713 | 1713 | while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
|
| 1714 | - if(is_array($data) && !empty($data)) {
|
|
| 1714 | + if (is_array($data) && !empty($data)) {
|
|
| 1715 | 1715 | $file[] = '"' . implode('","', $data) . '"';
|
| 1716 | 1716 | } |
| 1717 | 1717 | } |
@@ -1886,7 +1886,7 @@ discard block |
||
| 1886 | 1886 | |
| 1887 | 1887 | // Post status |
| 1888 | 1888 | if ($customKeyarray[$c] == 'post_status') {
|
| 1889 | - $post_status = sanitize_key( $buffer[$c] ); |
|
| 1889 | + $post_status = sanitize_key($buffer[$c]); |
|
| 1890 | 1890 | } |
| 1891 | 1891 | } |
| 1892 | 1892 | |
@@ -1904,8 +1904,8 @@ discard block |
||
| 1904 | 1904 | |
| 1905 | 1905 | // Default post status |
| 1906 | 1906 | $default_status = 'publish'; |
| 1907 | - $post_status = !empty( $post_status ) ? sanitize_key( $post_status ) : $default_status; |
|
| 1908 | - $post_status = !empty( $wp_post_statuses ) && !isset( $wp_post_statuses[$post_status] ) ? $default_status : $post_status; |
|
| 1907 | + $post_status = !empty($post_status) ? sanitize_key($post_status) : $default_status; |
|
| 1908 | + $post_status = !empty($wp_post_statuses) && !isset($wp_post_statuses[$post_status]) ? $default_status : $post_status; |
|
| 1909 | 1909 | |
| 1910 | 1910 | $my_post['post_title'] = $post_title; |
| 1911 | 1911 | $my_post['post_content'] = $post_desc; |
@@ -1949,7 +1949,7 @@ discard block |
||
| 1949 | 1949 | $payment_info = array(); |
| 1950 | 1950 | $package_info = array(); |
| 1951 | 1951 | |
| 1952 | - $package_info = (array)geodir_post_package_info($package_info, '', $buffer[5]); |
|
| 1952 | + $package_info = (array) geodir_post_package_info($package_info, '', $buffer[5]); |
|
| 1953 | 1953 | $package_id = ''; |
| 1954 | 1954 | if (isset($gd_post_info['package_id']) && $gd_post_info['package_id'] != '') {
|
| 1955 | 1955 | $package_id = $gd_post_info['package_id']; |
@@ -2050,11 +2050,11 @@ discard block |
||
| 2050 | 2050 | } |
| 2051 | 2051 | |
| 2052 | 2052 | // Add the tab in left sidebar menu fro import & export page. |
| 2053 | -add_filter( 'geodir_settings_tabs_array', 'geodir_import_export_tab', 94 ); |
|
| 2053 | +add_filter('geodir_settings_tabs_array', 'geodir_import_export_tab', 94);
|
|
| 2054 | 2054 | |
| 2055 | 2055 | // Handle ajax request for impot/export. |
| 2056 | -add_action( 'wp_ajax_geodir_import_export', 'geodir_ajax_import_export' ); |
|
| 2057 | -add_action( 'wp_ajax_nopriv_geodir_import_exportn', 'geodir_ajax_import_export' ); |
|
| 2056 | +add_action('wp_ajax_geodir_import_export', 'geodir_ajax_import_export');
|
|
| 2057 | +add_action('wp_ajax_nopriv_geodir_import_exportn', 'geodir_ajax_import_export');
|
|
| 2058 | 2058 | |
| 2059 | 2059 | |
| 2060 | 2060 | /** |
@@ -2065,40 +2065,40 @@ discard block |
||
| 2065 | 2065 | * @param $post_id int $post_id The post ID of the post being saved. |
| 2066 | 2066 | * @param $post object $post The post object of the post being saved. |
| 2067 | 2067 | */ |
| 2068 | -function geodir_update_location_prefix($post_id,$post){
|
|
| 2069 | - if($post->post_type=='page' && $post->post_name && $post_id==get_option('geodir_location_page')){
|
|
| 2070 | - update_option('geodir_location_prefix',$post->post_name);
|
|
| 2068 | +function geodir_update_location_prefix($post_id, $post) {
|
|
| 2069 | + if ($post->post_type == 'page' && $post->post_name && $post_id == get_option('geodir_location_page')) {
|
|
| 2070 | + update_option('geodir_location_prefix', $post->post_name);
|
|
| 2071 | 2071 | } |
| 2072 | 2072 | |
| 2073 | 2073 | } |
| 2074 | 2074 | |
| 2075 | -add_action('save_post', 'geodir_update_location_prefix',10,2);
|
|
| 2075 | +add_action('save_post', 'geodir_update_location_prefix', 10, 2);
|
|
| 2076 | 2076 | |
| 2077 | -add_action( 'wp_ajax_geodir_ga_callback', 'geodir_ga_callback' ); |
|
| 2077 | +add_action('wp_ajax_geodir_ga_callback', 'geodir_ga_callback');
|
|
| 2078 | 2078 | |
| 2079 | -function geodir_ga_callback(){
|
|
| 2079 | +function geodir_ga_callback() {
|
|
| 2080 | 2080 | |
| 2081 | -if(isset($_REQUEST['code']) && $_REQUEST['code']) {
|
|
| 2081 | +if (isset($_REQUEST['code']) && $_REQUEST['code']) {
|
|
| 2082 | 2082 | $oAuthURL = "https://www.googleapis.com/oauth2/v3/token?"; |
| 2083 | - $code = "code=".$_REQUEST['code']; |
|
| 2083 | + $code = "code=" . $_REQUEST['code']; |
|
| 2084 | 2084 | $grant_type = "&grant_type=authorization_code"; |
| 2085 | 2085 | $redirect_uri = "&redirect_uri=" . admin_url('admin-ajax.php') . "?action=geodir_ga_callback";
|
| 2086 | - $client_id = "&client_id=".get_option('geodir_ga_client_id');
|
|
| 2087 | - $client_secret = "&client_secret=".get_option('geodir_ga_client_secret');
|
|
| 2086 | + $client_id = "&client_id=" . get_option('geodir_ga_client_id');
|
|
| 2087 | + $client_secret = "&client_secret=" . get_option('geodir_ga_client_secret');
|
|
| 2088 | 2088 | |
| 2089 | - $auth_url = $oAuthURL . $code . $redirect_uri . $grant_type . $client_id .$client_secret; |
|
| 2089 | + $auth_url = $oAuthURL . $code . $redirect_uri . $grant_type . $client_id . $client_secret; |
|
| 2090 | 2090 | |
| 2091 | 2091 | $response = wp_remote_post($auth_url, array('timeout' => 15));
|
| 2092 | 2092 | |
| 2093 | 2093 | //print_r($response); |
| 2094 | 2094 | |
| 2095 | - $error_msg = __('Something went wrong','geodirectory');
|
|
| 2096 | - if(!empty($response['response']['code']) && $response['response']['code']==200){
|
|
| 2095 | + $error_msg = __('Something went wrong', 'geodirectory');
|
|
| 2096 | + if (!empty($response['response']['code']) && $response['response']['code'] == 200) {
|
|
| 2097 | 2097 | |
| 2098 | 2098 | $parts = json_decode($response['body']); |
| 2099 | 2099 | //print_r($parts); |
| 2100 | - if(!isset($parts->access_token)){echo $error_msg." - #1";exit;}
|
|
| 2101 | - else{
|
|
| 2100 | + if (!isset($parts->access_token)) {echo $error_msg . " - #1"; exit; }
|
|
| 2101 | + else {
|
|
| 2102 | 2102 | |
| 2103 | 2103 | update_option('gd_ga_access_token', $parts->access_token);
|
| 2104 | 2104 | update_option('gd_ga_refresh_token', $parts->refresh_token);
|
@@ -2107,25 +2107,25 @@ discard block |
||
| 2107 | 2107 | |
| 2108 | 2108 | |
| 2109 | 2109 | } |
| 2110 | - elseif(!empty($response['response']['code'])) {
|
|
| 2110 | + elseif (!empty($response['response']['code'])) {
|
|
| 2111 | 2111 | $parts = json_decode($response['body']); |
| 2112 | 2112 | |
| 2113 | - if(isset($parts->error)){
|
|
| 2114 | - echo $parts->error.": ".$parts->error_description;exit; |
|
| 2115 | - }else{
|
|
| 2116 | - echo $error_msg." - #2";exit; |
|
| 2113 | + if (isset($parts->error)) {
|
|
| 2114 | + echo $parts->error . ": " . $parts->error_description; exit; |
|
| 2115 | + } else {
|
|
| 2116 | + echo $error_msg . " - #2"; exit; |
|
| 2117 | 2117 | } |
| 2118 | 2118 | |
| 2119 | - }else{
|
|
| 2119 | + } else {
|
|
| 2120 | 2120 | |
| 2121 | - echo $error_msg." - #3";exit; |
|
| 2121 | + echo $error_msg . " - #3"; exit; |
|
| 2122 | 2122 | |
| 2123 | 2123 | } |
| 2124 | 2124 | } |
| 2125 | 2125 | exit; |
| 2126 | 2126 | } |
| 2127 | 2127 | |
| 2128 | -add_filter( 'icl_make_duplicate', 'geodir_icl_make_duplicate', 11, 4 ); |
|
| 2128 | +add_filter('icl_make_duplicate', 'geodir_icl_make_duplicate', 11, 4);
|
|
| 2129 | 2129 | |
| 2130 | 2130 | if (isset($_REQUEST['tab']) && $_REQUEST['tab'] == 'permalink_settings') {
|
| 2131 | 2131 | add_action('geodir_before_admin_panel', 'geodir_wpml_permalink_setting_notice');
|
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | * @param array $tabs The array of tabs to display. |
| 53 | 53 | */ |
| 54 | 54 | $tabs = apply_filters('geodir_settings_tabs_array', $tabs);
|
| 55 | - update_option('geodir_tabs', $tabs);// Important to show settings menu dropdown
|
|
| 55 | + update_option('geodir_tabs', $tabs); // Important to show settings menu dropdown
|
|
| 56 | 56 | |
| 57 | 57 | foreach ($tabs as $name => $args) : |
| 58 | 58 | $label = $args['label']; |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | return false;*/ |
| 201 | 201 | }); |
| 202 | 202 | |
| 203 | - <?php if (isset($_GET['subtab']) && $_GET['subtab']) echo 'jQuery("ul.subsubsub li a[href=#'.$_GET['subtab'].']").click();'; ?>
|
|
| 203 | + <?php if (isset($_GET['subtab']) && $_GET['subtab']) echo 'jQuery("ul.subsubsub li a[href=#' . $_GET['subtab'] . ']").click();'; ?>
|
|
| 204 | 204 | |
| 205 | 205 | // Countries |
| 206 | 206 | jQuery('select#geodirectory_allowed_countries').change(function () {
|
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | jQuery('.geodirectory-nav-tab-wrapper a').click(function () {
|
| 235 | 235 | if (changed) {
|
| 236 | 236 | window.onbeforeunload = function () {
|
| 237 | - return '<?php echo __( 'The changes you made will be lost if you navigate away from this page.', 'geodirectory'); ?>'; |
|
| 237 | + return '<?php echo __('The changes you made will be lost if you navigate away from this page.', 'geodirectory'); ?>';
|
|
| 238 | 238 | } |
| 239 | 239 | } else {
|
| 240 | 240 | window.onbeforeunload = ''; |
@@ -339,7 +339,7 @@ discard block |
||
| 339 | 339 | ?> |
| 340 | 340 | |
| 341 | 341 | <p class="submit"> |
| 342 | - <input <?php echo $hide_save_button;?> name="save" class="button-primary" type="submit" value="<?php _e('Save changes', 'geodirectory'); ?>" />
|
|
| 342 | + <input <?php echo $hide_save_button; ?> name="save" class="button-primary" type="submit" value="<?php _e('Save changes', 'geodirectory'); ?>" />
|
|
| 343 | 343 | <input type="hidden" name="subtab" id="last_tab" /> |
| 344 | 344 | </p> |
| 345 | 345 | |
@@ -408,7 +408,7 @@ discard block |
||
| 408 | 408 | |
| 409 | 409 | ?> |
| 410 | 410 | |
| 411 | - <h3><?php _e('Set Default Location', 'geodirectory');?></h3>
|
|
| 411 | + <h3><?php _e('Set Default Location', 'geodirectory'); ?></h3>
|
|
| 412 | 412 | |
| 413 | 413 | <input type="hidden" name="add_location" value="location"> |
| 414 | 414 | |
@@ -416,16 +416,16 @@ discard block |
||
| 416 | 416 | echo $location_result->location_id; |
| 417 | 417 | } ?>"> |
| 418 | 418 | |
| 419 | - <input type="hidden" name="address" id="<?php echo $prefix;?>address" value=""> |
|
| 419 | + <input type="hidden" name="address" id="<?php echo $prefix; ?>address" value=""> |
|
| 420 | 420 | |
| 421 | 421 | <table class="form-table default_location_form"> |
| 422 | 422 | <tbody> |
| 423 | 423 | <tr valign="top" class="single_select_page"> |
| 424 | - <th class="titledesc" scope="row"><?php _e('City', 'geodirectory');?></th>
|
|
| 424 | + <th class="titledesc" scope="row"><?php _e('City', 'geodirectory'); ?></th>
|
|
| 425 | 425 | <td class="forminp"> |
| 426 | 426 | <div class="gtd-formfeild required"> |
| 427 | 427 | <input class="require" type="text" size="80" style="width:440px" |
| 428 | - id="<?php echo $prefix;?>city" name="city" |
|
| 428 | + id="<?php echo $prefix; ?>city" name="city" |
|
| 429 | 429 | value="<?php if (isset($location_result->city)) {
|
| 430 | 430 | echo $location_result->city; |
| 431 | 431 | } ?>"/> |
@@ -437,11 +437,11 @@ discard block |
||
| 437 | 437 | </td> |
| 438 | 438 | </tr> |
| 439 | 439 | <tr valign="top" class="single_select_page"> |
| 440 | - <th class="titledesc" scope="row"><?php _e('Region', 'geodirectory');?></th>
|
|
| 440 | + <th class="titledesc" scope="row"><?php _e('Region', 'geodirectory'); ?></th>
|
|
| 441 | 441 | <td class="forminp"> |
| 442 | 442 | <div class="gtd-formfeild required"> |
| 443 | 443 | <input class="require" type="text" size="80" style="width:440px" |
| 444 | - id="<?php echo $prefix;?>region" name="region" |
|
| 444 | + id="<?php echo $prefix; ?>region" name="region" |
|
| 445 | 445 | value="<?php if (isset($location_result->region)) {
|
| 446 | 446 | echo $location_result->region; |
| 447 | 447 | } ?>"/> |
@@ -453,7 +453,7 @@ discard block |
||
| 453 | 453 | </td> |
| 454 | 454 | </tr> |
| 455 | 455 | <tr valign="top" class="single_select_page"> |
| 456 | - <th class="titledesc" scope="row"><?php _e('Country', 'geodirectory');?></th>
|
|
| 456 | + <th class="titledesc" scope="row"><?php _e('Country', 'geodirectory'); ?></th>
|
|
| 457 | 457 | <td class="forminp"> |
| 458 | 458 | <div class="gtd-formfeild required" style="padding-top:10px;"> |
| 459 | 459 | <?php |
@@ -462,7 +462,7 @@ discard block |
||
| 462 | 462 | ?> |
| 463 | 463 | <select id="<?php echo $prefix ?>country" class="chosen_select" |
| 464 | 464 | data-location_type="country" name="<?php echo $prefix ?>country" |
| 465 | - data-placeholder="<?php _e('Choose a country.', 'geodirectory');?>"
|
|
| 465 | + data-placeholder="<?php _e('Choose a country.', 'geodirectory'); ?>"
|
|
| 466 | 466 | data-addsearchtermonnorecord="1" data-ajaxchosen="0" data-autoredirect="0" |
| 467 | 467 | data-showeverywhere="0"> |
| 468 | 468 | <?php geodir_get_country_dl($country, $prefix); ?> |
@@ -479,7 +479,7 @@ discard block |
||
| 479 | 479 | </tr> |
| 480 | 480 | <tr valign="top" class="single_select_page"> |
| 481 | 481 | <th class="titledesc" |
| 482 | - scope="row"><?php _e('Set Location on Map', 'geodirectory');?></th>
|
|
| 482 | + scope="row"><?php _e('Set Location on Map', 'geodirectory'); ?></th>
|
|
| 483 | 483 | <td class="forminp"> |
| 484 | 484 | <?php |
| 485 | 485 | /** |
@@ -487,15 +487,15 @@ discard block |
||
| 487 | 487 | * |
| 488 | 488 | * @since 1.0.0 |
| 489 | 489 | */ |
| 490 | - include(geodir_plugin_path() . "/geodirectory-functions/map-functions/map_on_add_listing_page.php");?> |
|
| 490 | + include(geodir_plugin_path() . "/geodirectory-functions/map-functions/map_on_add_listing_page.php"); ?> |
|
| 491 | 491 | </td> |
| 492 | 492 | </tr> |
| 493 | 493 | <tr valign="top" class="single_select_page"> |
| 494 | - <th class="titledesc" scope="row"><?php _e('City Latitude', 'geodirectory');?></th>
|
|
| 494 | + <th class="titledesc" scope="row"><?php _e('City Latitude', 'geodirectory'); ?></th>
|
|
| 495 | 495 | <td class="forminp"> |
| 496 | 496 | <div class="gtd-formfeild required" style="padding-top:10px;"> |
| 497 | 497 | <input type="text" class="require" size="80" style="width:440px" |
| 498 | - id="<?php echo $prefix;?>latitude" name="latitude" |
|
| 498 | + id="<?php echo $prefix; ?>latitude" name="latitude" |
|
| 499 | 499 | value="<?php if (isset($location_result->city_latitude)) {
|
| 500 | 500 | echo $location_result->city_latitude; |
| 501 | 501 | } ?>"/> |
@@ -508,11 +508,11 @@ discard block |
||
| 508 | 508 | </tr> |
| 509 | 509 | <tr valign="top" class="single_select_page"> |
| 510 | 510 | <th class="titledesc" |
| 511 | - scope="row"><?php _e('City Longitude', 'geodirectory');?></th>
|
|
| 511 | + scope="row"><?php _e('City Longitude', 'geodirectory'); ?></th>
|
|
| 512 | 512 | <td class="forminp"> |
| 513 | 513 | <div class="gtd-formfeild required" style="padding-top:10px;"> |
| 514 | 514 | <input type="text" class="require" size="80" style="width:440px" |
| 515 | - id="<?php echo $prefix;?>longitude" name="longitude" |
|
| 515 | + id="<?php echo $prefix; ?>longitude" name="longitude" |
|
| 516 | 516 | value="<?php if (isset($location_result->city_longitude)) {
|
| 517 | 517 | echo $location_result->city_longitude; |
| 518 | 518 | } ?>"/> |
@@ -788,7 +788,7 @@ discard block |
||
| 788 | 788 | <div class="gd-content-heading"> |
| 789 | 789 | |
| 790 | 790 | |
| 791 | - <h3><?php _e('Theme Compatability Settings', 'geodirectory');?></h3>
|
|
| 791 | + <h3><?php _e('Theme Compatability Settings', 'geodirectory'); ?></h3>
|
|
| 792 | 792 | <style> |
| 793 | 793 | .gd-theme-compat-table {
|
| 794 | 794 | width: 100%; |
@@ -819,11 +819,11 @@ discard block |
||
| 819 | 819 | </div> |
| 820 | 820 | <?php }?> |
| 821 | 821 | |
| 822 | - <h4><?php _e('Select Theme Compatibility Pack', 'geodirectory');?></h4>
|
|
| 822 | + <h4><?php _e('Select Theme Compatibility Pack', 'geodirectory'); ?></h4>
|
|
| 823 | 823 | |
| 824 | 824 | <select name="gd_theme_compat" id="gd_theme_compat"> |
| 825 | - <option value=""><?php _e('Select Theme', 'geodirectory');?></option>
|
|
| 826 | - <option value="custom"><?php _e('Custom', 'geodirectory');?></option>
|
|
| 825 | + <option value=""><?php _e('Select Theme', 'geodirectory'); ?></option>
|
|
| 826 | + <option value="custom"><?php _e('Custom', 'geodirectory'); ?></option>
|
|
| 827 | 827 | <?php |
| 828 | 828 | $theme_arr = get_option('gd_theme_compats');
|
| 829 | 829 | $theme_active = get_option('gd_theme_compat');
|
@@ -842,20 +842,20 @@ discard block |
||
| 842 | 842 | ?> |
| 843 | 843 | </select> |
| 844 | 844 | <button onclick="gd_comp_export();" type="button" |
| 845 | - class="button-primary"><?php _e('Export', 'geodirectory');?></button>
|
|
| 845 | + class="button-primary"><?php _e('Export', 'geodirectory'); ?></button>
|
|
| 846 | 846 | <button onclick="gd_comp_import();" type="button" |
| 847 | - class="button-primary"><?php _e('Import', 'geodirectory');?></button>
|
|
| 847 | + class="button-primary"><?php _e('Import', 'geodirectory'); ?></button>
|
|
| 848 | 848 | |
| 849 | 849 | <div class="gd-comp-import-export"> |
| 850 | 850 | <textarea id="gd-import-export-theme-comp" |
| 851 | - placeholder="<?php _e('Paste the JSON code here and then click import again', 'geodirectory');?>"></textarea>
|
|
| 851 | + placeholder="<?php _e('Paste the JSON code here and then click import again', 'geodirectory'); ?>"></textarea>
|
|
| 852 | 852 | </div> |
| 853 | 853 | <script> |
| 854 | 854 | |
| 855 | 855 | function gd_comp_export() {
|
| 856 | 856 | theme = jQuery('#gd_theme_compat').val();
|
| 857 | 857 | if (theme == '' || theme == 'custom') {
|
| 858 | - alert("<?php _e('Please select a theme to export','geodirectory');?>");
|
|
| 858 | + alert("<?php _e('Please select a theme to export', 'geodirectory'); ?>");
|
|
| 859 | 859 | return false; |
| 860 | 860 | } |
| 861 | 861 | jQuery('.gd-comp-import-export').show();
|
@@ -889,9 +889,9 @@ discard block |
||
| 889 | 889 | |
| 890 | 890 | jQuery.post(ajaxurl, data, function (response) {
|
| 891 | 891 | if (response == '0') {
|
| 892 | - alert("<?php _e('Something went wrong','geodirectory');?>");
|
|
| 892 | + alert("<?php _e('Something went wrong', 'geodirectory'); ?>");
|
|
| 893 | 893 | } else {
|
| 894 | - alert("<?php _e('Theme Compatibility Imported','geodirectory');?>");
|
|
| 894 | + alert("<?php _e('Theme Compatibility Imported', 'geodirectory'); ?>");
|
|
| 895 | 895 | jQuery('#gd-import-export-theme-comp').val('');
|
| 896 | 896 | jQuery('.gd-comp-import-export').hide();
|
| 897 | 897 | jQuery('#gd_theme_compat').append(new Option(response, response));
|
@@ -932,14 +932,14 @@ discard block |
||
| 932 | 932 | |
| 933 | 933 | </script> |
| 934 | 934 | |
| 935 | - <h4><?php _e('Main Wrapper Actions', 'geodirectory');?></h4>
|
|
| 935 | + <h4><?php _e('Main Wrapper Actions', 'geodirectory'); ?></h4>
|
|
| 936 | 936 | |
| 937 | 937 | <table class="form-table gd-theme-compat-table"> |
| 938 | 938 | <tbody> |
| 939 | 939 | <tr> |
| 940 | - <td><strong><?php _e('Hook', 'geodirectory');?></strong></td>
|
|
| 941 | - <td><strong><?php _e('ID', 'geodirectory');?></strong></td>
|
|
| 942 | - <td><strong><?php _e('Class', 'geodirectory');?></strong></td>
|
|
| 940 | + <td><strong><?php _e('Hook', 'geodirectory'); ?></strong></td>
|
|
| 941 | + <td><strong><?php _e('ID', 'geodirectory'); ?></strong></td>
|
|
| 942 | + <td><strong><?php _e('Class', 'geodirectory'); ?></strong></td>
|
|
| 943 | 943 | </tr> |
| 944 | 944 | |
| 945 | 945 | |
@@ -957,7 +957,7 @@ discard block |
||
| 957 | 957 | |
| 958 | 958 | <tr class="gd-theme-comp-out"> |
| 959 | 959 | <td colspan="3"> |
| 960 | - <span><?php _e('Output:', 'geodirectory');?></span>
|
|
| 960 | + <span><?php _e('Output:', 'geodirectory'); ?></span>
|
|
| 961 | 961 | <textarea name="geodir_wrapper_open_replace" |
| 962 | 962 | placeholder='<div id="[id]" class="[class]">'><?php if (isset($tc['geodir_wrapper_open_replace'])) {
|
| 963 | 963 | echo $tc['geodir_wrapper_open_replace']; |
@@ -971,14 +971,14 @@ discard block |
||
| 971 | 971 | <small>geodir_wrapper_close</small> |
| 972 | 972 | </td> |
| 973 | 973 | <td><input disabled="disabled" type="text" name="geodir_wrapper_open_id" |
| 974 | - placeholder="<?php _e('Not used', 'geodirectory');?>"/></td>
|
|
| 974 | + placeholder="<?php _e('Not used', 'geodirectory'); ?>"/></td>
|
|
| 975 | 975 | <td><input disabled="disabled" type="text" name="geodir_wrapper_open_class" |
| 976 | - placeholder="<?php _e('Not used', 'geodirectory');?>"/></td>
|
|
| 976 | + placeholder="<?php _e('Not used', 'geodirectory'); ?>"/></td>
|
|
| 977 | 977 | </tr> |
| 978 | 978 | |
| 979 | 979 | <tr class="gd-theme-comp-out"> |
| 980 | 980 | <td colspan="3"> |
| 981 | - <span><?php _e('Output:', 'geodirectory');?></span>
|
|
| 981 | + <span><?php _e('Output:', 'geodirectory'); ?></span>
|
|
| 982 | 982 | <textarea name="geodir_wrapper_close_replace" |
| 983 | 983 | placeholder='</div><!-- wrapper ends here-->'><?php if (isset($tc['geodir_wrapper_close_replace'])) {
|
| 984 | 984 | echo $tc['geodir_wrapper_close_replace']; |
@@ -1002,7 +1002,7 @@ discard block |
||
| 1002 | 1002 | |
| 1003 | 1003 | <tr class="gd-theme-comp-out"> |
| 1004 | 1004 | <td colspan="3"> |
| 1005 | - <span><?php _e('Output:', 'geodirectory');?></span>
|
|
| 1005 | + <span><?php _e('Output:', 'geodirectory'); ?></span>
|
|
| 1006 | 1006 | <textarea name="geodir_wrapper_content_open_replace" |
| 1007 | 1007 | placeholder='<div id="[id]" class="[class]" role="main" [width_css]>'><?php if (isset($tc['geodir_wrapper_content_open_replace'])) {
|
| 1008 | 1008 | echo $tc['geodir_wrapper_content_open_replace']; |
@@ -1016,14 +1016,14 @@ discard block |
||
| 1016 | 1016 | <small>geodir_wrapper_content_close</small> |
| 1017 | 1017 | </td> |
| 1018 | 1018 | <td><input disabled="disabled" type="text" name="geodir_wrapper_content_close_id" |
| 1019 | - placeholder="<?php _e('Not used', 'geodirectory');?>"/></td>
|
|
| 1019 | + placeholder="<?php _e('Not used', 'geodirectory'); ?>"/></td>
|
|
| 1020 | 1020 | <td><input disabled="disabled" type="text" name="geodir_wrapper_content_close_class" |
| 1021 | - placeholder="<?php _e('Not used', 'geodirectory');?>"/></td>
|
|
| 1021 | + placeholder="<?php _e('Not used', 'geodirectory'); ?>"/></td>
|
|
| 1022 | 1022 | </tr> |
| 1023 | 1023 | |
| 1024 | 1024 | <tr class="gd-theme-comp-out"> |
| 1025 | 1025 | <td colspan="3"> |
| 1026 | - <span><?php _e('Output:', 'geodirectory');?></span>
|
|
| 1026 | + <span><?php _e('Output:', 'geodirectory'); ?></span>
|
|
| 1027 | 1027 | <textarea name="geodir_wrapper_content_close_replace" |
| 1028 | 1028 | placeholder='</div><!-- content ends here-->'><?php if (isset($tc['geodir_wrapper_content_close_replace'])) {
|
| 1029 | 1029 | echo $tc['geodir_wrapper_content_close_replace']; |
@@ -1045,7 +1045,7 @@ discard block |
||
| 1045 | 1045 | |
| 1046 | 1046 | <tr class="gd-theme-comp-out"> |
| 1047 | 1047 | <td colspan="3"> |
| 1048 | - <span><?php _e('Output:', 'geodirectory');?></span>
|
|
| 1048 | + <span><?php _e('Output:', 'geodirectory'); ?></span>
|
|
| 1049 | 1049 | <textarea name="geodir_article_open_replace" |
| 1050 | 1050 | placeholder='<article id="[id]" class="[class]" itemscope itemtype="[itemtype]">'><?php if (isset($tc['geodir_article_open_replace'])) {
|
| 1051 | 1051 | echo $tc['geodir_article_open_replace']; |
@@ -1058,14 +1058,14 @@ discard block |
||
| 1058 | 1058 | <small>geodir_article_close</small> |
| 1059 | 1059 | </td> |
| 1060 | 1060 | <td><input disabled="disabled" type="text" name="geodir_article_close_id" |
| 1061 | - placeholder="<?php _e('Not used', 'geodirectory');?>"/></td>
|
|
| 1061 | + placeholder="<?php _e('Not used', 'geodirectory'); ?>"/></td>
|
|
| 1062 | 1062 | <td><input disabled="disabled" type="text" name="geodir_article_close_class" |
| 1063 | - placeholder="<?php _e('Not used', 'geodirectory');?>"/></td>
|
|
| 1063 | + placeholder="<?php _e('Not used', 'geodirectory'); ?>"/></td>
|
|
| 1064 | 1064 | </tr> |
| 1065 | 1065 | |
| 1066 | 1066 | <tr class="gd-theme-comp-out"> |
| 1067 | 1067 | <td colspan="3"> |
| 1068 | - <span><?php _e('Output:', 'geodirectory');?></span>
|
|
| 1068 | + <span><?php _e('Output:', 'geodirectory'); ?></span>
|
|
| 1069 | 1069 | <textarea name="geodir_article_close_replace" |
| 1070 | 1070 | placeholder='</article><!-- article ends here-->'><?php if (isset($tc['geodir_article_close_replace'])) {
|
| 1071 | 1071 | echo $tc['geodir_article_close_replace']; |
@@ -1088,7 +1088,7 @@ discard block |
||
| 1088 | 1088 | |
| 1089 | 1089 | <tr class="gd-theme-comp-out"> |
| 1090 | 1090 | <td colspan="3"> |
| 1091 | - <span><?php _e('Output:', 'geodirectory');?></span>
|
|
| 1091 | + <span><?php _e('Output:', 'geodirectory'); ?></span>
|
|
| 1092 | 1092 | <textarea name="geodir_sidebar_right_open_replace" |
| 1093 | 1093 | placeholder='<aside id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>'><?php if (isset($tc['geodir_sidebar_right_open_replace'])) {
|
| 1094 | 1094 | echo $tc['geodir_sidebar_right_open_replace']; |
@@ -1101,14 +1101,14 @@ discard block |
||
| 1101 | 1101 | <small>geodir_sidebar_right_close</small> |
| 1102 | 1102 | </td> |
| 1103 | 1103 | <td><input disabled="disabled" type="text" name="geodir_sidebar_right_close_id" |
| 1104 | - placeholder="<?php _e('Not used', 'geodirectory');?>"/></td>
|
|
| 1104 | + placeholder="<?php _e('Not used', 'geodirectory'); ?>"/></td>
|
|
| 1105 | 1105 | <td><input disabled="disabled" type="text" name="geodir_sidebar_right_close_class" |
| 1106 | - placeholder="<?php _e('Not used', 'geodirectory');?>"/></td>
|
|
| 1106 | + placeholder="<?php _e('Not used', 'geodirectory'); ?>"/></td>
|
|
| 1107 | 1107 | </tr> |
| 1108 | 1108 | |
| 1109 | 1109 | <tr class="gd-theme-comp-out"> |
| 1110 | 1110 | <td colspan="3"> |
| 1111 | - <span><?php _e('Output:', 'geodirectory');?></span>
|
|
| 1111 | + <span><?php _e('Output:', 'geodirectory'); ?></span>
|
|
| 1112 | 1112 | <textarea name="geodir_sidebar_right_close_replace" |
| 1113 | 1113 | placeholder='</aside><!-- sidebar ends here-->'><?php if (isset($tc['geodir_sidebar_right_close_replace'])) {
|
| 1114 | 1114 | echo $tc['geodir_sidebar_right_close_replace']; |
@@ -1132,7 +1132,7 @@ discard block |
||
| 1132 | 1132 | |
| 1133 | 1133 | <tr class="gd-theme-comp-out"> |
| 1134 | 1134 | <td colspan="3"> |
| 1135 | - <span><?php _e('Output:', 'geodirectory');?></span>
|
|
| 1135 | + <span><?php _e('Output:', 'geodirectory'); ?></span>
|
|
| 1136 | 1136 | <textarea name="geodir_sidebar_left_open_replace" |
| 1137 | 1137 | placeholder='<aside id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>'><?php if (isset($tc['geodir_sidebar_left_open_replace'])) {
|
| 1138 | 1138 | echo $tc['geodir_sidebar_left_open_replace']; |
@@ -1145,14 +1145,14 @@ discard block |
||
| 1145 | 1145 | <small>geodir_sidebar_left_close</small> |
| 1146 | 1146 | </td> |
| 1147 | 1147 | <td><input disabled="disabled" type="text" name="geodir_sidebar_left_close_id" |
| 1148 | - placeholder="<?php _e('Not used', 'geodirectory');?>"/></td>
|
|
| 1148 | + placeholder="<?php _e('Not used', 'geodirectory'); ?>"/></td>
|
|
| 1149 | 1149 | <td><input disabled="disabled" type="text" name="geodir_sidebar_left_close_class" |
| 1150 | - placeholder="<?php _e('Not used', 'geodirectory');?>"/></td>
|
|
| 1150 | + placeholder="<?php _e('Not used', 'geodirectory'); ?>"/></td>
|
|
| 1151 | 1151 | </tr> |
| 1152 | 1152 | |
| 1153 | 1153 | <tr class="gd-theme-comp-out"> |
| 1154 | 1154 | <td colspan="3"> |
| 1155 | - <span><?php _e('Output:', 'geodirectory');?></span>
|
|
| 1155 | + <span><?php _e('Output:', 'geodirectory'); ?></span>
|
|
| 1156 | 1156 | <textarea name="geodir_sidebar_left_close_replace" |
| 1157 | 1157 | placeholder='</aside><!-- sidebar ends here-->'><?php if (isset($tc['geodir_sidebar_left_close_replace'])) {
|
| 1158 | 1158 | echo $tc['geodir_sidebar_left_close_replace']; |
@@ -1174,7 +1174,7 @@ discard block |
||
| 1174 | 1174 | |
| 1175 | 1175 | <tr class="gd-theme-comp-out"> |
| 1176 | 1176 | <td colspan="3"> |
| 1177 | - <span><?php _e('Output:', 'geodirectory');?></span>
|
|
| 1177 | + <span><?php _e('Output:', 'geodirectory'); ?></span>
|
|
| 1178 | 1178 | <textarea name="geodir_main_content_open_replace" |
| 1179 | 1179 | placeholder='<main id="[id]" class="[class]" role="main">'><?php if (isset($tc['geodir_main_content_open_replace'])) {
|
| 1180 | 1180 | echo $tc['geodir_main_content_open_replace']; |
@@ -1187,14 +1187,14 @@ discard block |
||
| 1187 | 1187 | <small>geodir_main_content_close</small> |
| 1188 | 1188 | </td> |
| 1189 | 1189 | <td><input disabled="disabled" type="text" name="geodir_main_content_close_id" |
| 1190 | - placeholder="<?php _e('Not used', 'geodirectory');?>"/></td>
|
|
| 1190 | + placeholder="<?php _e('Not used', 'geodirectory'); ?>"/></td>
|
|
| 1191 | 1191 | <td><input disabled="disabled" type="text" name="geodir_main_content_close_class" |
| 1192 | - placeholder="<?php _e('Not used', 'geodirectory');?>"/></td>
|
|
| 1192 | + placeholder="<?php _e('Not used', 'geodirectory'); ?>"/></td>
|
|
| 1193 | 1193 | </tr> |
| 1194 | 1194 | |
| 1195 | 1195 | <tr class="gd-theme-comp-out"> |
| 1196 | 1196 | <td colspan="3"> |
| 1197 | - <span><?php _e('Output:', 'geodirectory');?></span>
|
|
| 1197 | + <span><?php _e('Output:', 'geodirectory'); ?></span>
|
|
| 1198 | 1198 | <textarea name="geodir_main_content_close_replace" |
| 1199 | 1199 | placeholder='</main><!-- main ends here-->'><?php if (isset($tc['geodir_main_content_close_replace'])) {
|
| 1200 | 1200 | echo $tc['geodir_main_content_close_replace']; |
@@ -1206,13 +1206,13 @@ discard block |
||
| 1206 | 1206 | </tbody> |
| 1207 | 1207 | </table> |
| 1208 | 1208 | |
| 1209 | - <h4><?php _e('Other Actions', 'geodirectory');?></h4>
|
|
| 1209 | + <h4><?php _e('Other Actions', 'geodirectory'); ?></h4>
|
|
| 1210 | 1210 | |
| 1211 | 1211 | <table class="form-table gd-theme-compat-table"> |
| 1212 | 1212 | <tbody> |
| 1213 | 1213 | <tr> |
| 1214 | - <td><strong><?php _e('Hook', 'geodirectory');?></strong></td>
|
|
| 1215 | - <td><strong><?php _e('Content', 'geodirectory');?></strong></td>
|
|
| 1214 | + <td><strong><?php _e('Hook', 'geodirectory'); ?></strong></td>
|
|
| 1215 | + <td><strong><?php _e('Content', 'geodirectory'); ?></strong></td>
|
|
| 1216 | 1216 | </tr> |
| 1217 | 1217 | |
| 1218 | 1218 | |
@@ -1241,13 +1241,13 @@ discard block |
||
| 1241 | 1241 | </table> |
| 1242 | 1242 | |
| 1243 | 1243 | |
| 1244 | - <h4><?php _e('Other Filters', 'geodirectory');?></h4>
|
|
| 1244 | + <h4><?php _e('Other Filters', 'geodirectory'); ?></h4>
|
|
| 1245 | 1245 | |
| 1246 | 1246 | <table class="form-table gd-theme-compat-table"> |
| 1247 | 1247 | <tbody> |
| 1248 | 1248 | <tr> |
| 1249 | - <td><strong><?php _e('Filter', 'geodirectory');?></strong></td>
|
|
| 1250 | - <td><strong><?php _e('Content', 'geodirectory');?></strong></td>
|
|
| 1249 | + <td><strong><?php _e('Filter', 'geodirectory'); ?></strong></td>
|
|
| 1250 | + <td><strong><?php _e('Content', 'geodirectory'); ?></strong></td>
|
|
| 1251 | 1251 | </tr> |
| 1252 | 1252 | |
| 1253 | 1253 | <tr> |
@@ -1401,13 +1401,13 @@ discard block |
||
| 1401 | 1401 | * |
| 1402 | 1402 | * @since 1.4.0 |
| 1403 | 1403 | */ |
| 1404 | - do_action('gd_compat_other_filters');?>
|
|
| 1404 | + do_action('gd_compat_other_filters'); ?>
|
|
| 1405 | 1405 | |
| 1406 | 1406 | </tbody> |
| 1407 | 1407 | </table> |
| 1408 | 1408 | |
| 1409 | 1409 | |
| 1410 | - <h4><?php _e('Required CSS', 'geodirectory');?></h4>
|
|
| 1410 | + <h4><?php _e('Required CSS', 'geodirectory'); ?></h4>
|
|
| 1411 | 1411 | |
| 1412 | 1412 | <table class="form-table gd-theme-compat-table"> |
| 1413 | 1413 | <tbody> |
@@ -1422,7 +1422,7 @@ discard block |
||
| 1422 | 1422 | </tbody> |
| 1423 | 1423 | </table> |
| 1424 | 1424 | |
| 1425 | - <h4><?php _e('Required JS', 'geodirectory');?></h4>
|
|
| 1425 | + <h4><?php _e('Required JS', 'geodirectory'); ?></h4>
|
|
| 1426 | 1426 | |
| 1427 | 1427 | <table class="form-table gd-theme-compat-table"> |
| 1428 | 1428 | <tbody> |
@@ -1440,7 +1440,7 @@ discard block |
||
| 1440 | 1440 | |
| 1441 | 1441 | <p class="submit"> |
| 1442 | 1442 | <input name="save" class="button-primary" type="submit" |
| 1443 | - value="<?php _e('Save changes', 'geodirectory');?>">
|
|
| 1443 | + value="<?php _e('Save changes', 'geodirectory'); ?>">
|
|
| 1444 | 1444 | </p> |
| 1445 | 1445 | |
| 1446 | 1446 | </div> |
@@ -1474,7 +1474,7 @@ discard block |
||
| 1474 | 1474 | * @param string $listing_type Post type. |
| 1475 | 1475 | */ |
| 1476 | 1476 | ?> |
| 1477 | - <h3><?php echo apply_filters('geodir_custom_fields_panel_head', '', $sub_tab, $listing_type);?></h3>
|
|
| 1477 | + <h3><?php echo apply_filters('geodir_custom_fields_panel_head', '', $sub_tab, $listing_type); ?></h3>
|
|
| 1478 | 1478 | </div> |
| 1479 | 1479 | <div id="container_general" class="clearfix"> |
| 1480 | 1480 | <div class="general-form-builder-frame"> |
@@ -1489,7 +1489,7 @@ discard block |
||
| 1489 | 1489 | * @param string $listing_type Post type. |
| 1490 | 1490 | */ |
| 1491 | 1491 | ?> |
| 1492 | - <h3 class="hndle"><span><?php echo apply_filters('geodir_cf_panel_available_fields_head', '', $sub_tab, $listing_type);?>
|
|
| 1492 | + <h3 class="hndle"><span><?php echo apply_filters('geodir_cf_panel_available_fields_head', '', $sub_tab, $listing_type); ?>
|
|
| 1493 | 1493 | </span></h3> |
| 1494 | 1494 | <?php |
| 1495 | 1495 | /** |
@@ -1500,7 +1500,7 @@ discard block |
||
| 1500 | 1500 | * @param string $listing_type Post type. |
| 1501 | 1501 | */ |
| 1502 | 1502 | ?> |
| 1503 | - <p><?php echo apply_filters('geodir_cf_panel_available_fields_note', '', $sub_tab, $listing_type);?></p>
|
|
| 1503 | + <p><?php echo apply_filters('geodir_cf_panel_available_fields_note', '', $sub_tab, $listing_type); ?></p>
|
|
| 1504 | 1504 | |
| 1505 | 1505 | <div class="inside"> |
| 1506 | 1506 | |
@@ -1534,7 +1534,7 @@ discard block |
||
| 1534 | 1534 | * @param string $listing_type Post type. |
| 1535 | 1535 | */ |
| 1536 | 1536 | ?> |
| 1537 | - <span><?php echo apply_filters('geodir_cf_panel_selected_fields_head', '', $sub_tab, $listing_type);?></span>
|
|
| 1537 | + <span><?php echo apply_filters('geodir_cf_panel_selected_fields_head', '', $sub_tab, $listing_type); ?></span>
|
|
| 1538 | 1538 | </h3> |
| 1539 | 1539 | <?php |
| 1540 | 1540 | /** |
@@ -1545,7 +1545,7 @@ discard block |
||
| 1545 | 1545 | * @param string $listing_type Post type. |
| 1546 | 1546 | */ |
| 1547 | 1547 | ?> |
| 1548 | - <p><?php echo apply_filters('geodir_cf_panel_selected_fields_note', '', $sub_tab, $listing_type);?></p>
|
|
| 1548 | + <p><?php echo apply_filters('geodir_cf_panel_selected_fields_note', '', $sub_tab, $listing_type); ?></p>
|
|
| 1549 | 1549 | |
| 1550 | 1550 | <div class="inside"> |
| 1551 | 1551 | |
@@ -1586,7 +1586,7 @@ discard block |
||
| 1586 | 1586 | <div class="gd-content-heading"> |
| 1587 | 1587 | |
| 1588 | 1588 | |
| 1589 | - <h3><?php _e('GD Diagnostic Tools', 'geodirectory');?></h3>
|
|
| 1589 | + <h3><?php _e('GD Diagnostic Tools', 'geodirectory'); ?></h3>
|
|
| 1590 | 1590 | <style> |
| 1591 | 1591 | .gd-tools-table {
|
| 1592 | 1592 | width: 100%; |
@@ -1605,81 +1605,81 @@ discard block |
||
| 1605 | 1605 | <table class="form-table gd-tools-table"> |
| 1606 | 1606 | <tbody> |
| 1607 | 1607 | <tr> |
| 1608 | - <td><strong><?php _e('Tool', 'geodirectory');?></strong></td>
|
|
| 1609 | - <td><strong><?php _e('Description', 'geodirectory');?></strong></td>
|
|
| 1610 | - <td><strong><?php _e('Action', 'geodirectory');?></strong></td>
|
|
| 1608 | + <td><strong><?php _e('Tool', 'geodirectory'); ?></strong></td>
|
|
| 1609 | + <td><strong><?php _e('Description', 'geodirectory'); ?></strong></td>
|
|
| 1610 | + <td><strong><?php _e('Action', 'geodirectory'); ?></strong></td>
|
|
| 1611 | 1611 | </tr> |
| 1612 | 1612 | |
| 1613 | 1613 | |
| 1614 | 1614 | <tr> |
| 1615 | - <td><?php _e('GD pages check', 'geodirectory');?></td>
|
|
| 1615 | + <td><?php _e('GD pages check', 'geodirectory'); ?></td>
|
|
| 1616 | 1616 | <td> |
| 1617 | - <small><?php _e('Checks if the GD pages are installed correctly or not.', 'geodirectory');?></small>
|
|
| 1617 | + <small><?php _e('Checks if the GD pages are installed correctly or not.', 'geodirectory'); ?></small>
|
|
| 1618 | 1618 | </td> |
| 1619 | 1619 | <td> |
| 1620 | - <input type="button" value="<?php _e('Run', 'geodirectory');?>"
|
|
| 1620 | + <input type="button" value="<?php _e('Run', 'geodirectory'); ?>"
|
|
| 1621 | 1621 | class="button-primary geodir_diagnosis_button" data-diagnose="default_pages"/> |
| 1622 | 1622 | </td> |
| 1623 | 1623 | </tr> |
| 1624 | 1624 | |
| 1625 | 1625 | |
| 1626 | 1626 | <tr> |
| 1627 | - <td><?php _e('Multisite DB conversion check', 'geodirectory');?></td>
|
|
| 1627 | + <td><?php _e('Multisite DB conversion check', 'geodirectory'); ?></td>
|
|
| 1628 | 1628 | <td> |
| 1629 | - <small><?php _e('Checks if the GD database tables have been converted to use multisite correctly.', 'geodirectory');?></small>
|
|
| 1629 | + <small><?php _e('Checks if the GD database tables have been converted to use multisite correctly.', 'geodirectory'); ?></small>
|
|
| 1630 | 1630 | </td> |
| 1631 | - <td><input type="button" value="<?php _e('Run', 'geodirectory');?>"
|
|
| 1631 | + <td><input type="button" value="<?php _e('Run', 'geodirectory'); ?>"
|
|
| 1632 | 1632 | class="button-primary geodir_diagnosis_button" data-diagnose="multisite_conversion"/> |
| 1633 | 1633 | </td> |
| 1634 | 1634 | </tr> |
| 1635 | 1635 | |
| 1636 | 1636 | <tr> |
| 1637 | - <td><?php _e('Ratings check', 'geodirectory');?></td>
|
|
| 1637 | + <td><?php _e('Ratings check', 'geodirectory'); ?></td>
|
|
| 1638 | 1638 | <td> |
| 1639 | - <small><?php _e('Checks ratings for correct location and content settings', 'geodirectory');?></small>
|
|
| 1639 | + <small><?php _e('Checks ratings for correct location and content settings', 'geodirectory'); ?></small>
|
|
| 1640 | 1640 | </td> |
| 1641 | - <td><input type="button" value="<?php _e('Run', 'geodirectory');?>"
|
|
| 1641 | + <td><input type="button" value="<?php _e('Run', 'geodirectory'); ?>"
|
|
| 1642 | 1642 | class="button-primary geodir_diagnosis_button" data-diagnose="ratings"/> |
| 1643 | 1643 | </td> |
| 1644 | 1644 | </tr> |
| 1645 | 1645 | |
| 1646 | 1646 | <tr> |
| 1647 | - <td><?php _e('Sync GD tags', 'geodirectory');?></td>
|
|
| 1647 | + <td><?php _e('Sync GD tags', 'geodirectory'); ?></td>
|
|
| 1648 | 1648 | <td> |
| 1649 | - <small><?php _e('This tool can be used when tags are showing in the backend but missing from the front end.', 'geodirectory');?></small>
|
|
| 1649 | + <small><?php _e('This tool can be used when tags are showing in the backend but missing from the front end.', 'geodirectory'); ?></small>
|
|
| 1650 | 1650 | </td> |
| 1651 | - <td><input type="button" value="<?php _e('Run', 'geodirectory');?>"
|
|
| 1651 | + <td><input type="button" value="<?php _e('Run', 'geodirectory'); ?>"
|
|
| 1652 | 1652 | class="button-primary geodir_diagnosis_button" data-diagnose="tags_sync"/> |
| 1653 | 1653 | </td> |
| 1654 | 1654 | </tr> |
| 1655 | 1655 | |
| 1656 | 1656 | <tr> |
| 1657 | - <td><?php _e('Sync GD Categories', 'geodirectory');?></td>
|
|
| 1657 | + <td><?php _e('Sync GD Categories', 'geodirectory'); ?></td>
|
|
| 1658 | 1658 | <td> |
| 1659 | - <small><?php _e('This tool can be used when categories are missing from the details table but showing in other places in the backend (only checks posts with missing category info in details table)', 'geodirectory');?></small>
|
|
| 1659 | + <small><?php _e('This tool can be used when categories are missing from the details table but showing in other places in the backend (only checks posts with missing category info in details table)', 'geodirectory'); ?></small>
|
|
| 1660 | 1660 | </td> |
| 1661 | - <td><input type="button" value="<?php _e('Run', 'geodirectory');?>"
|
|
| 1661 | + <td><input type="button" value="<?php _e('Run', 'geodirectory'); ?>"
|
|
| 1662 | 1662 | class="button-primary geodir_diagnosis_button" data-diagnose="cats_sync"/> |
| 1663 | 1663 | </td> |
| 1664 | 1664 | </tr> |
| 1665 | 1665 | |
| 1666 | 1666 | |
| 1667 | 1667 | <tr> |
| 1668 | - <td><?php _e('Clear all GD version numbers', 'geodirectory');?></td>
|
|
| 1668 | + <td><?php _e('Clear all GD version numbers', 'geodirectory'); ?></td>
|
|
| 1669 | 1669 | <td> |
| 1670 | - <small><?php _e('This tool will clear all GD version numbers so any upgrade functions will run again.', 'geodirectory');?></small>
|
|
| 1670 | + <small><?php _e('This tool will clear all GD version numbers so any upgrade functions will run again.', 'geodirectory'); ?></small>
|
|
| 1671 | 1671 | </td> |
| 1672 | - <td><input type="button" value="<?php _e('Run', 'geodirectory');?>"
|
|
| 1672 | + <td><input type="button" value="<?php _e('Run', 'geodirectory'); ?>"
|
|
| 1673 | 1673 | class="button-primary geodir_diagnosis_button" data-diagnose="version_clear"/> |
| 1674 | 1674 | </td> |
| 1675 | 1675 | </tr> |
| 1676 | 1676 | <tr> |
| 1677 | - <td><?php _e('Load custom fields translation', 'geodirectory');?></td>
|
|
| 1677 | + <td><?php _e('Load custom fields translation', 'geodirectory'); ?></td>
|
|
| 1678 | 1678 | <td> |
| 1679 | - <small><?php _e('This tool will load strings from the database into a file to translate via po editor.Ex: custom fields', 'geodirectory');?></small>
|
|
| 1679 | + <small><?php _e('This tool will load strings from the database into a file to translate via po editor.Ex: custom fields', 'geodirectory'); ?></small>
|
|
| 1680 | 1680 | </td> |
| 1681 | 1681 | <td> |
| 1682 | - <input type="button" value="<?php _e('Run', 'geodirectory');?>" class="button-primary geodir_diagnosis_button" data-diagnose="load_db_language"/>
|
|
| 1682 | + <input type="button" value="<?php _e('Run', 'geodirectory'); ?>" class="button-primary geodir_diagnosis_button" data-diagnose="load_db_language"/>
|
|
| 1683 | 1683 | </td> |
| 1684 | 1684 | </tr> |
| 1685 | 1685 | <?php |
@@ -1689,7 +1689,7 @@ discard block |
||
| 1689 | 1689 | * Called after the last setting on the GD>Tools page. |
| 1690 | 1690 | * @since 1.0.0 |
| 1691 | 1691 | */ |
| 1692 | - do_action('geodir_diagnostic_tool');?>
|
|
| 1692 | + do_action('geodir_diagnostic_tool'); ?>
|
|
| 1693 | 1693 | |
| 1694 | 1694 | </tbody> |
| 1695 | 1695 | </table> |
@@ -122,7 +122,7 @@ |
||
| 122 | 122 | |
| 123 | 123 | array('type' => 'sectionend', 'id' => 'general_options'),
|
| 124 | 124 | |
| 125 | -));/* General Options End*/ |
|
| 125 | +)); /* General Options End*/ |
|
| 126 | 126 | |
| 127 | 127 | /** |
| 128 | 128 | * Filter GD Google Analytic Settings array. |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | 'id' => 'geodir_post_submited_success_email_subject_admin', |
| 130 | 130 | 'type' => 'text', |
| 131 | 131 | 'css' => 'min-width:300px;', |
| 132 | - 'std' => __('Post Submitted Successfully','geodirectory') // Default value for the page title - changed in settings
|
|
| 132 | + 'std' => __('Post Submitted Successfully', 'geodirectory') // Default value for the page title - changed in settings
|
|
| 133 | 133 | ), |
| 134 | 134 | array( |
| 135 | 135 | 'name' => '', |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | 'id' => 'geodir_post_submited_success_email_content_admin', |
| 138 | 138 | 'css' => 'width:500px; height: 150px;', |
| 139 | 139 | 'type' => 'textarea', |
| 140 | - 'std' => __('<p>Dear Admin,</p><p>A new listing has been published [#listing_link#]. This email is just for your information.</p><br><p>[#site_name#]</p>','geodirectory')
|
|
| 140 | + 'std' => __('<p>Dear Admin,</p><p>A new listing has been published [#listing_link#]. This email is just for your information.</p><br><p>[#site_name#]</p>', 'geodirectory')
|
|
| 141 | 141 | ), |
| 142 | 142 | |
| 143 | 143 | |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | 'id' => 'geodir_post_submited_success_email_subject', |
| 155 | 155 | 'type' => 'text', |
| 156 | 156 | 'css' => 'min-width:300px;', |
| 157 | - 'std' => __('Post Submitted Successfully','geodirectory') // Default value for the page title - changed in settings
|
|
| 157 | + 'std' => __('Post Submitted Successfully', 'geodirectory') // Default value for the page title - changed in settings
|
|
| 158 | 158 | ), |
| 159 | 159 | array( |
| 160 | 160 | 'name' => '', |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | 'id' => 'geodir_post_submited_success_email_content', |
| 163 | 163 | 'css' => 'width:500px; height: 150px;', |
| 164 | 164 | 'type' => 'textarea', |
| 165 | - 'std' => __('<p>Dear [#client_name#],</p><p>You submitted the below listing information. This email is just for your information.</p><p>[#listing_link#]</p><br><p>Thank you for your contribution.</p><p>[#site_name#]</p>','geodirectory')
|
|
| 165 | + 'std' => __('<p>Dear [#client_name#],</p><p>You submitted the below listing information. This email is just for your information.</p><p>[#listing_link#]</p><br><p>Thank you for your contribution.</p><p>[#site_name#]</p>', 'geodirectory')
|
|
| 166 | 166 | ), |
| 167 | 167 | |
| 168 | 168 | |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | 'id' => 'geodir_forgot_password_content', |
| 181 | 181 | 'css' => 'width:500px; height: 150px;', |
| 182 | 182 | 'type' => 'textarea', |
| 183 | - 'std' => __("<p>Dear [#client_name#],<p><p>You requested a new password for [#site_name_url#]</p><p>[#login_details#]</p><p>You can login here: [#login_url#]</p><p>Thank you,<br /><br />[#site_name_url#].</p>",'geodirectory')
|
|
| 183 | + 'std' => __("<p>Dear [#client_name#],<p><p>You requested a new password for [#site_name_url#]</p><p>[#login_details#]</p><p>You can login here: [#login_url#]</p><p>Thank you,<br /><br />[#site_name_url#].</p>", 'geodirectory')
|
|
| 184 | 184 | ), |
| 185 | 185 | |
| 186 | 186 | array( |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | 'id' => 'geodir_registration_success_email_content', |
| 198 | 198 | 'css' => 'width:500px; height: 150px;', |
| 199 | 199 | 'type' => 'textarea', |
| 200 | - 'std' => __("<p>Dear [#client_name#],</p><p>You can log in with the following information:</p><p>[#login_details#]</p><p>You can login here: [#login_url#]</p><p>Thank you,<br /><br />[#site_name_url#].</p>",'geodirectory')
|
|
| 200 | + 'std' => __("<p>Dear [#client_name#],</p><p>You can log in with the following information:</p><p>[#login_details#]</p><p>You can login here: [#login_url#]</p><p>Thank you,<br /><br />[#site_name_url#].</p>", 'geodirectory')
|
|
| 201 | 201 | ), |
| 202 | 202 | array( |
| 203 | 203 | 'name' => __('Listing published email', 'geodirectory'),
|
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | 'id' => 'geodir_email_friend_content', |
| 237 | 237 | 'css' => 'width:500px; height: 150px;', |
| 238 | 238 | 'type' => 'textarea', |
| 239 | - 'std' => __("<p>Dear [#to_name#],<p><p>Your friend has sent you a message from <b>[#site_name#]</b> </p><p>===============================</p><p><b>Subject : [#subject#]</b></p><p>[#comments#] [#listing_link#]</p><p>===============================</p><p>Thank you,<br /><br />[#site_name#].</p>",'geodirectory')
|
|
| 239 | + 'std' => __("<p>Dear [#to_name#],<p><p>Your friend has sent you a message from <b>[#site_name#]</b> </p><p>===============================</p><p><b>Subject : [#subject#]</b></p><p>[#comments#] [#listing_link#]</p><p>===============================</p><p>Thank you,<br /><br />[#site_name#].</p>", 'geodirectory')
|
|
| 240 | 240 | ), |
| 241 | 241 | |
| 242 | 242 | array( |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | 'id' => 'geodir_email_enquiry_content', |
| 254 | 254 | 'css' => 'width:500px; height: 150px;', |
| 255 | 255 | 'type' => 'textarea', |
| 256 | - 'std' => __("<p>Dear [#to_name#],<p><p>An enquiry has been sent from <b>[#listing_link#]</b></p><p>===============================</p><p>[#comments#]</p><p>===============================</p><p>Thank you,<br /><br />[#site_name_url#].</p>",'geodirectory')
|
|
| 256 | + 'std' => __("<p>Dear [#to_name#],<p><p>An enquiry has been sent from <b>[#listing_link#]</b></p><p>===============================</p><p>[#comments#]</p><p>===============================</p><p>Thank you,<br /><br />[#site_name_url#].</p>", 'geodirectory')
|
|
| 257 | 257 | ), |
| 258 | 258 | |
| 259 | 259 | array('type' => 'sectionend', 'id' => 'other_emails'),
|
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | 'id' => 'geodir_post_added_success_msg_content', |
| 270 | 270 | 'css' => 'width:500px; height: 150px;', |
| 271 | 271 | 'type' => 'textarea', |
| 272 | - 'std' => __('<p>Thank you, your information has been successfully received.</p><p><a href="[#submited_information_link#]" >View your submitted information »</a></p><p>Thank you for visiting us at [#site_name#].</p>','geodirectory')
|
|
| 272 | + 'std' => __('<p>Thank you, your information has been successfully received.</p><p><a href="[#submited_information_link#]" >View your submitted information »</a></p><p>Thank you for visiting us at [#site_name#].</p>', 'geodirectory')
|
|
| 273 | 273 | ), |
| 274 | 274 | |
| 275 | 275 | |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | |
| 11 | 11 | $gd_wpseo_use = ''; |
| 12 | 12 | if (class_exists('WPSEO_Frontend') || class_exists('All_in_One_SEO_Pack')) { |
| 13 | - $gd_wpseo_use = "<b style='color:red;'>".__('Please use the WPSEO settings instead.','geodirectory')."</b><br />"; |
|
| 13 | + $gd_wpseo_use = "<b style='color:red;'>" . __('Please use the WPSEO settings instead.', 'geodirectory') . "</b><br />"; |
|
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | /** |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | |
| 28 | 28 | |
| 29 | 29 | |
| 30 | - array('name' => $gd_wpseo_use.__('Available Variables', 'geodirectory'), |
|
| 30 | + array('name' => $gd_wpseo_use . __('Available Variables', 'geodirectory'), |
|
| 31 | 31 | 'desc' => __('%%title%%, %%sitename%%, %%sitedesc%%, %%excerpt%%, %%pt_single%%, %%pt_plural%%, %%category%%, %%id%%, %%sep%%, %%location%%, %%in_location%%, %%in_location_single%%, %%location_single%%, %%search_term%%, %%search_near%%, %%name%%', 'geodirectory'), |
| 32 | 32 | 'type' => 'sectionstart', |
| 33 | 33 | 'id' => 'geodir_meta_vars'), |
@@ -44,7 +44,7 @@ |
||
| 44 | 44 | */ |
| 45 | 45 | function geodir_on_wp() |
| 46 | 46 | {
|
| 47 | - if(geodir_is_page('login')) {
|
|
| 47 | + if (geodir_is_page('login')) {
|
|
| 48 | 48 | geodir_user_signup(); |
| 49 | 49 | } |
| 50 | 50 | |
@@ -803,7 +803,7 @@ discard block |
||
| 803 | 803 | { |
| 804 | 804 | |
| 805 | 805 | if (!is_array($meta)) |
| 806 | - $meta = (array)$meta; |
|
| 806 | + $meta = (array) $meta; |
|
| 807 | 807 | |
| 808 | 808 | $this->show_field_begin($field, $meta); |
| 809 | 809 | echo "<select class='at-select' name='{$field['id']}" . ($field['multiple'] ? "[]' id='{$field['id']}' multiple='multiple'" : "'") . ">"; |
@@ -827,7 +827,7 @@ discard block |
||
| 827 | 827 | { |
| 828 | 828 | |
| 829 | 829 | if (!is_array($meta)) |
| 830 | - $meta = (array)$meta; |
|
| 830 | + $meta = (array) $meta; |
|
| 831 | 831 | |
| 832 | 832 | $this->show_field_begin($field, $meta); |
| 833 | 833 | foreach ($field['options'] as $key => $value) { |
@@ -890,7 +890,7 @@ discard block |
||
| 890 | 890 | global $post; |
| 891 | 891 | |
| 892 | 892 | if (!is_array($meta)) |
| 893 | - $meta = (array)$meta; |
|
| 893 | + $meta = (array) $meta; |
|
| 894 | 894 | |
| 895 | 895 | $this->show_field_begin($field, $meta); |
| 896 | 896 | echo "{$field['desc']}<br />"; |
@@ -1013,7 +1013,7 @@ discard block |
||
| 1013 | 1013 | { |
| 1014 | 1014 | |
| 1015 | 1015 | if (!is_array($meta)) |
| 1016 | - $meta = (array)$meta; |
|
| 1016 | + $meta = (array) $meta; |
|
| 1017 | 1017 | |
| 1018 | 1018 | $this->show_field_begin($field, $meta); |
| 1019 | 1019 | |
@@ -1073,7 +1073,7 @@ discard block |
||
| 1073 | 1073 | { |
| 1074 | 1074 | global $post; |
| 1075 | 1075 | |
| 1076 | - if (!is_array($meta)) $meta = (array)$meta; |
|
| 1076 | + if (!is_array($meta)) $meta = (array) $meta; |
|
| 1077 | 1077 | $this->show_field_begin($field, $meta); |
| 1078 | 1078 | $options = $field['options']; |
| 1079 | 1079 | $posts = get_posts($options['args']); |
@@ -1111,7 +1111,7 @@ discard block |
||
| 1111 | 1111 | { |
| 1112 | 1112 | global $post; |
| 1113 | 1113 | |
| 1114 | - if (!is_array($meta)) $meta = (array)$meta; |
|
| 1114 | + if (!is_array($meta)) $meta = (array) $meta; |
|
| 1115 | 1115 | $this->show_field_begin($field, $meta); |
| 1116 | 1116 | $options = $field['options']; |
| 1117 | 1117 | $terms = get_terms($options['taxonomy'], $options['args']); |
@@ -1370,7 +1370,7 @@ discard block |
||
| 1370 | 1370 | if (!is_wp_error($id)) { |
| 1371 | 1371 | |
| 1372 | 1372 | wp_update_attachment_metadata($id, wp_generate_attachment_metadata($id, $filename)); |
| 1373 | - add_post_meta($term_id, $name, $id, false); // save file's url in meta fields |
|
| 1373 | + add_post_meta($term_id, $name, $id, false); // save file's url in meta fields |
|
| 1374 | 1374 | |
| 1375 | 1375 | } // End if |
| 1376 | 1376 | |
@@ -1415,7 +1415,7 @@ discard block |
||
| 1415 | 1415 | if (!is_wp_error($id)) { |
| 1416 | 1416 | |
| 1417 | 1417 | wp_update_attachment_metadata($id, wp_generate_attachment_metadata($id, $filename)); |
| 1418 | - return $id; // return file's url in meta fields |
|
| 1418 | + return $id; // return file's url in meta fields |
|
| 1419 | 1419 | } // End if |
| 1420 | 1420 | } // End foreach |
| 1421 | 1421 | } |
@@ -1430,9 +1430,9 @@ discard block |
||
| 1430 | 1430 | { |
| 1431 | 1431 | |
| 1432 | 1432 | // Default values for meta box |
| 1433 | - $this->_meta_box = array_merge(array('context' => 'normal', 'priority' => 'high', 'pages' => array('post')), (array)$this->_meta_box); |
|
| 1433 | + $this->_meta_box = array_merge(array('context' => 'normal', 'priority' => 'high', 'pages' => array('post')), (array) $this->_meta_box); |
|
| 1434 | 1434 | |
| 1435 | - if(is_array($this->_fields)) { |
|
| 1435 | + if (is_array($this->_fields)) { |
|
| 1436 | 1436 | // Default values for fields |
| 1437 | 1437 | foreach ($this->_fields as &$field) { |
| 1438 | 1438 | $multiple = in_array($field['type'], array('checkbox_list', 'file', 'image')); |
@@ -1452,7 +1452,7 @@ discard block |
||
| 1452 | 1452 | */ |
| 1453 | 1453 | public function has_field($type) |
| 1454 | 1454 | { |
| 1455 | - if(is_array($this->_fields)) { |
|
| 1455 | + if (is_array($this->_fields)) { |
|
| 1456 | 1456 | foreach ($this->_fields as $field) { |
| 1457 | 1457 | if ($type == $field['type']) |
| 1458 | 1458 | return true; |
@@ -2020,12 +2020,12 @@ discard block |
||
| 2020 | 2020 | $post_type = $taxObject->object_type[0]; |
| 2021 | 2021 | } |
| 2022 | 2022 | |
| 2023 | - if($post_type=='post'){$post_type='';} |
|
| 2024 | - if($post_type){$post_type = $post_type.'_';} |
|
| 2023 | + if ($post_type == 'post') {$post_type = ''; } |
|
| 2024 | + if ($post_type) {$post_type = $post_type . '_'; } |
|
| 2025 | 2025 | |
| 2026 | 2026 | $t_id = (is_object($term_id)) ? $term_id->term_id : $term_id; |
| 2027 | 2027 | |
| 2028 | - $m = get_option('tax_meta_' . $post_type . $t_id); |
|
| 2028 | + $m = get_option('tax_meta_' . $post_type . $t_id); |
|
| 2029 | 2029 | if (isset($m[$key])) { |
| 2030 | 2030 | return $m[$key]; |
| 2031 | 2031 | } else { |
@@ -2042,15 +2042,15 @@ discard block |
||
| 2042 | 2042 | $post_type = $taxObject->object_type[0]; |
| 2043 | 2043 | } |
| 2044 | 2044 | |
| 2045 | - if($post_type=='post'){$post_type='';} |
|
| 2046 | - if($post_type){$post_type = $post_type.'_';} |
|
| 2045 | + if ($post_type == 'post') {$post_type = ''; } |
|
| 2046 | + if ($post_type) {$post_type = $post_type . '_'; } |
|
| 2047 | 2047 | |
| 2048 | - $m = get_option('tax_meta_' . $post_type . $term_id); |
|
| 2048 | + $m = get_option('tax_meta_' . $post_type . $term_id); |
|
| 2049 | 2049 | |
| 2050 | 2050 | if (isset($m[$key])) { |
| 2051 | 2051 | unset($m[$key]); |
| 2052 | 2052 | } |
| 2053 | - update_option('tax_meta_' . $post_type . $term_id, $m); |
|
| 2053 | + update_option('tax_meta_' . $post_type . $term_id, $m); |
|
| 2054 | 2054 | } |
| 2055 | 2055 | |
| 2056 | 2056 | //update meta |
@@ -2062,13 +2062,13 @@ discard block |
||
| 2062 | 2062 | $post_type = $taxObject->object_type[0]; |
| 2063 | 2063 | } |
| 2064 | 2064 | |
| 2065 | - if($post_type=='post'){$post_type='';} |
|
| 2066 | - if($post_type){$post_type = $post_type.'_';} |
|
| 2065 | + if ($post_type == 'post') {$post_type = ''; } |
|
| 2066 | + if ($post_type) {$post_type = $post_type . '_'; } |
|
| 2067 | 2067 | |
| 2068 | - $m = get_option('tax_meta_' . $post_type . $term_id); |
|
| 2068 | + $m = get_option('tax_meta_' . $post_type . $term_id); |
|
| 2069 | 2069 | |
| 2070 | 2070 | $m[$key] = $value; |
| 2071 | - update_option('tax_meta_' . $post_type . $term_id, $m); |
|
| 2071 | + update_option('tax_meta_' . $post_type . $term_id, $m); |
|
| 2072 | 2072 | |
| 2073 | 2073 | /** |
| 2074 | 2074 | * Called after the tax meta is updated. |
@@ -2103,12 +2103,12 @@ discard block |
||
| 2103 | 2103 | $post_type = $taxObject->object_type[0]; |
| 2104 | 2104 | } |
| 2105 | 2105 | |
| 2106 | - if($post_type=='post'){$post_type='';} |
|
| 2107 | - if($post_type){$post_type = $post_type.'_';} |
|
| 2106 | + if ($post_type == 'post') {$post_type = ''; } |
|
| 2107 | + if ($post_type) {$post_type = $post_type . '_'; } |
|
| 2108 | 2108 | |
| 2109 | 2109 | $t_id = (is_object($term_id)) ? $term_id->term_id : $term_id; |
| 2110 | 2110 | |
| 2111 | - $m = get_option('tax_meta_' . $post_type . $t_id); |
|
| 2111 | + $m = get_option('tax_meta_' . $post_type . $t_id); |
|
| 2112 | 2112 | if (isset($m[$key])) { |
| 2113 | 2113 | return $m[$key]; |
| 2114 | 2114 | } else { |
@@ -2125,15 +2125,15 @@ discard block |
||
| 2125 | 2125 | $taxObject = get_taxonomy($_REQUEST['taxonomy']); |
| 2126 | 2126 | $post_type = $taxObject->object_type[0]; |
| 2127 | 2127 | |
| 2128 | - if($post_type=='post'){$post_type='';} |
|
| 2129 | - if($post_type){$post_type = $post_type.'_';} |
|
| 2128 | + if ($post_type == 'post') {$post_type = ''; } |
|
| 2129 | + if ($post_type) {$post_type = $post_type . '_'; } |
|
| 2130 | 2130 | |
| 2131 | 2131 | $m = get_option('tax_meta_' . $post_type . $term_id); |
| 2132 | 2132 | |
| 2133 | 2133 | if (isset($m[$key])) { |
| 2134 | 2134 | unset($m[$key]); |
| 2135 | 2135 | } |
| 2136 | - update_option('tax_meta_' . $post_type . $term_id, $m); |
|
| 2136 | + update_option('tax_meta_' . $post_type . $term_id, $m); |
|
| 2137 | 2137 | } |
| 2138 | 2138 | } |
| 2139 | 2139 | |
@@ -2147,10 +2147,10 @@ discard block |
||
| 2147 | 2147 | $post_type = $taxObject->object_type[0]; |
| 2148 | 2148 | } |
| 2149 | 2149 | |
| 2150 | - if($post_type=='post'){$post_type='';} |
|
| 2151 | - if($post_type){$post_type = $post_type.'_';} |
|
| 2150 | + if ($post_type == 'post') {$post_type = ''; } |
|
| 2151 | + if ($post_type) {$post_type = $post_type . '_'; } |
|
| 2152 | 2152 | |
| 2153 | - $m = get_option('tax_meta_' . $post_type . $term_id); |
|
| 2153 | + $m = get_option('tax_meta_' . $post_type . $term_id); |
|
| 2154 | 2154 | |
| 2155 | 2155 | $m[$key] = $value; |
| 2156 | 2156 | update_option('tax_meta_' . $post_type . $term_id, $m); |
@@ -24,12 +24,12 @@ discard block |
||
| 24 | 24 | */ |
| 25 | 25 | |
| 26 | 26 | $config = array( |
| 27 | - 'id' => 'demo_meta_box', // meta box id, unique per meta box |
|
| 28 | - 'title' => __('Demo Meta Box', 'geodirectory'), // meta box title |
|
| 29 | - 'pages' => geodir_get_taxonomies(), // taxonomy name, accept categories, post_tag and custom taxonomies |
|
| 30 | - 'context' => 'normal', // where the meta box appear: normal (default), advanced, side; optional |
|
| 31 | - 'fields' => array(), // list of meta fields (can be added by field arrays) |
|
| 32 | - 'local_images' => false, // Use local or hosted images (meta box images for add/remove) |
|
| 27 | + 'id' => 'demo_meta_box', // meta box id, unique per meta box |
|
| 28 | + 'title' => __('Demo Meta Box', 'geodirectory'), // meta box title |
|
| 29 | + 'pages' => geodir_get_taxonomies(), // taxonomy name, accept categories, post_tag and custom taxonomies |
|
| 30 | + 'context' => 'normal', // where the meta box appear: normal (default), advanced, side; optional |
|
| 31 | + 'fields' => array(), // list of meta fields (can be added by field arrays) |
|
| 32 | + 'local_images' => false, // Use local or hosted images (meta box images for add/remove) |
|
| 33 | 33 | 'use_with_theme' => true //change path if used with theme set to true, false for a plugin or anything else for a custom path(default false). |
| 34 | 34 | ); |
| 35 | 35 | |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | * |
| 50 | 50 | * @since 1.5.7 |
| 51 | 51 | */ |
| 52 | - apply_filters('geodir_cat_schemas',array( |
|
| 52 | + apply_filters('geodir_cat_schemas', array( |
|
| 53 | 53 | '' => __('Default (LocalBusiness)', 'geodirectory'), |
| 54 | 54 | 'AccountingService' => 'AccountingService', |
| 55 | 55 | 'Attorney' => 'Attorney', |
@@ -214,9 +214,9 @@ discard block |
||
| 214 | 214 | |
| 215 | 215 | $file_info = pathinfo($term_icon_url['src']); |
| 216 | 216 | |
| 217 | - if (isset($file_info['dirname'] ) && $file_info['dirname'] != '.' && $file_info['dirname'] != '..') |
|
| 217 | + if (isset($file_info['dirname']) && $file_info['dirname'] != '.' && $file_info['dirname'] != '..') |
|
| 218 | 218 | $sub_dir = $file_info['dirname']; |
| 219 | - else{$sub_dir = '';} |
|
| 219 | + else {$sub_dir = ''; } |
|
| 220 | 220 | |
| 221 | 221 | $uploads = wp_upload_dir(trim($sub_dir, '/')); // Array of key => value pairs |
| 222 | 222 | $uploads_baseurl = $uploads['baseurl']; |
@@ -268,8 +268,8 @@ discard block |
||
| 268 | 268 | jQuery("#addtag iframe").contents().find("body").html(''); |
| 269 | 269 | jQuery('#addtag [rel="ct_cat_default_img"]').removeClass('at-delete_image_button').addClass('at-upload_image_button'); |
| 270 | 270 | jQuery('#addtag [rel="ct_cat_icon"]').removeClass('at-delete_image_button').addClass('at-upload_image_button'); |
| 271 | - jQuery('#addtag [rel="ct_cat_default_img"]').val('<?php _e('Upload Image','geodirectory');?>'); |
|
| 272 | - jQuery('#addtag [rel="ct_cat_icon"]').val('<?php _e('Upload Image','geodirectory');?>'); |
|
| 271 | + jQuery('#addtag [rel="ct_cat_default_img"]').val('<?php _e('Upload Image', 'geodirectory'); ?>'); |
|
| 272 | + jQuery('#addtag [rel="ct_cat_icon"]').val('<?php _e('Upload Image', 'geodirectory'); ?>'); |
|
| 273 | 273 | } |
| 274 | 274 | }, 1000); |
| 275 | 275 | |