@@ -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. |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | /** |
35 | 35 | * Include WordPress core file so we can use core functions to check for active plugins. |
36 | 36 | */ |
37 | - include_once(ABSPATH . 'wp-admin/includes/plugin.php'); |
|
37 | + include_once(ABSPATH.'wp-admin/includes/plugin.php'); |
|
38 | 38 | |
39 | 39 | if (is_plugin_active('geodirectory-genesis-compatibility-pack/geodir_genesis_compatibility.php')) { |
40 | 40 | deactivate_plugins('geodirectory-genesis-compatibility-pack/geodir_genesis_compatibility.php'); |
@@ -68,8 +68,8 @@ discard block |
||
68 | 68 | * @global string $plugin_file_name Base file name. 'geodirectory/geodirectory.php'. |
69 | 69 | */ |
70 | 70 | global $wpdb, $plugin_prefix, $geodir_addon_list, $plugin_file_name; |
71 | -$plugin_prefix = $wpdb->prefix . 'geodir_'; |
|
72 | -$plugin_file_name = basename(plugin_dir_path(__FILE__)) . '/' . basename(__FILE__); |
|
71 | +$plugin_prefix = $wpdb->prefix.'geodir_'; |
|
72 | +$plugin_file_name = basename(plugin_dir_path(__FILE__)).'/'.basename(__FILE__); |
|
73 | 73 | |
74 | 74 | /* |
75 | 75 | * This will store the cached post custom fields per package for each page load so not to run for each listing. |
@@ -84,24 +84,24 @@ discard block |
||
84 | 84 | /** |
85 | 85 | * Define constants |
86 | 86 | */ |
87 | -if(!defined('GEODIRECTORY_PLUGIN_DIR')) define('GEODIRECTORY_PLUGIN_DIR', plugin_dir_path( __FILE__ )); |
|
87 | +if (!defined('GEODIRECTORY_PLUGIN_DIR')) define('GEODIRECTORY_PLUGIN_DIR', plugin_dir_path(__FILE__)); |
|
88 | 88 | |
89 | 89 | /* |
90 | 90 | * Declare database table names. All since version 1.0.0 |
91 | 91 | */ |
92 | 92 | |
93 | 93 | /** Define the database name for the countries table. */ |
94 | -if (!defined('GEODIR_COUNTRIES_TABLE')) define('GEODIR_COUNTRIES_TABLE', $plugin_prefix . 'countries'); |
|
94 | +if (!defined('GEODIR_COUNTRIES_TABLE')) define('GEODIR_COUNTRIES_TABLE', $plugin_prefix.'countries'); |
|
95 | 95 | /** Define the database name for the custom fields table. */ |
96 | -if (!defined('GEODIR_CUSTOM_FIELDS_TABLE')) define('GEODIR_CUSTOM_FIELDS_TABLE', $plugin_prefix . 'custom_fields'); |
|
96 | +if (!defined('GEODIR_CUSTOM_FIELDS_TABLE')) define('GEODIR_CUSTOM_FIELDS_TABLE', $plugin_prefix.'custom_fields'); |
|
97 | 97 | /** Define the database name for the icons table. */ |
98 | -if (!defined('GEODIR_ICON_TABLE')) define('GEODIR_ICON_TABLE', $plugin_prefix . 'post_icon'); |
|
98 | +if (!defined('GEODIR_ICON_TABLE')) define('GEODIR_ICON_TABLE', $plugin_prefix.'post_icon'); |
|
99 | 99 | /** Define the database name for the attachments table. */ |
100 | -if (!defined('GEODIR_ATTACHMENT_TABLE')) define('GEODIR_ATTACHMENT_TABLE', $plugin_prefix . 'attachments'); |
|
100 | +if (!defined('GEODIR_ATTACHMENT_TABLE')) define('GEODIR_ATTACHMENT_TABLE', $plugin_prefix.'attachments'); |
|
101 | 101 | /** Define the database name for the review table. */ |
102 | -if (!defined('GEODIR_REVIEW_TABLE')) define('GEODIR_REVIEW_TABLE', $plugin_prefix . 'post_review'); |
|
102 | +if (!defined('GEODIR_REVIEW_TABLE')) define('GEODIR_REVIEW_TABLE', $plugin_prefix.'post_review'); |
|
103 | 103 | /** Define the database name for the custom sort fields table. */ |
104 | -if (!defined('GEODIR_CUSTOM_SORT_FIELDS_TABLE')) define('GEODIR_CUSTOM_SORT_FIELDS_TABLE', $plugin_prefix . 'custom_sort_fields'); |
|
104 | +if (!defined('GEODIR_CUSTOM_SORT_FIELDS_TABLE')) define('GEODIR_CUSTOM_SORT_FIELDS_TABLE', $plugin_prefix.'custom_sort_fields'); |
|
105 | 105 | |
106 | 106 | /* |
107 | 107 | * Define our Google Analytic app settings |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | if (!defined('GEODIR_GA_CLIENTID')) define('GEODIR_GA_CLIENTID', '687912069872-sdpsjssrdt7t3ao1dnv1ib71hkckbt5s.apps.googleusercontent.com'); |
110 | 110 | if (!defined('GEODIR_GA_CLIENTSECRET')) define('GEODIR_GA_CLIENTSECRET', 'yBVkDpqJ1B9nAETHy738Zn8C'); //don't worry - this don't need to be secret in our case |
111 | 111 | if (!defined('GEODIR_GA_REDIRECT')) define('GEODIR_GA_REDIRECT', 'urn:ietf:wg:oauth:2.0:oob'); |
112 | -if (!defined('GEODIR_GA_SCOPE')) define('GEODIR_GA_SCOPE', 'https://www.googleapis.com/auth/analytics');//.readonly |
|
112 | +if (!defined('GEODIR_GA_SCOPE')) define('GEODIR_GA_SCOPE', 'https://www.googleapis.com/auth/analytics'); //.readonly |
|
113 | 113 | |
114 | 114 | |
115 | 115 | /* |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | if (!defined('GEODIRECTORY_TEXTDOMAIN')) define('GEODIRECTORY_TEXTDOMAIN', 'geodirectory'); |
119 | 119 | |
120 | 120 | // Load geodirectory plugin textdomain. |
121 | -add_action( 'init', 'geodir_load_textdomain' ); |
|
121 | +add_action('init', 'geodir_load_textdomain'); |
|
122 | 122 | |
123 | 123 | /* |
124 | 124 | * A function to log GD errors no matter the type given. |
@@ -129,18 +129,18 @@ discard block |
||
129 | 129 | * @param mixed $log The thing that should be logged. |
130 | 130 | * @package GeoDirectory |
131 | 131 | */ |
132 | -function geodir_error_log($log){ |
|
132 | +function geodir_error_log($log) { |
|
133 | 133 | /* |
134 | 134 | * A filter to override the WP_DEBUG setting for function geodir_error_log(). |
135 | 135 | * |
136 | 136 | * @since 1.5.7 |
137 | 137 | */ |
138 | - $should_log = apply_filters( 'geodir_log_errors', WP_DEBUG); |
|
139 | - if ( true === $should_log ) { |
|
140 | - if ( is_array( $log ) || is_object( $log ) ) { |
|
141 | - error_log( print_r( $log, true ) ); |
|
138 | + $should_log = apply_filters('geodir_log_errors', WP_DEBUG); |
|
139 | + if (true === $should_log) { |
|
140 | + if (is_array($log) || is_object($log)) { |
|
141 | + error_log(print_r($log, true)); |
|
142 | 142 | } else { |
143 | - error_log( $log ); |
|
143 | + error_log($log); |
|
144 | 144 | } |
145 | 145 | } |
146 | 146 | } |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | /* |
180 | 180 | * Admin init + activation hooks |
181 | 181 | */ |
182 | -if (is_admin() || defined( 'GD_TESTING_MODE' )) { |
|
182 | +if (is_admin() || defined('GD_TESTING_MODE')) { |
|
183 | 183 | |
184 | 184 | /** |
185 | 185 | * Include functions used in admin area only. |
@@ -216,14 +216,14 @@ discard block |
||
216 | 216 | * |
217 | 217 | * @since 1.0.0 |
218 | 218 | */ |
219 | - require_once(geodir_plugin_path() . '/upgrade.php'); |
|
219 | + require_once(geodir_plugin_path().'/upgrade.php'); |
|
220 | 220 | if (get_option('geodir_installed') != 1) { |
221 | 221 | /** |
222 | 222 | * Define language constants, here as they are not loaded yet. |
223 | 223 | * |
224 | 224 | * @since 1.0.0 |
225 | 225 | */ |
226 | - require_once(geodir_plugin_path() . '/language.php'); |
|
226 | + require_once(geodir_plugin_path().'/language.php'); |
|
227 | 227 | /** |
228 | 228 | * Include the plugin install file that sets up the databases and any options on first run. |
229 | 229 | * |
@@ -240,13 +240,13 @@ discard block |
||
240 | 240 | * @since 1.5.6 |
241 | 241 | */ |
242 | 242 | global $pagenow; |
243 | - if ( 'plugins.php' === $pagenow ) |
|
243 | + if ('plugins.php' === $pagenow) |
|
244 | 244 | { |
245 | 245 | // Better update message |
246 | - $file = basename( __FILE__ ); |
|
247 | - $folder = basename( dirname( __FILE__ ) ); |
|
246 | + $file = basename(__FILE__); |
|
247 | + $folder = basename(dirname(__FILE__)); |
|
248 | 248 | $hook = "in_plugin_update_message-{$folder}/{$file}"; |
249 | - add_action( $hook, 'geodire_admin_upgrade_notice', 20, 2 ); |
|
249 | + add_action($hook, 'geodire_admin_upgrade_notice', 20, 2); |
|
250 | 250 | } |
251 | 251 | |
252 | 252 | } |
@@ -38,21 +38,21 @@ discard block |
||
38 | 38 | $is_detail_page = false; |
39 | 39 | $geodir_map_name = geodir_map_name(); |
40 | 40 | |
41 | - if((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview') )) { |
|
41 | + if ((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview'))) { |
|
42 | 42 | $is_detail_page = true; |
43 | 43 | } |
44 | 44 | |
45 | 45 | wp_enqueue_script('jquery'); |
46 | 46 | |
47 | - wp_register_script('geodirectory-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory.min.js', array(), GEODIRECTORY_VERSION); |
|
47 | + wp_register_script('geodirectory-script', geodir_plugin_url().'/geodirectory-assets/js/geodirectory.min.js', array(), GEODIRECTORY_VERSION); |
|
48 | 48 | wp_enqueue_script('geodirectory-script'); |
49 | 49 | |
50 | 50 | $geodir_vars_data = array( |
51 | 51 | 'siteurl' => get_option('siteurl'), |
52 | 52 | 'geodir_plugin_url' => geodir_plugin_url(), |
53 | - 'geodir_lazy_load' => get_option('geodir_lazy_load',1), |
|
53 | + 'geodir_lazy_load' => get_option('geodir_lazy_load', 1), |
|
54 | 54 | 'geodir_ajax_url' => geodir_get_ajax_url(), |
55 | - 'geodir_gd_modal' => (int)get_option('geodir_disable_gb_modal'), |
|
55 | + 'geodir_gd_modal' => (int) get_option('geodir_disable_gb_modal'), |
|
56 | 56 | 'is_rtl' => is_rtl() ? 1 : 0 // fix rtl issue |
57 | 57 | ); |
58 | 58 | |
@@ -73,24 +73,24 @@ discard block |
||
73 | 73 | * |
74 | 74 | * } |
75 | 75 | */ |
76 | - $geodir_vars_data = apply_filters('geodir_vars_data',$geodir_vars_data); |
|
76 | + $geodir_vars_data = apply_filters('geodir_vars_data', $geodir_vars_data); |
|
77 | 77 | |
78 | 78 | wp_localize_script('geodirectory-script', 'geodir_var', $geodir_vars_data); |
79 | 79 | |
80 | - wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION,true); |
|
81 | - if($is_detail_page){wp_enqueue_script('geodirectory-jquery-flexslider-js');} |
|
80 | + wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url().'/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION, true); |
|
81 | + if ($is_detail_page) {wp_enqueue_script('geodirectory-jquery-flexslider-js'); } |
|
82 | 82 | |
83 | - wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url() . '/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION,true); |
|
83 | + wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url().'/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION, true); |
|
84 | 84 | wp_enqueue_script('geodirectory-lightbox-jquery'); |
85 | 85 | |
86 | - wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url() . '/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION,true); |
|
86 | + wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url().'/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION, true); |
|
87 | 87 | if ($is_detail_page) { |
88 | 88 | wp_enqueue_script('geodirectory-jquery-simplemodal'); |
89 | 89 | } |
90 | 90 | |
91 | 91 | if (in_array($geodir_map_name, array('auto', 'google'))) { |
92 | - $map_lang = "&language=" . geodir_get_map_default_language(); |
|
93 | - $map_key = "&key=" . geodir_get_map_api_key(); |
|
92 | + $map_lang = "&language=".geodir_get_map_default_language(); |
|
93 | + $map_key = "&key=".geodir_get_map_api_key(); |
|
94 | 94 | /** |
95 | 95 | * Filter the variables that are added to the end of the google maps script call. |
96 | 96 | * |
@@ -100,48 +100,48 @@ discard block |
||
100 | 100 | * @param string $var The string to filter, default is empty string. |
101 | 101 | */ |
102 | 102 | $map_extra = apply_filters('geodir_googlemap_script_extra', ''); |
103 | - wp_enqueue_script('geodirectory-googlemap-script', 'https://maps.google.com/maps/api/js?' . $map_lang . $map_key . $map_extra , '', NULL); |
|
103 | + wp_enqueue_script('geodirectory-googlemap-script', 'https://maps.google.com/maps/api/js?'.$map_lang.$map_key.$map_extra, '', NULL); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | if ($geodir_map_name == 'osm') { |
107 | 107 | // Leaflet OpenStreetMap |
108 | - wp_register_style('geodirectory-leaflet-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION); |
|
108 | + wp_register_style('geodirectory-leaflet-style', geodir_plugin_url().'/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION); |
|
109 | 109 | wp_enqueue_style('geodirectory-leaflet-style'); |
110 | 110 | |
111 | - wp_register_script('geodirectory-leaflet-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION); |
|
111 | + wp_register_script('geodirectory-leaflet-script', geodir_plugin_url().'/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION); |
|
112 | 112 | wp_enqueue_script('geodirectory-leaflet-script'); |
113 | 113 | |
114 | - wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/osm.geocode.js', array(), GEODIRECTORY_VERSION); |
|
114 | + wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url().'/geodirectory-assets/leaflet/osm.geocode.js', array(), GEODIRECTORY_VERSION); |
|
115 | 115 | wp_enqueue_script('geodirectory-leaflet-geo-script'); |
116 | 116 | |
117 | 117 | if ($is_detail_page) { |
118 | - wp_register_style('geodirectory-leaflet-routing-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/routing/leaflet-routing-machine.css', array(), GEODIRECTORY_VERSION); |
|
118 | + wp_register_style('geodirectory-leaflet-routing-style', geodir_plugin_url().'/geodirectory-assets/leaflet/routing/leaflet-routing-machine.css', array(), GEODIRECTORY_VERSION); |
|
119 | 119 | wp_enqueue_style('geodirectory-leaflet-routing-style'); |
120 | 120 | |
121 | - wp_register_script('geodirectory-leaflet-routing-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/routing/leaflet-routing-machine.js', array(), GEODIRECTORY_VERSION); |
|
121 | + wp_register_script('geodirectory-leaflet-routing-script', geodir_plugin_url().'/geodirectory-assets/leaflet/routing/leaflet-routing-machine.js', array(), GEODIRECTORY_VERSION); |
|
122 | 122 | wp_enqueue_script('geodirectory-leaflet-routing-script'); |
123 | 123 | } |
124 | 124 | } |
125 | - wp_enqueue_script( 'jquery-ui-autocomplete' ); |
|
125 | + wp_enqueue_script('jquery-ui-autocomplete'); |
|
126 | 126 | |
127 | - wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION,true); |
|
127 | + wp_register_script('geodirectory-goMap-script', geodir_plugin_url().'/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION, true); |
|
128 | 128 | wp_enqueue_script('geodirectory-goMap-script'); |
129 | 129 | |
130 | 130 | |
131 | - wp_register_script('chosen', geodir_plugin_url() . '/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION); |
|
131 | + wp_register_script('chosen', geodir_plugin_url().'/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION); |
|
132 | 132 | wp_enqueue_script('chosen'); |
133 | 133 | |
134 | - wp_register_script('geodirectory-choose-ajax', geodir_plugin_url() . '/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION); |
|
134 | + wp_register_script('geodirectory-choose-ajax', geodir_plugin_url().'/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION); |
|
135 | 135 | wp_enqueue_script('geodirectory-choose-ajax'); |
136 | 136 | |
137 | - wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.ui.timepicker.min.js', array('jquery-ui-datepicker', 'jquery-ui-slider', 'jquery-effects-core', 'jquery-effects-slide'), '', true); |
|
137 | + wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url().'/geodirectory-assets/js/jquery.ui.timepicker.min.js', array('jquery-ui-datepicker', 'jquery-ui-slider', 'jquery-effects-core', 'jquery-effects-slide'), '', true); |
|
138 | 138 | |
139 | 139 | if (is_page() && geodir_is_page('add-listing')) { |
140 | 140 | // SCRIPT FOR UPLOAD |
141 | 141 | wp_enqueue_script('plupload-all'); |
142 | 142 | wp_enqueue_script('jquery-ui-sortable'); |
143 | 143 | |
144 | - wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION,true); |
|
144 | + wp_register_script('geodirectory-plupload-script', geodir_plugin_url().'/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION, true); |
|
145 | 145 | wp_enqueue_script('geodirectory-plupload-script'); |
146 | 146 | // SCRIPT FOR UPLOAD END |
147 | 147 | |
@@ -188,27 +188,27 @@ discard block |
||
188 | 188 | |
189 | 189 | wp_localize_script('geodirectory-plupload-script', 'gd_plupload', $gd_plupload_init); |
190 | 190 | |
191 | - wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url() . '/geodirectory-assets/js/listing_validation.min.js#asyncload'); |
|
191 | + wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url().'/geodirectory-assets/js/listing_validation.min.js#asyncload'); |
|
192 | 192 | } // End if for add place page |
193 | 193 | |
194 | - wp_register_script('geodirectory-post-custom-js', geodir_plugin_url() . '/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true); |
|
194 | + wp_register_script('geodirectory-post-custom-js', geodir_plugin_url().'/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true); |
|
195 | 195 | if ($is_detail_page) { |
196 | 196 | wp_enqueue_script('geodirectory-post-custom-js'); |
197 | 197 | } |
198 | 198 | |
199 | 199 | // font awesome rating script |
200 | 200 | if (get_option('geodir_reviewrating_enable_font_awesome')) { |
201 | - wp_register_script('geodir-barrating-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.barrating.min.js', array(), GEODIRECTORY_VERSION, true); |
|
201 | + wp_register_script('geodir-barrating-js', geodir_plugin_url().'/geodirectory-assets/js/jquery.barrating.min.js', array(), GEODIRECTORY_VERSION, true); |
|
202 | 202 | wp_enqueue_script('geodir-barrating-js'); |
203 | 203 | } else { // default rating script |
204 | - wp_register_script('geodir-jRating-js', geodir_plugin_url() . '/geodirectory-assets/js/jRating.jquery.min.js', array(), GEODIRECTORY_VERSION, true); |
|
204 | + wp_register_script('geodir-jRating-js', geodir_plugin_url().'/geodirectory-assets/js/jRating.jquery.min.js', array(), GEODIRECTORY_VERSION, true); |
|
205 | 205 | wp_enqueue_script('geodir-jRating-js'); |
206 | 206 | } |
207 | 207 | |
208 | - wp_register_script('geodir-on-document-load', geodir_plugin_url() . '/geodirectory-assets/js/on_document_load.min.js#asyncload', array(), GEODIRECTORY_VERSION, true); |
|
208 | + wp_register_script('geodir-on-document-load', geodir_plugin_url().'/geodirectory-assets/js/on_document_load.min.js#asyncload', array(), GEODIRECTORY_VERSION, true); |
|
209 | 209 | wp_enqueue_script('geodir-on-document-load'); |
210 | 210 | |
211 | - wp_register_script('google-geometa', geodir_plugin_url() . '/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true); |
|
211 | + wp_register_script('google-geometa', geodir_plugin_url().'/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true); |
|
212 | 212 | wp_enqueue_script('google-geometa'); |
213 | 213 | } |
214 | 214 | |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | */ |
224 | 224 | function geodir_header_scripts() |
225 | 225 | { |
226 | - echo '<style>' . stripslashes(get_option('geodir_coustem_css')) . '</style>'; |
|
226 | + echo '<style>'.stripslashes(get_option('geodir_coustem_css')).'</style>'; |
|
227 | 227 | echo stripslashes(get_option('geodir_header_scripts')); |
228 | 228 | } |
229 | 229 | |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | function geodir_footer_scripts() |
241 | 241 | { |
242 | 242 | |
243 | - if(get_option('geodir_ga_add_tracking_code') && get_option('geodir_ga_account_id')){?> |
|
243 | + if (get_option('geodir_ga_add_tracking_code') && get_option('geodir_ga_account_id')) {?> |
|
244 | 244 | |
245 | 245 | <script> |
246 | 246 | (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ |
@@ -248,13 +248,13 @@ discard block |
||
248 | 248 | m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) |
249 | 249 | })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); |
250 | 250 | |
251 | - ga('create', '<?php echo esc_attr(get_option('geodir_ga_account_id'));?>', 'auto'); |
|
251 | + ga('create', '<?php echo esc_attr(get_option('geodir_ga_account_id')); ?>', 'auto'); |
|
252 | 252 | ga('send', 'pageview'); |
253 | 253 | |
254 | 254 | </script> |
255 | 255 | |
256 | 256 | <?php |
257 | - }elseif(get_option('geodir_ga_tracking_code') && !get_option('geodir_ga_account_id')){ |
|
257 | + }elseif (get_option('geodir_ga_tracking_code') && !get_option('geodir_ga_account_id')) { |
|
258 | 258 | echo stripslashes(get_option('geodir_ga_tracking_code')); |
259 | 259 | } |
260 | 260 | |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | * |
266 | 266 | * Flexbox wont wrap on ios for search form items |
267 | 267 | */ |
268 | - if (preg_match( '/iPad|iPod|iPhone|Safari/', $_SERVER['HTTP_USER_AGENT'] ) ) { |
|
268 | + if (preg_match('/iPad|iPod|iPhone|Safari/', $_SERVER['HTTP_USER_AGENT'])) { |
|
269 | 269 | echo "<style>body .geodir-listing-search.gd-search-bar-style .geodir-loc-bar .clearfix.geodir-loc-bar-in .geodir-search .gd-search-input-wrapper{flex:50 1 auto !important;min-width: initial !important;width:auto !important;}.geodir-filter-container .geodir-filter-cat{width:auto !important;}</style>"; |
270 | 270 | } |
271 | 271 | } |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | */ |
282 | 282 | function geodir_add_async_forscript($url) |
283 | 283 | { |
284 | - if (strpos($url, '#asyncload')===false) |
|
284 | + if (strpos($url, '#asyncload') === false) |
|
285 | 285 | return $url; |
286 | 286 | else if (is_admin()) |
287 | 287 | return str_replace('#asyncload', '', $url); |
@@ -299,12 +299,12 @@ discard block |
||
299 | 299 | function geodir_templates_styles() |
300 | 300 | { |
301 | 301 | |
302 | - wp_register_style('geodir-core-scss', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION); |
|
302 | + wp_register_style('geodir-core-scss', geodir_plugin_url().'/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION); |
|
303 | 303 | wp_enqueue_style('geodir-core-scss'); |
304 | - wp_register_style('geodir-core-scss-footer', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend_footer.css', array(), GEODIRECTORY_VERSION); |
|
304 | + wp_register_style('geodir-core-scss-footer', geodir_plugin_url().'/geodirectory-assets/css/gd_core_frontend_footer.css', array(), GEODIRECTORY_VERSION); |
|
305 | 305 | |
306 | - if(is_rtl()){ |
|
307 | - wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url() . '/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION); |
|
306 | + if (is_rtl()) { |
|
307 | + wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url().'/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION); |
|
308 | 308 | wp_enqueue_style('geodirectory-frontend-rtl-style'); |
309 | 309 | } |
310 | 310 | |
@@ -378,18 +378,18 @@ discard block |
||
378 | 378 | $term_id = get_queried_object_id(); |
379 | 379 | $taxonomy = get_query_var('taxonomy'); |
380 | 380 | |
381 | - if ($term_id && $post_type && get_query_var('taxonomy') == $post_type . 'category' ) { |
|
382 | - $term = get_term($term_id, $post_type . 'category'); |
|
381 | + if ($term_id && $post_type && get_query_var('taxonomy') == $post_type.'category') { |
|
382 | + $term = get_term($term_id, $post_type.'category'); |
|
383 | 383 | } |
384 | 384 | } |
385 | 385 | |
386 | - if (geodir_is_page('search') && !empty($_REQUEST['s' . $post_type . 'category'])) { |
|
387 | - $taxonomy_search = $_REQUEST['s' . $post_type . 'category']; |
|
386 | + if (geodir_is_page('search') && !empty($_REQUEST['s'.$post_type.'category'])) { |
|
387 | + $taxonomy_search = $_REQUEST['s'.$post_type.'category']; |
|
388 | 388 | |
389 | 389 | if (!is_array($taxonomy_search)) { |
390 | - $term = get_term((int)$taxonomy_search, $post_type . 'category'); |
|
391 | - } else if(is_array($taxonomy_search) && count($taxonomy_search) == 1) { // single category search |
|
392 | - $term = get_term((int)$taxonomy_search[0], $post_type . 'category'); |
|
390 | + $term = get_term((int) $taxonomy_search, $post_type.'category'); |
|
391 | + } else if (is_array($taxonomy_search) && count($taxonomy_search) == 1) { // single category search |
|
392 | + $term = get_term((int) $taxonomy_search[0], $post_type.'category'); |
|
393 | 393 | } |
394 | 394 | } |
395 | 395 | |
@@ -401,7 +401,7 @@ discard block |
||
401 | 401 | if ($max_page > 1 || $always_show) { |
402 | 402 | // Extra pagination info |
403 | 403 | $geodir_pagination_more_info = get_option('geodir_pagination_advance_info'); |
404 | - $start_no = ( $paged - 1 ) * $posts_per_page + 1; |
|
404 | + $start_no = ($paged - 1) * $posts_per_page + 1; |
|
405 | 405 | $end_no = min($paged * $posts_per_page, $numposts); |
406 | 406 | |
407 | 407 | if ($geodir_pagination_more_info != '') { |
@@ -411,7 +411,7 @@ discard block |
||
411 | 411 | } else { |
412 | 412 | $pegination_desc = wp_sprintf(__('Showing listings %d-%d of %d', 'geodirectory'), $start_no, $end_no, $numposts); |
413 | 413 | } |
414 | - $pagination_info = '<div class="gd-pagination-details">' . $pegination_desc . '</div>'; |
|
414 | + $pagination_info = '<div class="gd-pagination-details">'.$pegination_desc.'</div>'; |
|
415 | 415 | /** |
416 | 416 | * Adds an extra pagination info above/under pagination. |
417 | 417 | * |
@@ -427,15 +427,15 @@ discard block |
||
427 | 427 | $pagination_info = apply_filters('geodir_pagination_advance_info', $pagination_info, $listing_type_name, $start_no, $end_no, $numposts, $post_type); |
428 | 428 | |
429 | 429 | if ($geodir_pagination_more_info == 'before') { |
430 | - $before = $before . $pagination_info; |
|
430 | + $before = $before.$pagination_info; |
|
431 | 431 | } else if ($geodir_pagination_more_info == 'after') { |
432 | - $after = $pagination_info . $after; |
|
432 | + $after = $pagination_info.$after; |
|
433 | 433 | } |
434 | 434 | } |
435 | 435 | |
436 | 436 | echo "$before <div class='Navi gd-navi'>"; |
437 | 437 | if ($paged >= ($pages_to_show - 1)) { |
438 | - echo '<a href="' . str_replace('&paged', '&paged', get_pagenum_link()) . '">«</a>'; |
|
438 | + echo '<a href="'.str_replace('&paged', '&paged', get_pagenum_link()).'">«</a>'; |
|
439 | 439 | } |
440 | 440 | previous_posts_link($prelabel); |
441 | 441 | for ($i = $paged - $half_pages_to_show; $i <= $paged + $half_pages_to_show; $i++) { |
@@ -443,13 +443,13 @@ discard block |
||
443 | 443 | if ($i == $paged) { |
444 | 444 | echo "<strong class='on'>$i</strong>"; |
445 | 445 | } else { |
446 | - echo ' <a href="' . str_replace('&paged', '&paged', get_pagenum_link($i)) . '">' . $i . '</a> '; |
|
446 | + echo ' <a href="'.str_replace('&paged', '&paged', get_pagenum_link($i)).'">'.$i.'</a> '; |
|
447 | 447 | } |
448 | 448 | } |
449 | 449 | } |
450 | 450 | next_posts_link($nxtlabel, $max_page); |
451 | 451 | if (($paged + $half_pages_to_show) < ($max_page)) { |
452 | - echo '<a href="' . str_replace('&paged', '&paged', get_pagenum_link($max_page)) . '">»</a>'; |
|
452 | + echo '<a href="'.str_replace('&paged', '&paged', get_pagenum_link($max_page)).'">»</a>'; |
|
453 | 453 | } |
454 | 454 | echo "</div> $after"; |
455 | 455 | } |
@@ -487,7 +487,7 @@ discard block |
||
487 | 487 | jQuery(function ($) { |
488 | 488 | $("#distance_slider").slider({ |
489 | 489 | range: true, |
490 | - values: [0, <?php echo ($_REQUEST['sdist']!='') ? sanitize_text_field($_REQUEST['sdist']) : "0"; ?>], |
|
490 | + values: [0, <?php echo ($_REQUEST['sdist'] != '') ? sanitize_text_field($_REQUEST['sdist']) : "0"; ?>], |
|
491 | 491 | min: 0, |
492 | 492 | max: <?php echo $dist; ?>, |
493 | 493 | step: <?php echo $dist_dif; ?>, |
@@ -552,7 +552,7 @@ discard block |
||
552 | 552 | |
553 | 553 | |
554 | 554 | <script type="text/javascript"> |
555 | - var default_location = '<?php if($search_location = geodir_get_default_location()) echo $search_location->city ;?>'; |
|
555 | + var default_location = '<?php if ($search_location = geodir_get_default_location()) echo $search_location->city; ?>'; |
|
556 | 556 | var latlng; |
557 | 557 | var address; |
558 | 558 | var dist = 0; |
@@ -568,7 +568,7 @@ discard block |
||
568 | 568 | var $form = jQuery(this).closest('form'); |
569 | 569 | |
570 | 570 | if (jQuery("#sdist input[type='radio']:checked").length != 0) dist = jQuery("#sdist input[type='radio']:checked").val(); |
571 | - if (jQuery('.search_text', $form).val() == '' || jQuery('.search_text', $form).val() == '<?php echo $default_search_for_text;?>') jQuery('.search_text', $form).val(s); |
|
571 | + if (jQuery('.search_text', $form).val() == '' || jQuery('.search_text', $form).val() == '<?php echo $default_search_for_text; ?>') jQuery('.search_text', $form).val(s); |
|
572 | 572 | |
573 | 573 | // Disable location based search for disabled location post type. |
574 | 574 | if (jQuery('.search_by_post', $form).val() != '' && typeof gd_cpt_no_location == 'function') { |
@@ -582,7 +582,7 @@ discard block |
||
582 | 582 | } |
583 | 583 | } |
584 | 584 | |
585 | - if (dist > 0 || (jQuery('select[name="sort_by"]').val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest') || (jQuery(".snear", $form).val() != '' && jQuery(".snear", $form).val() != '<?php echo $default_near_text;?>')) { |
|
585 | + if (dist > 0 || (jQuery('select[name="sort_by"]').val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest') || (jQuery(".snear", $form).val() != '' && jQuery(".snear", $form).val() != '<?php echo $default_near_text; ?>')) { |
|
586 | 586 | geodir_setsearch($form); |
587 | 587 | } else { |
588 | 588 | jQuery(".snear", $form).val(''); |
@@ -600,7 +600,7 @@ discard block |
||
600 | 600 | }); |
601 | 601 | |
602 | 602 | function geodir_setsearch($form) { |
603 | - if ((dist > 0 || (jQuery('select[name="sort_by"]', $form).val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest')) && (jQuery(".snear", $form).val() == '' || jQuery(".snear", $form).val() == '<?php echo $default_near_text;?>')) jQuery(".snear", $form).val(default_location); |
|
603 | + if ((dist > 0 || (jQuery('select[name="sort_by"]', $form).val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest')) && (jQuery(".snear", $form).val() == '' || jQuery(".snear", $form).val() == '<?php echo $default_near_text; ?>')) jQuery(".snear", $form).val(default_location); |
|
604 | 604 | geocodeAddress($form); |
605 | 605 | } |
606 | 606 | |
@@ -619,15 +619,15 @@ discard block |
||
619 | 619 | // Call the geocode function |
620 | 620 | Sgeocoder = window.gdMaps == 'google' ? new google.maps.Geocoder() : null; |
621 | 621 | |
622 | - if (jQuery('.snear', $form).val() == '' || ( jQuery('.sgeo_lat').val() != '' && jQuery('.sgeo_lon').val() != '' ) || jQuery('.snear', $form).val().match("^<?php _e('In:','geodirectory');?>")) { |
|
623 | - if (jQuery('.snear', $form).val().match("^<?php _e('In:','geodirectory');?>")) { |
|
622 | + if (jQuery('.snear', $form).val() == '' || ( jQuery('.sgeo_lat').val() != '' && jQuery('.sgeo_lon').val() != '' ) || jQuery('.snear', $form).val().match("^<?php _e('In:', 'geodirectory'); ?>")) { |
|
623 | + if (jQuery('.snear', $form).val().match("^<?php _e('In:', 'geodirectory'); ?>")) { |
|
624 | 624 | jQuery(".snear", $form).val(''); |
625 | 625 | } |
626 | 626 | jQuery($form).submit(); |
627 | 627 | } else { |
628 | 628 | var address = jQuery(".snear", $form).val(); |
629 | 629 | |
630 | - if (jQuery('.snear', $form).val() == '<?php echo $default_near_text;?>') { |
|
630 | + if (jQuery('.snear', $form).val() == '<?php echo $default_near_text; ?>') { |
|
631 | 631 | initialise2(); |
632 | 632 | } else { |
633 | 633 | <?php |
@@ -640,12 +640,12 @@ discard block |
||
640 | 640 | $near_add2 = apply_filters('geodir_search_near_addition', ''); |
641 | 641 | ?> |
642 | 642 | if (window.gdMaps === 'google') { |
643 | - Sgeocoder.geocode({'address': address<?php echo ($near_add ? '+", ' . $near_add . '"' : '') . $near_add2;?>}, |
|
643 | + Sgeocoder.geocode({'address': address<?php echo ($near_add ? '+", '.$near_add.'"' : '').$near_add2; ?>}, |
|
644 | 644 | function (results, status) { |
645 | 645 | if (status == google.maps.GeocoderStatus.OK) { |
646 | 646 | updateSearchPosition(results[0].geometry.location, $form); |
647 | 647 | } else { |
648 | - alert("<?php esc_attr_e('Search was not successful for the following reason :', 'geodirectory');?>" + status); |
|
648 | + alert("<?php esc_attr_e('Search was not successful for the following reason :', 'geodirectory'); ?>" + status); |
|
649 | 649 | } |
650 | 650 | }); |
651 | 651 | } else if (window.gdMaps === 'osm') { |
@@ -654,7 +654,7 @@ discard block |
||
654 | 654 | if (typeof geo !== 'undefined' && geo.lat && geo.lon) { |
655 | 655 | updateSearchPosition(geo, $form); |
656 | 656 | } else { |
657 | - alert("<?php esc_attr_e('Search was not successful for the requested address.', 'geodirectory');?>"); |
|
657 | + alert("<?php esc_attr_e('Search was not successful for the requested address.', 'geodirectory'); ?>"); |
|
658 | 658 | } |
659 | 659 | }); |
660 | 660 | } else { |
@@ -700,19 +700,19 @@ discard block |
||
700 | 700 | var msg; |
701 | 701 | switch (err.code) { |
702 | 702 | case err.UNKNOWN_ERROR: |
703 | - msg = "<?php _e('Unable to find your location','geodirectory');?>"; |
|
703 | + msg = "<?php _e('Unable to find your location', 'geodirectory'); ?>"; |
|
704 | 704 | break; |
705 | 705 | case err.PERMISSION_DENINED: |
706 | - msg = "<?php _e('Permission denied in finding your location','geodirectory');?>"; |
|
706 | + msg = "<?php _e('Permission denied in finding your location', 'geodirectory'); ?>"; |
|
707 | 707 | break; |
708 | 708 | case err.POSITION_UNAVAILABLE: |
709 | - msg = "<?php _e('Your location is currently unknown','geodirectory');?>"; |
|
709 | + msg = "<?php _e('Your location is currently unknown', 'geodirectory'); ?>"; |
|
710 | 710 | break; |
711 | 711 | case err.BREAK: |
712 | - msg = "<?php _e('Attempt to find location took too long','geodirectory');?>"; |
|
712 | + msg = "<?php _e('Attempt to find location took too long', 'geodirectory'); ?>"; |
|
713 | 713 | break; |
714 | 714 | default: |
715 | - msg = "<?php _e('Location detection not supported in browser','geodirectory');?>"; |
|
715 | + msg = "<?php _e('Location detection not supported in browser', 'geodirectory'); ?>"; |
|
716 | 716 | } |
717 | 717 | jQuery('#info').html(msg); |
718 | 718 | } |
@@ -751,7 +751,7 @@ discard block |
||
751 | 751 | * @param object $post The post object. |
752 | 752 | * @param string $link The link to the post. |
753 | 753 | */ |
754 | - $return = apply_filters('geodir_featured_badge_on_image', '<a href="' . $link . '"><span class="geodir_featured_img"> </span></a>',$post,$link); |
|
754 | + $return = apply_filters('geodir_featured_badge_on_image', '<a href="'.$link.'"><span class="geodir_featured_img"> </span></a>', $post, $link); |
|
755 | 755 | break; |
756 | 756 | case 'new' : |
757 | 757 | /** |
@@ -761,7 +761,7 @@ discard block |
||
761 | 761 | * @param object $post The post object. |
762 | 762 | * @param string $link The link to the post. |
763 | 763 | */ |
764 | - $return = apply_filters('geodir_new_badge_on_image', '<a href="' . $link . '"><span class="geodir_new_listing"> </span></a>',$post,$link); |
|
764 | + $return = apply_filters('geodir_new_badge_on_image', '<a href="'.$link.'"><span class="geodir_new_listing"> </span></a>', $post, $link); |
|
765 | 765 | break; |
766 | 766 | |
767 | 767 | } |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | * @global object $wpdb WordPress Database object. |
19 | 19 | * @global string $dummy_image_path The dummy image path. |
20 | 20 | */ |
21 | -function geodir_dummy_data_taxonomies($post_type,$category_array) { |
|
21 | +function geodir_dummy_data_taxonomies($post_type, $category_array) { |
|
22 | 22 | global $wpdb, $dummy_image_path; |
23 | 23 | |
24 | 24 | |
@@ -43,14 +43,14 @@ discard block |
||
43 | 43 | |
44 | 44 | |
45 | 45 | if (geodir_dummy_folder_exists()) |
46 | - $dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy/cat_icon"; |
|
46 | + $dummy_image_url = geodir_plugin_url()."/geodirectory-admin/dummy/cat_icon"; |
|
47 | 47 | else |
48 | 48 | $dummy_image_url = 'http://www.wpgeodirectory.com/dummy/cat_icon'; |
49 | 49 | |
50 | 50 | $dummy_image_url = apply_filters('place_dummy_cat_image_url', $dummy_image_url); |
51 | 51 | |
52 | 52 | $catname = str_replace(' ', '_', $catname); |
53 | - $uploaded = (array)fetch_remote_file("$dummy_image_url/" . $catname . ".png"); |
|
53 | + $uploaded = (array) fetch_remote_file("$dummy_image_url/".$catname.".png"); |
|
54 | 54 | |
55 | 55 | if (empty($uploaded['error'])) { |
56 | 56 | $new_path = $uploaded['file']; |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | $wp_filetype = wp_check_filetype(basename($new_path), null); |
61 | 61 | |
62 | 62 | $attachment = array( |
63 | - 'guid' => $uploads['baseurl'] . '/' . basename($new_path), |
|
63 | + 'guid' => $uploads['baseurl'].'/'.basename($new_path), |
|
64 | 64 | 'post_mime_type' => $wp_filetype['type'], |
65 | 65 | 'post_title' => preg_replace('/\.[^.]+$/', '', basename($new_path)), |
66 | 66 | 'post_content' => '', |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | |
71 | 71 | // you must first include the image.php file |
72 | 72 | // for the function wp_generate_attachment_metadata() to work |
73 | - require_once(ABSPATH . 'wp-admin/includes/image.php'); |
|
73 | + require_once(ABSPATH.'wp-admin/includes/image.php'); |
|
74 | 74 | $attach_data = wp_generate_attachment_metadata($attach_id, $new_path); |
75 | 75 | wp_update_attachment_metadata($attach_id, $attach_data); |
76 | 76 | |
@@ -87,14 +87,14 @@ discard block |
||
87 | 87 | $last_catid = wp_insert_term($catname, $post_type.'category'); |
88 | 88 | |
89 | 89 | if (geodir_dummy_folder_exists()) |
90 | - $dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy/cat_icon"; |
|
90 | + $dummy_image_url = geodir_plugin_url()."/geodirectory-admin/dummy/cat_icon"; |
|
91 | 91 | else |
92 | 92 | $dummy_image_url = 'http://www.wpgeodirectory.com/dummy/cat_icon'; |
93 | 93 | |
94 | 94 | $dummy_image_url = apply_filters('place_dummy_cat_image_url', $dummy_image_url); |
95 | 95 | |
96 | 96 | $catname = str_replace(' ', '_', $catname); |
97 | - $uploaded = (array)fetch_remote_file("$dummy_image_url/" . $catname . ".png"); |
|
97 | + $uploaded = (array) fetch_remote_file("$dummy_image_url/".$catname.".png"); |
|
98 | 98 | |
99 | 99 | if (empty($uploaded['error'])) { |
100 | 100 | $new_path = $uploaded['file']; |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | $wp_filetype = wp_check_filetype(basename($new_path), null); |
105 | 105 | |
106 | 106 | $attachment = array( |
107 | - 'guid' => $uploads['baseurl'] . '/' . basename($new_path), |
|
107 | + 'guid' => $uploads['baseurl'].'/'.basename($new_path), |
|
108 | 108 | 'post_mime_type' => $wp_filetype['type'], |
109 | 109 | 'post_title' => preg_replace('/\.[^.]+$/', '', basename($new_path)), |
110 | 110 | 'post_content' => '', |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | |
117 | 117 | // you must first include the image.php file |
118 | 118 | // for the function wp_generate_attachment_metadata() to work |
119 | - require_once(ABSPATH . 'wp-admin/includes/image.php'); |
|
119 | + require_once(ABSPATH.'wp-admin/includes/image.php'); |
|
120 | 120 | $attach_data = wp_generate_attachment_metadata($attach_id, $new_path); |
121 | 121 | wp_update_attachment_metadata($attach_id, $attach_data); |
122 | 122 | |
@@ -130,18 +130,18 @@ discard block |
||
130 | 130 | } |
131 | 131 | |
132 | 132 | |
133 | -function geodir_dummy_data_types(){ |
|
133 | +function geodir_dummy_data_types() { |
|
134 | 134 | return array( |
135 | 135 | 'standard_places' => array( |
136 | - 'name'=>__('Default','geodirectory'), |
|
136 | + 'name'=>__('Default', 'geodirectory'), |
|
137 | 137 | 'count'=> 30 |
138 | 138 | ), |
139 | 139 | 'property_sale' => array( |
140 | - 'name'=>__('Property for sale','geodirectory'), |
|
140 | + 'name'=>__('Property for sale', 'geodirectory'), |
|
141 | 141 | 'count'=> 10 |
142 | 142 | ), |
143 | 143 | 'property_rent' => array( |
144 | - 'name'=>__('Property for rent','geodirectory'), |
|
144 | + 'name'=>__('Property for rent', 'geodirectory'), |
|
145 | 145 | 'count'=> 10 |
146 | 146 | ) |
147 | 147 | ); |
@@ -172,12 +172,12 @@ discard block |
||
172 | 172 | * @global object $wpdb WordPress Database object. |
173 | 173 | * @global string $plugin_prefix Geodirectory plugin table prefix. |
174 | 174 | */ |
175 | -function geodir_delete_dummy_posts($post_type,$data_type) |
|
175 | +function geodir_delete_dummy_posts($post_type, $data_type) |
|
176 | 176 | { |
177 | 177 | global $wpdb, $plugin_prefix; |
178 | 178 | |
179 | 179 | |
180 | - $post_ids = $wpdb->get_results("SELECT post_id FROM " . $plugin_prefix . $post_type."_detail WHERE post_dummy='1'"); |
|
180 | + $post_ids = $wpdb->get_results("SELECT post_id FROM ".$plugin_prefix.$post_type."_detail WHERE post_dummy='1'"); |
|
181 | 181 | |
182 | 182 | |
183 | 183 | foreach ($post_ids as $post_ids_obj) { |
@@ -185,9 +185,9 @@ discard block |
||
185 | 185 | } |
186 | 186 | |
187 | 187 | //double check posts are deleted |
188 | - $wpdb->get_results("DELETE FROM " . $plugin_prefix . $post_type. "_detail WHERE post_dummy='1'"); |
|
188 | + $wpdb->get_results("DELETE FROM ".$plugin_prefix.$post_type."_detail WHERE post_dummy='1'"); |
|
189 | 189 | |
190 | - update_option($post_type.'_dummy_data_type',''); |
|
190 | + update_option($post_type.'_dummy_data_type', ''); |
|
191 | 191 | } |
192 | 192 | |
193 | 193 | /** |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | * @global object $wpdb WordPress Database object. |
199 | 199 | * @global object $current_user Current user object. |
200 | 200 | */ |
201 | -function geodir_insert_dummy_posts($post_type,$data_type,$item_index) |
|
201 | +function geodir_insert_dummy_posts($post_type, $data_type, $item_index) |
|
202 | 202 | { |
203 | 203 | |
204 | 204 | ini_set('max_execution_time', 999999); //300 seconds = 5 minutes |
@@ -207,45 +207,45 @@ discard block |
||
207 | 207 | $total_count = 0; |
208 | 208 | global $dummy_post_index; |
209 | 209 | $dummy_post_index = $item_index; |
210 | - foreach( $data_types as $key=>$val){ |
|
211 | - if($key==$data_type){ |
|
210 | + foreach ($data_types as $key=>$val) { |
|
211 | + if ($key == $data_type) { |
|
212 | 212 | $total_count = $val['count']; |
213 | - if($key=='standard_places'){ |
|
213 | + if ($key == 'standard_places') { |
|
214 | 214 | /** |
215 | 215 | * Contains dummy post content. |
216 | 216 | * |
217 | 217 | * @since 1.0.0 |
218 | 218 | * @package GeoDirectory |
219 | 219 | */ |
220 | - include_once( 'dummy-data/standard_places.php' ); |
|
221 | - }elseif($key=='property_sale'){ |
|
220 | + include_once('dummy-data/standard_places.php'); |
|
221 | + }elseif ($key == 'property_sale') { |
|
222 | 222 | /** |
223 | 223 | * Contains dummy property for sale post content. |
224 | 224 | * |
225 | 225 | * @since 1.6.11 |
226 | 226 | * @package GeoDirectory |
227 | 227 | */ |
228 | - include_once( 'dummy-data/property_sale.php' ); |
|
229 | - }elseif($key=='property_rent'){ |
|
228 | + include_once('dummy-data/property_sale.php'); |
|
229 | + }elseif ($key == 'property_rent') { |
|
230 | 230 | /** |
231 | 231 | * Contains dummy property for sale post content. |
232 | 232 | * |
233 | 233 | * @since 1.6.11 |
234 | 234 | * @package GeoDirectory |
235 | 235 | */ |
236 | - include_once( 'dummy-data/property_rent.php' ); |
|
236 | + include_once('dummy-data/property_rent.php'); |
|
237 | 237 | } |
238 | 238 | |
239 | 239 | } |
240 | 240 | |
241 | - do_action('geodir_insert_dummy_data_loop',$post_type,$data_type,$item_index); |
|
241 | + do_action('geodir_insert_dummy_data_loop', $post_type, $data_type, $item_index); |
|
242 | 242 | } |
243 | 243 | |
244 | 244 | |
245 | 245 | |
246 | 246 | // delete image cache on last entry |
247 | - if($total_count == $item_index){ |
|
248 | - delete_transient( 'cached_dummy_images' ); |
|
247 | + if ($total_count == $item_index) { |
|
248 | + delete_transient('cached_dummy_images'); |
|
249 | 249 | flush_rewrite_rules(); |
250 | 250 | } |
251 | 251 | |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | } |
254 | 254 | |
255 | 255 | |
256 | -if (!function_exists('geodir_autoinstall_admin_header') && (get_option('geodir_installed') || defined( 'GD_TESTING_MODE' ))) { |
|
256 | +if (!function_exists('geodir_autoinstall_admin_header') && (get_option('geodir_installed') || defined('GD_TESTING_MODE'))) { |
|
257 | 257 | /** |
258 | 258 | * GeoDirectory dummy data installation. |
259 | 259 | * |
@@ -269,16 +269,16 @@ discard block |
||
269 | 269 | global $wpdb, $plugin_prefix; |
270 | 270 | |
271 | 271 | if (!geodir_is_default_location_set()) { |
272 | - echo '<div class="updated fade"><p><strong>' . sprintf(__('Please %sclick here%s to set a default location, this will help to set location of all dummy data.', 'geodirectory'), '<a href=\'' . admin_url('admin.php?page=geodirectory&tab=default_location_settings') . '\'>', '</a>') . '</strong></p></div>'; |
|
272 | + echo '<div class="updated fade"><p><strong>'.sprintf(__('Please %sclick here%s to set a default location, this will help to set location of all dummy data.', 'geodirectory'), '<a href=\''.admin_url('admin.php?page=geodirectory&tab=default_location_settings').'\'>', '</a>').'</strong></p></div>'; |
|
273 | 273 | } else { |
274 | 274 | |
275 | 275 | ?> |
276 | 276 | <table class="form-table gd-dummy-table"> |
277 | 277 | <tbody> |
278 | 278 | <tr> |
279 | - <td><strong><?php _e('CPT','geodirectory');?></strong></td> |
|
280 | - <td><strong><?php _e('Data Type','geodirectory');?></strong></td> |
|
281 | - <td><strong><?php _e('Action','geodirectory');?></strong></td> |
|
279 | + <td><strong><?php _e('CPT', 'geodirectory'); ?></strong></td> |
|
280 | + <td><strong><?php _e('Data Type', 'geodirectory'); ?></strong></td> |
|
281 | + <td><strong><?php _e('Action', 'geodirectory'); ?></strong></td> |
|
282 | 282 | </tr> |
283 | 283 | |
284 | 284 | <?php |
@@ -289,18 +289,18 @@ discard block |
||
289 | 289 | |
290 | 290 | $nonce = wp_create_nonce('geodir_dummy_posts_insert_noncename'); |
291 | 291 | |
292 | - foreach($cpts as $post_type=>$cpt){ |
|
292 | + foreach ($cpts as $post_type=>$cpt) { |
|
293 | 293 | |
294 | - $data_types_for = apply_filters('geodir_dummy_date_types_for',$data_types,$post_type); |
|
294 | + $data_types_for = apply_filters('geodir_dummy_date_types_for', $data_types, $post_type); |
|
295 | 295 | |
296 | 296 | |
297 | 297 | $set_dt = get_option($post_type.'_dummy_data_type'); |
298 | 298 | |
299 | 299 | $count = 30; |
300 | 300 | |
301 | - geodir_add_column_if_not_exist($plugin_prefix . $post_type. "_detail", 'post_dummy', "enum( '1', '0' ) NULL DEFAULT '0'"); |
|
301 | + geodir_add_column_if_not_exist($plugin_prefix.$post_type."_detail", 'post_dummy', "enum( '1', '0' ) NULL DEFAULT '0'"); |
|
302 | 302 | |
303 | - $post_counts = $wpdb->get_var("SELECT count(post_id) FROM " . $plugin_prefix . $post_type . "_detail WHERE post_dummy='1'"); |
|
303 | + $post_counts = $wpdb->get_var("SELECT count(post_id) FROM ".$plugin_prefix.$post_type."_detail WHERE post_dummy='1'"); |
|
304 | 304 | |
305 | 305 | echo "<tr>"; |
306 | 306 | echo "<td><strong>".$cpt['labels']['name']."</strong></td>"; |
@@ -309,9 +309,9 @@ discard block |
||
309 | 309 | $select_disabled = $post_counts > 0 ? 'disabled' : ''; |
310 | 310 | echo "<td>"; |
311 | 311 | echo "<select id='".$post_type."_data_type' onchange='geodir_dummy_set_count(this,\"$post_type\");' $select_disabled>"; |
312 | - foreach($data_types_for as $key=>$val){ |
|
313 | - $selected = ($key==$set_dt) ? "selected='selected'" : ''; |
|
314 | - if($selected){$count = $val['count'];} |
|
312 | + foreach ($data_types_for as $key=>$val) { |
|
313 | + $selected = ($key == $set_dt) ? "selected='selected'" : ''; |
|
314 | + if ($selected) {$count = $val['count']; } |
|
315 | 315 | echo "<option $selected value='$key' data-count='".$val['count']."'>".$val['name']."</option>"; |
316 | 316 | } |
317 | 317 | echo "</select>"; |
@@ -319,8 +319,8 @@ discard block |
||
319 | 319 | $select_display = $post_counts > 0 ? 'display:none;' : ''; |
320 | 320 | echo "<select id='".$post_type."_data_type_count' style='$select_display' >"; |
321 | 321 | $x = 1; |
322 | - while($x <= $count){ |
|
323 | - $selected = ($x==$count) ? "selected='selected'" : ''; |
|
322 | + while ($x <= $count) { |
|
323 | + $selected = ($x == $count) ? "selected='selected'" : ''; |
|
324 | 324 | echo "<option $selected value='$x'>".$x."</option>"; |
325 | 325 | $x++; |
326 | 326 | } |
@@ -331,10 +331,10 @@ discard block |
||
331 | 331 | |
332 | 332 | |
333 | 333 | |
334 | - if($post_counts > 0){ |
|
335 | - echo '<td><input type="button" value="'.__('Remove data','geodirectory').'" class="button-primary geodir_dummy_button gd-remove-data" onclick="gdInstallDummyData(this,\'' . $nonce . '\',\'' . $post_type . '\'); return false;" ></td>'; |
|
336 | - }else{ |
|
337 | - echo '<td><input type="button" value="'.__('Insert data','geodirectory').'" class="button-primary geodir_dummy_button" onclick="gdInstallDummyData(this,\'' . $nonce . '\',\'' . $post_type . '\'); return false;" ></td>'; |
|
334 | + if ($post_counts > 0) { |
|
335 | + echo '<td><input type="button" value="'.__('Remove data', 'geodirectory').'" class="button-primary geodir_dummy_button gd-remove-data" onclick="gdInstallDummyData(this,\''.$nonce.'\',\''.$post_type.'\'); return false;" ></td>'; |
|
336 | + } else { |
|
337 | + echo '<td><input type="button" value="'.__('Insert data', 'geodirectory').'" class="button-primary geodir_dummy_button" onclick="gdInstallDummyData(this,\''.$nonce.'\',\''.$post_type.'\'); return false;" ></td>'; |
|
338 | 338 | } |
339 | 339 | |
340 | 340 | echo "</tr>"; |
@@ -370,7 +370,7 @@ discard block |
||
370 | 370 | |
371 | 371 | } |
372 | 372 | var geocoder = window.gdMaps == 'google' ? new google.maps.Geocoder() : null; |
373 | - var CITY_ADDRESS = '<?php echo addslashes( $city . ',' . $region . ',' . $country );?>'; |
|
373 | + var CITY_ADDRESS = '<?php echo addslashes($city.','.$region.','.$country); ?>'; |
|
374 | 374 | var bound_lat_lng; |
375 | 375 | var latlng = ['<?php echo $city_latitude; ?>', <?php echo $city_longitude; ?>]; |
376 | 376 | var lat = <?php echo $city_latitude; ?>; |
@@ -400,7 +400,7 @@ discard block |
||
400 | 400 | return x.replace(" ", ''); |
401 | 401 | }); // remove spaces from lat/lon |
402 | 402 | } else { |
403 | - alert("<?php _e('Geocode was not successful for the following reason:','geodirectory');?> " + status); |
|
403 | + alert("<?php _e('Geocode was not successful for the following reason:', 'geodirectory'); ?> " + status); |
|
404 | 404 | } |
405 | 405 | }); |
406 | 406 | } else if (window.gdMaps == 'osm') { |
@@ -425,7 +425,7 @@ discard block |
||
425 | 425 | var total_dummy_post_count = jQuery('#sub_' + active_tab).find('.selected_sample_data').val(); |
426 | 426 | |
427 | 427 | if (id == 'geodir_dummy_delete') { |
428 | - if (confirm('<?php _e('Are you sure you want to delete dummy data?' , 'geodirectory'); ?>')) { |
|
428 | + if (confirm('<?php _e('Are you sure you want to delete dummy data?', 'geodirectory'); ?>')) { |
|
429 | 429 | jQuery('#sub_' + active_tab).find('.geodir_auto_install').hide(); |
430 | 430 | jQuery('#sub_' + active_tab).find('.geodir_show_progress').show(); |
431 | 431 | jQuery.post('<?php echo geodir_get_ajax_url(); ?>&geodir_autofill=' + id + '&posttype=' + posttype + '&_wpnonce=' + nonce, |
@@ -446,7 +446,7 @@ discard block |
||
446 | 446 | var post_url = '<?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; |
447 | 447 | |
448 | 448 | jQuery.post( post_url, function (data) { |
449 | - 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 + ''); |
|
449 | + 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 + ''); |
|
450 | 450 | |
451 | 451 | dummy_post_index++; |
452 | 452 | |
@@ -461,7 +461,7 @@ discard block |
||
461 | 461 | |
462 | 462 | |
463 | 463 | function gdRemoveDummyData(obj, nonce, posttype){ |
464 | - if (confirm('<?php _e('Are you sure you want to delete dummy data?' , 'geodirectory'); ?>')) { |
|
464 | + if (confirm('<?php _e('Are you sure you want to delete dummy data?', 'geodirectory'); ?>')) { |
|
465 | 465 | jQuery(obj).prop('disabled', true); |
466 | 466 | jQuery('.gd-dummy-data-results-' + posttype).remove(); |
467 | 467 | jQuery('<tr class="gd-dummy-data-results gd-dummy-data-results-' + posttype + '" >'+ |
@@ -476,14 +476,14 @@ discard block |
||
476 | 476 | |
477 | 477 | jQuery('.gd_progressbar_'+posttype).progressbar({value: 0}); |
478 | 478 | |
479 | - gd_progressbar('.gd_progressbar_container_'+posttype, 0, '<i class="fa fa-refresh fa-spin"></i><?php echo esc_attr(__('Removing data...', 'geodirlocation'));?>'); |
|
479 | + gd_progressbar('.gd_progressbar_container_'+posttype, 0, '<i class="fa fa-refresh fa-spin"></i><?php echo esc_attr(__('Removing data...', 'geodirlocation')); ?>'); |
|
480 | 480 | |
481 | 481 | |
482 | 482 | jQuery.post('<?php echo geodir_get_ajax_url(); ?>&geodir_autofill=geodir_dummy_delete&posttype=' + posttype + '&_wpnonce=' + nonce, |
483 | 483 | function (data) { |
484 | - gd_progressbar('.gd_progressbar_container_'+posttype, 100, '<i class="fa fa-check"></i><?php echo esc_attr(__('Complete!', 'geodirlocation'));?>'); |
|
484 | + gd_progressbar('.gd_progressbar_container_'+posttype, 100, '<i class="fa fa-check"></i><?php echo esc_attr(__('Complete!', 'geodirlocation')); ?>'); |
|
485 | 485 | jQuery(obj).removeClass('gd-remove-data'); |
486 | - jQuery(obj).val('<?php _e('Insert data','geodirectory');?>'); |
|
486 | + jQuery(obj).val('<?php _e('Insert data', 'geodirectory'); ?>'); |
|
487 | 487 | jQuery(obj).prop('disabled', false); |
488 | 488 | jQuery('#'+posttype+'_data_type_count').show(); |
489 | 489 | jQuery('#'+posttype+'_data_type').prop('disabled', false); |
@@ -526,7 +526,7 @@ discard block |
||
526 | 526 | |
527 | 527 | jQuery('.gd_progressbar_'+posttype).progressbar({value: 0}); |
528 | 528 | |
529 | - gd_progressbar('.gd_progressbar_container_'+posttype, 0, '0% (0 / ' + dateTypeCount + ') <i class="fa fa-refresh fa-spin"></i><?php echo esc_attr(__('Creating categories and custom fields...', 'geodirlocation'));?>'); |
|
529 | + gd_progressbar('.gd_progressbar_container_'+posttype, 0, '0% (0 / ' + dateTypeCount + ') <i class="fa fa-refresh fa-spin"></i><?php echo esc_attr(__('Creating categories and custom fields...', 'geodirlocation')); ?>'); |
|
530 | 530 | } |
531 | 531 | |
532 | 532 | if (!(typeof bound_lat_lng == 'object' && bound_lat_lng.length == 4)) { |
@@ -546,15 +546,15 @@ discard block |
||
546 | 546 | percentage = percentage > 100 ? 100 : percentage; |
547 | 547 | |
548 | 548 | |
549 | - gd_progressbar('.gd_progressbar_container_'+posttype, percentage, percentage + '% ('+insertedCount+' / ' + dateTypeCount + ') <i class="fa fa-refresh fa-spin"></i><?php echo esc_attr(__('Inserting data...', 'geodirlocation'));?>'); |
|
549 | + gd_progressbar('.gd_progressbar_container_'+posttype, percentage, percentage + '% ('+insertedCount+' / ' + dateTypeCount + ') <i class="fa fa-refresh fa-spin"></i><?php echo esc_attr(__('Inserting data...', 'geodirlocation')); ?>'); |
|
550 | 550 | |
551 | 551 | gdInstallDummyData(obj, nonce, posttype,insertedCount); |
552 | 552 | } |
553 | 553 | else { |
554 | 554 | percentage = 100; |
555 | - gd_progressbar('.gd_progressbar_container_'+posttype, percentage, percentage + '% ('+insertedCount+' / ' + dateTypeCount + ') <i class="fa fa-check"></i><?php echo esc_attr(__('Complete!', 'geodirlocation'));?>'); |
|
555 | + gd_progressbar('.gd_progressbar_container_'+posttype, percentage, percentage + '% ('+insertedCount+' / ' + dateTypeCount + ') <i class="fa fa-check"></i><?php echo esc_attr(__('Complete!', 'geodirlocation')); ?>'); |
|
556 | 556 | jQuery(obj).addClass('gd-remove-data'); |
557 | - jQuery(obj).val('<?php _e('Remove data','geodirectory');?>'); |
|
557 | + jQuery(obj).val('<?php _e('Remove data', 'geodirectory'); ?>'); |
|
558 | 558 | jQuery(obj).prop('disabled', false); |
559 | 559 | |
560 | 560 | } |
@@ -28,31 +28,31 @@ discard block |
||
28 | 28 | * @package GeoDirectory |
29 | 29 | */ |
30 | 30 | function geodir_admin_styles() { |
31 | - wp_register_style('geodirectory-admin-css', geodir_plugin_url() . '/geodirectory-assets/css/admin.css', array(), GEODIRECTORY_VERSION); |
|
31 | + wp_register_style('geodirectory-admin-css', geodir_plugin_url().'/geodirectory-assets/css/admin.css', array(), GEODIRECTORY_VERSION); |
|
32 | 32 | wp_enqueue_style('geodirectory-admin-css'); |
33 | 33 | |
34 | - wp_register_style('geodirectory-frontend-style', geodir_plugin_url() . '/geodirectory-assets/css/style.css', array(), GEODIRECTORY_VERSION); |
|
34 | + wp_register_style('geodirectory-frontend-style', geodir_plugin_url().'/geodirectory-assets/css/style.css', array(), GEODIRECTORY_VERSION); |
|
35 | 35 | wp_enqueue_style('geodirectory-frontend-style'); |
36 | 36 | |
37 | - wp_register_style('geodir-chosen-style', geodir_plugin_url() . '/geodirectory-assets/css/chosen.css', array(), GEODIRECTORY_VERSION); |
|
37 | + wp_register_style('geodir-chosen-style', geodir_plugin_url().'/geodirectory-assets/css/chosen.css', array(), GEODIRECTORY_VERSION); |
|
38 | 38 | wp_enqueue_style('geodir-chosen-style'); |
39 | 39 | |
40 | - wp_register_style('geodirectory-jquery-ui-timepicker-css', geodir_plugin_url() . '/geodirectory-assets/css/jquery.ui.timepicker.css', array(), GEODIRECTORY_VERSION); |
|
40 | + wp_register_style('geodirectory-jquery-ui-timepicker-css', geodir_plugin_url().'/geodirectory-assets/css/jquery.ui.timepicker.css', array(), GEODIRECTORY_VERSION); |
|
41 | 41 | wp_enqueue_style('geodirectory-jquery-ui-timepicker-css'); |
42 | 42 | |
43 | - wp_register_style('geodirectory-jquery-ui-css', geodir_plugin_url() . '/geodirectory-assets/css/jquery-ui.css', array(), GEODIRECTORY_VERSION); |
|
43 | + wp_register_style('geodirectory-jquery-ui-css', geodir_plugin_url().'/geodirectory-assets/css/jquery-ui.css', array(), GEODIRECTORY_VERSION); |
|
44 | 44 | wp_enqueue_style('geodirectory-jquery-ui-css'); |
45 | 45 | |
46 | - wp_register_style('geodirectory-custom-fields-css', geodir_plugin_url() . '/geodirectory-assets/css/custom_field.css', array(), GEODIRECTORY_VERSION); |
|
46 | + wp_register_style('geodirectory-custom-fields-css', geodir_plugin_url().'/geodirectory-assets/css/custom_field.css', array(), GEODIRECTORY_VERSION); |
|
47 | 47 | wp_enqueue_style('geodirectory-custom-fields-css'); |
48 | 48 | |
49 | - wp_register_style('geodirectory-pluplodar-css', geodir_plugin_url() . '/geodirectory-assets/css/pluploader.css', array(), GEODIRECTORY_VERSION); |
|
49 | + wp_register_style('geodirectory-pluplodar-css', geodir_plugin_url().'/geodirectory-assets/css/pluploader.css', array(), GEODIRECTORY_VERSION); |
|
50 | 50 | wp_enqueue_style('geodirectory-pluplodar-css'); |
51 | 51 | |
52 | - wp_register_style('geodir-rating-style', geodir_plugin_url() . '/geodirectory-assets/css/jRating.jquery.css', array(), GEODIRECTORY_VERSION); |
|
52 | + wp_register_style('geodir-rating-style', geodir_plugin_url().'/geodirectory-assets/css/jRating.jquery.css', array(), GEODIRECTORY_VERSION); |
|
53 | 53 | wp_enqueue_style('geodir-rating-style'); |
54 | 54 | |
55 | - wp_register_style('geodir-rtl-style', geodir_plugin_url() . '/geodirectory-assets/css/rtl.css', array(), GEODIRECTORY_VERSION); |
|
55 | + wp_register_style('geodir-rtl-style', geodir_plugin_url().'/geodirectory-assets/css/rtl.css', array(), GEODIRECTORY_VERSION); |
|
56 | 56 | wp_enqueue_style('geodir-rtl-style'); |
57 | 57 | } |
58 | 58 | } |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | wp_register_style('font-awesome', '//netdna.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css', array(), GEODIRECTORY_VERSION); |
71 | 71 | wp_enqueue_style('font-awesome'); |
72 | 72 | |
73 | - wp_register_script('geodirectory-admin', geodir_plugin_url() . '/geodirectory-assets/js/admin-req.min.js', array('jquery'), GEODIRECTORY_VERSION); |
|
73 | + wp_register_script('geodirectory-admin', geodir_plugin_url().'/geodirectory-assets/js/admin-req.min.js', array('jquery'), GEODIRECTORY_VERSION); |
|
74 | 74 | wp_enqueue_script('geodirectory-admin'); |
75 | 75 | |
76 | 76 | } |
@@ -89,60 +89,60 @@ discard block |
||
89 | 89 | |
90 | 90 | wp_enqueue_script('jquery'); |
91 | 91 | |
92 | - wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.ui.timepicker.js', array('jquery-ui-datepicker', 'jquery-ui-slider'), '', true); |
|
92 | + wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url().'/geodirectory-assets/js/jquery.ui.timepicker.js', array('jquery-ui-datepicker', 'jquery-ui-slider'), '', true); |
|
93 | 93 | |
94 | - wp_register_script('chosen', geodir_plugin_url() . '/geodirectory-assets/js/chosen.jquery.js', array('jquery'), GEODIRECTORY_VERSION); |
|
94 | + wp_register_script('chosen', geodir_plugin_url().'/geodirectory-assets/js/chosen.jquery.js', array('jquery'), GEODIRECTORY_VERSION); |
|
95 | 95 | wp_enqueue_script('chosen'); |
96 | 96 | |
97 | - wp_register_script('geodirectory-choose-ajax', geodir_plugin_url() . '/geodirectory-assets/js/ajax-chosen.js', array(), GEODIRECTORY_VERSION); |
|
97 | + wp_register_script('geodirectory-choose-ajax', geodir_plugin_url().'/geodirectory-assets/js/ajax-chosen.js', array(), GEODIRECTORY_VERSION); |
|
98 | 98 | wp_enqueue_script('geodirectory-choose-ajax'); |
99 | 99 | |
100 | 100 | if (isset($_REQUEST['listing_type'])) { |
101 | - wp_register_script('geodirectory-custom-fields-script', geodir_plugin_url() . '/geodirectory-assets/js/custom_fields.js', array(), GEODIRECTORY_VERSION); |
|
101 | + wp_register_script('geodirectory-custom-fields-script', geodir_plugin_url().'/geodirectory-assets/js/custom_fields.js', array(), GEODIRECTORY_VERSION); |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | wp_enqueue_script('geodirectory-custom-fields-script'); |
105 | - $plugin_path = geodir_plugin_url() . '/geodirectory-functions/cat-meta-functions'; |
|
105 | + $plugin_path = geodir_plugin_url().'/geodirectory-functions/cat-meta-functions'; |
|
106 | 106 | |
107 | - wp_enqueue_script('tax-meta-clss', $plugin_path . '/js/tax-meta-clss.js', array('jquery'), null, true); |
|
107 | + wp_enqueue_script('tax-meta-clss', $plugin_path.'/js/tax-meta-clss.js', array('jquery'), null, true); |
|
108 | 108 | |
109 | 109 | if (in_array($geodir_map_name, array('auto', 'google'))) { |
110 | - $map_lang = "&language=" . geodir_get_map_default_language(); |
|
111 | - $map_key = "&key=" . geodir_get_map_api_key(); |
|
110 | + $map_lang = "&language=".geodir_get_map_default_language(); |
|
111 | + $map_key = "&key=".geodir_get_map_api_key(); |
|
112 | 112 | /** This filter is documented in geodirectory_template_tags.php */ |
113 | 113 | $map_extra = apply_filters('geodir_googlemap_script_extra', ''); |
114 | - wp_enqueue_script('geodirectory-googlemap-script', 'https://maps.google.com/maps/api/js?' . $map_lang . $map_key . $map_extra, '', NULL); |
|
114 | + wp_enqueue_script('geodirectory-googlemap-script', 'https://maps.google.com/maps/api/js?'.$map_lang.$map_key.$map_extra, '', NULL); |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | if ($geodir_map_name == 'osm') { |
118 | 118 | // Leaflet OpenStreetMap |
119 | - wp_register_style('geodirectory-leaflet-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION); |
|
119 | + wp_register_style('geodirectory-leaflet-style', geodir_plugin_url().'/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION); |
|
120 | 120 | wp_enqueue_style('geodirectory-leaflet-style'); |
121 | 121 | |
122 | - wp_register_script('geodirectory-leaflet-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION); |
|
122 | + wp_register_script('geodirectory-leaflet-script', geodir_plugin_url().'/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION); |
|
123 | 123 | wp_enqueue_script('geodirectory-leaflet-script'); |
124 | 124 | |
125 | - wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/osm.geocode.js', array('geodirectory-leaflet-script'), GEODIRECTORY_VERSION); |
|
125 | + wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url().'/geodirectory-assets/leaflet/osm.geocode.js', array('geodirectory-leaflet-script'), GEODIRECTORY_VERSION); |
|
126 | 126 | wp_enqueue_script('geodirectory-leaflet-geo-script'); |
127 | 127 | } |
128 | - wp_enqueue_script( 'jquery-ui-autocomplete' ); |
|
128 | + wp_enqueue_script('jquery-ui-autocomplete'); |
|
129 | 129 | |
130 | - wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION,true); |
|
130 | + wp_register_script('geodirectory-goMap-script', geodir_plugin_url().'/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION, true); |
|
131 | 131 | wp_enqueue_script('geodirectory-goMap-script'); |
132 | 132 | |
133 | - wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.js', array(), GEODIRECTORY_VERSION); |
|
133 | + wp_register_script('geodirectory-goMap-script', geodir_plugin_url().'/geodirectory-assets/js/goMap.js', array(), GEODIRECTORY_VERSION); |
|
134 | 134 | wp_enqueue_script('geodirectory-goMap-script'); |
135 | 135 | |
136 | 136 | // font awesome rating script |
137 | 137 | if (get_option('geodir_reviewrating_enable_font_awesome')) { |
138 | - wp_register_script('geodir-barrating-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.barrating.min.js', array(), GEODIRECTORY_VERSION); |
|
138 | + wp_register_script('geodir-barrating-js', geodir_plugin_url().'/geodirectory-assets/js/jquery.barrating.min.js', array(), GEODIRECTORY_VERSION); |
|
139 | 139 | wp_enqueue_script('geodir-barrating-js'); |
140 | 140 | } else { // default rating script |
141 | - wp_register_script('geodir-jRating-js', geodir_plugin_url() . '/geodirectory-assets/js/jRating.jquery.js', array(), GEODIRECTORY_VERSION); |
|
141 | + wp_register_script('geodir-jRating-js', geodir_plugin_url().'/geodirectory-assets/js/jRating.jquery.js', array(), GEODIRECTORY_VERSION); |
|
142 | 142 | wp_enqueue_script('geodir-jRating-js'); |
143 | 143 | } |
144 | 144 | |
145 | - wp_register_script('geodir-on-document-load', geodir_plugin_url() . '/geodirectory-assets/js/on_document_load.min.js', array(), GEODIRECTORY_VERSION); |
|
145 | + wp_register_script('geodir-on-document-load', geodir_plugin_url().'/geodirectory-assets/js/on_document_load.min.js', array(), GEODIRECTORY_VERSION); |
|
146 | 146 | wp_enqueue_script('geodir-on-document-load'); |
147 | 147 | |
148 | 148 | |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | wp_enqueue_script('plupload-all'); |
151 | 151 | wp_enqueue_script('jquery-ui-sortable'); |
152 | 152 | |
153 | - wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.js', array(), GEODIRECTORY_VERSION); |
|
153 | + wp_register_script('geodirectory-plupload-script', geodir_plugin_url().'/geodirectory-assets/js/geodirectory-plupload.js', array(), GEODIRECTORY_VERSION); |
|
154 | 154 | wp_enqueue_script('geodirectory-plupload-script'); |
155 | 155 | |
156 | 156 | // SCRIPT FOR UPLOAD END |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | wp_localize_script('geodirectory-custom-fields-script', 'geodir_admin_ajax', $ajax_cons_data); |
205 | 205 | |
206 | 206 | |
207 | - wp_register_script('geodirectory-admin-script', geodir_plugin_url() . '/geodirectory-assets/js/admin.js', array(), GEODIRECTORY_VERSION); |
|
207 | + wp_register_script('geodirectory-admin-script', geodir_plugin_url().'/geodirectory-assets/js/admin.js', array(), GEODIRECTORY_VERSION); |
|
208 | 208 | wp_enqueue_script('geodirectory-admin-script'); |
209 | 209 | |
210 | 210 | wp_enqueue_style('farbtastic'); |
@@ -212,10 +212,10 @@ discard block |
||
212 | 212 | |
213 | 213 | $screen = get_current_screen(); |
214 | 214 | if ($screen->base == 'post' && in_array($screen->post_type, geodir_get_posttypes())) { |
215 | - wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url() . '/geodirectory-assets/js/listing_validation_admin.js'); |
|
215 | + wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url().'/geodirectory-assets/js/listing_validation_admin.js'); |
|
216 | 216 | } |
217 | 217 | |
218 | - $ajax_cons_data = array('url' => esc_url(__(get_option('siteurl') . '?geodir_ajax=true'))); |
|
218 | + $ajax_cons_data = array('url' => esc_url(__(get_option('siteurl').'?geodir_ajax=true'))); |
|
219 | 219 | wp_localize_script('geodirectory-admin-script', 'geodir_ajax', $ajax_cons_data); |
220 | 220 | |
221 | 221 | } |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | |
239 | 239 | if (current_user_can('manage_options')) $menu[] = array('', 'read', 'separator-geodirectory', '', 'wp-menu-separator geodirectory'); |
240 | 240 | |
241 | - add_menu_page(__('Geodirectory', 'geodirectory'), __('Geodirectory', 'geodirectory'), 'manage_options', 'geodirectory', 'geodir_admin_panel', geodir_plugin_url() . '/geodirectory-assets/images/favicon.ico', '55.1984'); |
|
241 | + add_menu_page(__('Geodirectory', 'geodirectory'), __('Geodirectory', 'geodirectory'), 'manage_options', 'geodirectory', 'geodir_admin_panel', geodir_plugin_url().'/geodirectory-assets/images/favicon.ico', '55.1984'); |
|
242 | 242 | |
243 | 243 | |
244 | 244 | } |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | $geodir_menu_order[] = 'separator-geodirectory'; |
273 | 273 | if (!empty($post_types)) { |
274 | 274 | foreach ($post_types as $post_type) { |
275 | - $geodir_menu_order[] = 'edit.php?post_type=' . $post_type; |
|
275 | + $geodir_menu_order[] = 'edit.php?post_type='.$post_type; |
|
276 | 276 | } |
277 | 277 | } |
278 | 278 | $geodir_menu_order[] = $item; |
@@ -315,8 +315,8 @@ discard block |
||
315 | 315 | { |
316 | 316 | if (isset($_REQUEST['installed']) && $_REQUEST['installed'] != '') { |
317 | 317 | echo '<div id="message" class="updated fade"> |
318 | - <p style="float:right;">' . __('Like Geodirectory?', 'geodirectory') . ' <a href="http://wordpress.org/extend/plugins/Geodirectory/" target="_blank">' . __('Support us by leaving a rating!', 'geodirectory') . '</a></p> |
|
319 | - <p><strong>' . __('Geodirectory has been installed and setup. Enjoy :)', 'geodirectory') . '</strong></p> |
|
318 | + <p style="float:right;">' . __('Like Geodirectory?', 'geodirectory').' <a href="http://wordpress.org/extend/plugins/Geodirectory/" target="_blank">'.__('Support us by leaving a rating!', 'geodirectory').'</a></p> |
|
319 | + <p><strong>' . __('Geodirectory has been installed and setup. Enjoy :)', 'geodirectory').'</strong></p> |
|
320 | 320 | </div>'; |
321 | 321 | |
322 | 322 | } |
@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | if (isset($_REQUEST['msg']) && $_REQUEST['msg'] != '') { |
325 | 325 | switch ($_REQUEST['msg']) { |
326 | 326 | case 'success': |
327 | - echo '<div id="message" class="updated fade"><p><strong>' . __('Your settings have been saved.', 'geodirectory') . '</strong></p></div>'; |
|
327 | + echo '<div id="message" class="updated fade"><p><strong>'.__('Your settings have been saved.', 'geodirectory').'</strong></p></div>'; |
|
328 | 328 | flush_rewrite_rules(false); |
329 | 329 | |
330 | 330 | break; |
@@ -332,30 +332,30 @@ discard block |
||
332 | 332 | $gderr = isset($_REQUEST['gderr']) ? $_REQUEST['gderr'] : ''; |
333 | 333 | |
334 | 334 | if ($gderr == 21) |
335 | - echo '<div id="message" class="error fade"><p><strong>' . __('Error: You can not add same permalinks for both Listing and Location, please try again.', 'geodirectory') . '</strong></p></div>'; |
|
335 | + echo '<div id="message" class="error fade"><p><strong>'.__('Error: You can not add same permalinks for both Listing and Location, please try again.', 'geodirectory').'</strong></p></div>'; |
|
336 | 336 | else |
337 | - echo '<div id="message" class="error fade"><p><strong>' . __('Error: Your settings have not been saved, please try again.', 'geodirectory') . '</strong></p></div>'; |
|
337 | + echo '<div id="message" class="error fade"><p><strong>'.__('Error: Your settings have not been saved, please try again.', 'geodirectory').'</strong></p></div>'; |
|
338 | 338 | break; |
339 | 339 | } |
340 | 340 | } |
341 | 341 | |
342 | 342 | $geodir_load_map = get_option('geodir_load_map'); |
343 | 343 | $need_map_key = false; |
344 | - if($geodir_load_map=='' || $geodir_load_map=='google' || $geodir_load_map=='auto' ){ |
|
344 | + if ($geodir_load_map == '' || $geodir_load_map == 'google' || $geodir_load_map == 'auto') { |
|
345 | 345 | $need_map_key = true; |
346 | 346 | } |
347 | 347 | |
348 | 348 | if (!geodir_get_map_api_key() && $need_map_key) { |
349 | - echo '<div class="error"><p><strong>' . sprintf(__('Google Maps API KEY not set, %sclick here%s to set one OR use Open Street Maps instead.', 'geodirectory'), '<a href=\'' . admin_url('admin.php?page=geodirectory&tab=design_settings&active_tab=geodir_map_settings') . '\'>', '</a>') . '</strong></p></div>'; |
|
349 | + echo '<div class="error"><p><strong>'.sprintf(__('Google Maps API KEY not set, %sclick here%s to set one OR use Open Street Maps instead.', 'geodirectory'), '<a href=\''.admin_url('admin.php?page=geodirectory&tab=design_settings&active_tab=geodir_map_settings').'\'>', '</a>').'</strong></p></div>'; |
|
350 | 350 | } |
351 | 351 | |
352 | 352 | if (!geodir_is_default_location_set()) { |
353 | - echo '<div class="updated fade"><p><strong>' . sprintf(__('Please %sclick here%s to set a default location, this will make the plugin work properly.', 'geodirectory'), '<a href=\'' . admin_url('admin.php?page=geodirectory&tab=default_location_settings') . '\'>', '</a>') . '</strong></p></div>'; |
|
353 | + echo '<div class="updated fade"><p><strong>'.sprintf(__('Please %sclick here%s to set a default location, this will make the plugin work properly.', 'geodirectory'), '<a href=\''.admin_url('admin.php?page=geodirectory&tab=default_location_settings').'\'>', '</a>').'</strong></p></div>'; |
|
354 | 354 | |
355 | 355 | } |
356 | 356 | |
357 | 357 | if (!function_exists('curl_init')) { |
358 | - echo '<div class="error"><p><strong>' . __('CURL is not installed on this server, this can cause problems, please ask your server admin to install it.', 'geodirectory') . '</strong></p></div>'; |
|
358 | + echo '<div class="error"><p><strong>'.__('CURL is not installed on this server, this can cause problems, please ask your server admin to install it.', 'geodirectory').'</strong></p></div>'; |
|
359 | 359 | |
360 | 360 | } |
361 | 361 | |
@@ -375,18 +375,18 @@ discard block |
||
375 | 375 | function geodir_handle_option_form_submit($current_tab) |
376 | 376 | { |
377 | 377 | global $geodir_settings; |
378 | - if (file_exists(dirname(__FILE__) . '/option-pages/' . $current_tab . '_array.php')) { |
|
378 | + if (file_exists(dirname(__FILE__).'/option-pages/'.$current_tab.'_array.php')) { |
|
379 | 379 | /** |
380 | 380 | * Contains settings array for current tab. |
381 | 381 | * |
382 | 382 | * @since 1.0.0 |
383 | 383 | * @package GeoDirectory |
384 | 384 | */ |
385 | - include_once('option-pages/' . $current_tab . '_array.php'); |
|
385 | + include_once('option-pages/'.$current_tab.'_array.php'); |
|
386 | 386 | } |
387 | 387 | if (isset($_POST) && $_POST && isset($_REQUEST['page']) && $_REQUEST['page'] == 'geodirectory') : |
388 | 388 | if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'geodir-settings')) die(__('Action failed. Please refresh the page and retry.', 'geodirectory')); |
389 | - if (!wp_verify_nonce($_REQUEST['_wpnonce-' . $current_tab], 'geodir-settings-' . $current_tab)) die(__('Action failed. Please refresh the page and retry.', 'geodirectory')); |
|
389 | + if (!wp_verify_nonce($_REQUEST['_wpnonce-'.$current_tab], 'geodir-settings-'.$current_tab)) die(__('Action failed. Please refresh the page and retry.', 'geodirectory')); |
|
390 | 390 | |
391 | 391 | /** |
392 | 392 | * Fires before updating geodirectory admin settings. |
@@ -419,13 +419,13 @@ discard block |
||
419 | 419 | * @param string $current_tab The current settings tab name. |
420 | 420 | * @param array $geodir_settings[$current_tab] The array of settings for the current settings tab. |
421 | 421 | */ |
422 | - do_action('geodir_update_options_' . $current_tab, $geodir_settings[$current_tab]); |
|
422 | + do_action('geodir_update_options_'.$current_tab, $geodir_settings[$current_tab]); |
|
423 | 423 | |
424 | 424 | flush_rewrite_rules(false); |
425 | 425 | |
426 | 426 | $current_tab = isset($_REQUEST['tab']) ? $_REQUEST['tab'] : ''; |
427 | 427 | |
428 | - $redirect_url = admin_url('admin.php?page=geodirectory&tab=' . $current_tab . '&active_tab=' . $_REQUEST['active_tab'] . '&msg=success'); |
|
428 | + $redirect_url = admin_url('admin.php?page=geodirectory&tab='.$current_tab.'&active_tab='.$_REQUEST['active_tab'].'&msg=success'); |
|
429 | 429 | |
430 | 430 | wp_redirect($redirect_url); |
431 | 431 | exit(); |
@@ -464,18 +464,18 @@ discard block |
||
464 | 464 | |
465 | 465 | elseif (isset($value['type']) && $value['type'] == 'image_width') : |
466 | 466 | |
467 | - if (isset($value['id']) && isset($_POST[$value['id'] . '_width'])) { |
|
468 | - update_option($value['id'] . '_width', $_POST[$value['id'] . '_width']); |
|
469 | - update_option($value['id'] . '_height', $_POST[$value['id'] . '_height']); |
|
470 | - if (isset($_POST[$value['id'] . '_crop'])) : |
|
471 | - update_option($value['id'] . '_crop', 1); |
|
467 | + if (isset($value['id']) && isset($_POST[$value['id'].'_width'])) { |
|
468 | + update_option($value['id'].'_width', $_POST[$value['id'].'_width']); |
|
469 | + update_option($value['id'].'_height', $_POST[$value['id'].'_height']); |
|
470 | + if (isset($_POST[$value['id'].'_crop'])) : |
|
471 | + update_option($value['id'].'_crop', 1); |
|
472 | 472 | else : |
473 | - update_option($value['id'] . '_crop', 0); |
|
473 | + update_option($value['id'].'_crop', 0); |
|
474 | 474 | endif; |
475 | 475 | } else { |
476 | - update_option($value['id'] . '_width', $value['std']); |
|
477 | - update_option($value['id'] . '_height', $value['std']); |
|
478 | - update_option($value['id'] . '_crop', 1); |
|
476 | + update_option($value['id'].'_width', $value['std']); |
|
477 | + update_option($value['id'].'_height', $value['std']); |
|
478 | + update_option($value['id'].'_crop', 1); |
|
479 | 479 | } |
480 | 480 | |
481 | 481 | elseif (isset($value['type']) && $value['type'] == 'map') : |
@@ -517,12 +517,12 @@ discard block |
||
517 | 517 | elseif (isset($value['type']) && $value['type'] == 'file') : |
518 | 518 | |
519 | 519 | |
520 | - if (isset($_POST[$value['id'] . '_remove']) && $_POST[$value['id'] . '_remove']) {// if remove is set then remove the file |
|
520 | + if (isset($_POST[$value['id'].'_remove']) && $_POST[$value['id'].'_remove']) {// if remove is set then remove the file |
|
521 | 521 | |
522 | 522 | if (get_option($value['id'])) { |
523 | 523 | $image_name_arr = explode('/', get_option($value['id'])); |
524 | 524 | $noimg_name = end($image_name_arr); |
525 | - $img_path = $uploads['path'] . '/' . $noimg_name; |
|
525 | + $img_path = $uploads['path'].'/'.$noimg_name; |
|
526 | 526 | if (file_exists($img_path)) |
527 | 527 | unlink($img_path); |
528 | 528 | } |
@@ -550,7 +550,7 @@ discard block |
||
550 | 550 | if (get_option($value['id'])) { |
551 | 551 | $image_name_arr = explode('/', get_option($value['id'])); |
552 | 552 | $noimg_name = end($image_name_arr); |
553 | - $img_path = $uploads['path'] . '/' . $noimg_name; |
|
553 | + $img_path = $uploads['path'].'/'.$noimg_name; |
|
554 | 554 | if (file_exists($img_path)) |
555 | 555 | unlink($img_path); |
556 | 556 | } |
@@ -571,7 +571,7 @@ discard block |
||
571 | 571 | // same menu setting per theme. |
572 | 572 | if (isset($value['id']) && $value['id'] == 'geodir_theme_location_nav' && isset($_POST[$value['id']])) { |
573 | 573 | $theme = wp_get_theme(); |
574 | - update_option('geodir_theme_location_nav_' . $theme->name, $_POST[$value['id']]); |
|
574 | + update_option('geodir_theme_location_nav_'.$theme->name, $_POST[$value['id']]); |
|
575 | 575 | } |
576 | 576 | |
577 | 577 | if (isset($value['id']) && isset($_POST[$value['id']])) { |
@@ -641,8 +641,8 @@ discard block |
||
641 | 641 | |
642 | 642 | $listing_slug = $geodir_posttype_info['labels']['singular_name']; |
643 | 643 | |
644 | - $tabs[$geodir_post_type . '_fields_settings'] = array( |
|
645 | - 'label' => __(ucfirst($listing_slug) . ' Settings', 'geodirectory'), |
|
644 | + $tabs[$geodir_post_type.'_fields_settings'] = array( |
|
645 | + 'label' => __(ucfirst($listing_slug).' Settings', 'geodirectory'), |
|
646 | 646 | 'subtabs' => array( |
647 | 647 | array('subtab' => 'custom_fields', |
648 | 648 | 'label' => __('Custom Fields', 'geodirectory'), |
@@ -675,7 +675,7 @@ discard block |
||
675 | 675 | */ |
676 | 676 | function geodir_tools_setting_tab($tabs) |
677 | 677 | { |
678 | - wp_enqueue_script( 'jquery-ui-progressbar' ); |
|
678 | + wp_enqueue_script('jquery-ui-progressbar'); |
|
679 | 679 | $tabs['tools_settings'] = array('label' => __('GD Tools', 'geodirectory')); |
680 | 680 | return $tabs; |
681 | 681 | } |
@@ -709,7 +709,7 @@ discard block |
||
709 | 709 | */ |
710 | 710 | function geodir_extend_geodirectory_setting_tab($tabs) |
711 | 711 | { |
712 | - $tabs['extend_geodirectory_settings'] = array('label' => __('Extend Geodirectory', 'geodirectory'). ' <i class="fa fa-plug"></i>', 'url' => 'https://wpgeodirectory.com', 'target' => '_blank'); |
|
712 | + $tabs['extend_geodirectory_settings'] = array('label' => __('Extend Geodirectory', 'geodirectory').' <i class="fa fa-plug"></i>', 'url' => 'https://wpgeodirectory.com', 'target' => '_blank'); |
|
713 | 713 | return $tabs; |
714 | 714 | } |
715 | 715 | |
@@ -769,8 +769,8 @@ discard block |
||
769 | 769 | _e('Unknown', 'geodirectory'); |
770 | 770 | } else { |
771 | 771 | /* If there is a city id, append 'city name' to the text string. */ |
772 | - $add_location_id = $location_id > 0 ? ' (' . $location_id . ')' : ''; |
|
773 | - echo(__($location->country, 'geodirectory') . '-' . $location->region . '-' . $location->city . $add_location_id); |
|
772 | + $add_location_id = $location_id > 0 ? ' ('.$location_id.')' : ''; |
|
773 | + echo(__($location->country, 'geodirectory').'-'.$location->region.'-'.$location->city.$add_location_id); |
|
774 | 774 | } |
775 | 775 | break; |
776 | 776 | |
@@ -788,14 +788,14 @@ discard block |
||
788 | 788 | $expire_class = 'expire_over'; |
789 | 789 | } |
790 | 790 | $date_diff = round(abs(strtotime($d1) - strtotime($d2)) / 86400); // get the difference in days |
791 | - $date_diff_text = '<br /><span class="' . $expire_class . '">(' . $date_diff . ' ' . $state . ')</span>'; |
|
791 | + $date_diff_text = '<br /><span class="'.$expire_class.'">('.$date_diff.' '.$state.')</span>'; |
|
792 | 792 | } |
793 | 793 | /* If no expire_date is found, output a default message. */ |
794 | 794 | if (empty($expire_date)) |
795 | 795 | echo __('Unknown', 'geodirectory'); |
796 | 796 | /* If there is a expire_date, append 'days left' to the text string. */ |
797 | 797 | else |
798 | - echo $expire_date . $date_diff_text; |
|
798 | + echo $expire_date.$date_diff_text; |
|
799 | 799 | break; |
800 | 800 | |
801 | 801 | /* If displaying the 'categorys' column. */ |
@@ -862,7 +862,7 @@ discard block |
||
862 | 862 | function geodir_post_information_save($post_id, $post) { |
863 | 863 | global $wpdb, $current_user; |
864 | 864 | |
865 | - if (isset($post->post_type) && ($post->post_type=='nav_menu_item' || $post->post_type=='page' || $post->post_type=='post')) { |
|
865 | + if (isset($post->post_type) && ($post->post_type == 'nav_menu_item' || $post->post_type == 'page' || $post->post_type == 'post')) { |
|
866 | 866 | return; |
867 | 867 | } |
868 | 868 | |
@@ -930,7 +930,7 @@ discard block |
||
930 | 930 | $tab_id = $value['id']; |
931 | 931 | |
932 | 932 | if (isset($value['desc']) && $value['desc']) |
933 | - $desc = '<span style=" text-transform:none;">:- ' . $value['desc'] . '</span>'; |
|
933 | + $desc = '<span style=" text-transform:none;">:- '.$value['desc'].'</span>'; |
|
934 | 934 | |
935 | 935 | if (isset($value['name']) && $value['name']) { |
936 | 936 | if ($first_title === true) { |
@@ -938,9 +938,9 @@ discard block |
||
938 | 938 | } else { |
939 | 939 | echo '</div>'; |
940 | 940 | } |
941 | - echo '<dd id="' . trim($tab_id) . '" class="geodir_option_tabs" ><a href="javascript:void(0);">' . $value['name'] . '</a></dd>'; |
|
941 | + echo '<dd id="'.trim($tab_id).'" class="geodir_option_tabs" ><a href="javascript:void(0);">'.$value['name'].'</a></dd>'; |
|
942 | 942 | |
943 | - echo '<div id="sub_' . trim($tab_id) . '" class="gd-content-heading" style=" margin-bottom:10px;" >'; |
|
943 | + echo '<div id="sub_'.trim($tab_id).'" class="gd-content-heading" style=" margin-bottom:10px;" >'; |
|
944 | 944 | } |
945 | 945 | |
946 | 946 | /** |
@@ -950,21 +950,21 @@ discard block |
||
950 | 950 | * |
951 | 951 | * @since 1.0.0 |
952 | 952 | */ |
953 | - do_action('geodir_settings_' . sanitize_title($value['id'])); |
|
953 | + do_action('geodir_settings_'.sanitize_title($value['id'])); |
|
954 | 954 | break; |
955 | 955 | |
956 | 956 | case 'no_tabs': |
957 | 957 | |
958 | 958 | echo '<div class="inner_content_tab_main">'; |
959 | - echo '<div id="sub_' . trim($tab_id) . '" class="gd-content-heading" style=" margin-bottom:10px;" >'; |
|
959 | + echo '<div id="sub_'.trim($tab_id).'" class="gd-content-heading" style=" margin-bottom:10px;" >'; |
|
960 | 960 | |
961 | 961 | break; |
962 | 962 | |
963 | 963 | case 'sectionstart': |
964 | 964 | if (isset($value['desc']) && $value['desc']) |
965 | - $desc = '<span style=" text-transform:none;"> - ' . $value['desc'] . '</span>'; |
|
965 | + $desc = '<span style=" text-transform:none;"> - '.$value['desc'].'</span>'; |
|
966 | 966 | if (isset($value['name']) && $value['name']) |
967 | - echo '<h3>' . $value['name'] . $desc . '</h3>'; |
|
967 | + echo '<h3>'.$value['name'].$desc.'</h3>'; |
|
968 | 968 | /** |
969 | 969 | * Called after a GeoDirectory settings sectionstart is output in the GD settings page. |
970 | 970 | * |
@@ -972,8 +972,8 @@ discard block |
||
972 | 972 | * |
973 | 973 | * @since 1.0.0 |
974 | 974 | */ |
975 | - if (isset($value['id']) && $value['id']) do_action('geodir_settings_' . sanitize_title($value['id']) . '_start'); |
|
976 | - echo '<table class="form-table">' . "\n\n"; |
|
975 | + if (isset($value['id']) && $value['id']) do_action('geodir_settings_'.sanitize_title($value['id']).'_start'); |
|
976 | + echo '<table class="form-table">'."\n\n"; |
|
977 | 977 | |
978 | 978 | break; |
979 | 979 | case 'sectionend': |
@@ -984,7 +984,7 @@ discard block |
||
984 | 984 | * |
985 | 985 | * @since 1.0.0 |
986 | 986 | */ |
987 | - if (isset($value['id']) && $value['id']) do_action('geodir_settings_' . sanitize_title($value['id']) . '_end'); |
|
987 | + if (isset($value['id']) && $value['id']) do_action('geodir_settings_'.sanitize_title($value['id']).'_end'); |
|
988 | 988 | echo '</table>'; |
989 | 989 | /** |
990 | 990 | * Called after a GeoDirectory settings sectionend is output in the GD settings page. |
@@ -993,7 +993,7 @@ discard block |
||
993 | 993 | * |
994 | 994 | * @since 1.0.0 |
995 | 995 | */ |
996 | - if (isset($value['id']) && $value['id']) do_action('geodir_settings_' . sanitize_title($value['id']) . '_after'); |
|
996 | + if (isset($value['id']) && $value['id']) do_action('geodir_settings_'.sanitize_title($value['id']).'_after'); |
|
997 | 997 | break; |
998 | 998 | case 'text': |
999 | 999 | ?> |
@@ -1002,7 +1002,7 @@ discard block |
||
1002 | 1002 | <td class="forminp"><input name="<?php echo esc_attr($value['id']); ?>" |
1003 | 1003 | id="<?php echo esc_attr($value['id']); ?>" |
1004 | 1004 | type="<?php echo esc_attr($value['type']); ?>" |
1005 | - <?php if(isset($value['placeholder'])){?>placeholder="<?php echo esc_attr($value['placeholder']); ?>"<?php }?> |
|
1005 | + <?php if (isset($value['placeholder'])) {?>placeholder="<?php echo esc_attr($value['placeholder']); ?>"<?php }?> |
|
1006 | 1006 | style=" <?php echo esc_attr($value['css']); ?>" |
1007 | 1007 | value="<?php if (get_option($value['id']) !== false && get_option($value['id']) !== null) { |
1008 | 1008 | echo esc_attr(stripslashes(get_option($value['id']))); |
@@ -1019,7 +1019,7 @@ discard block |
||
1019 | 1019 | <td class="forminp"><input name="<?php echo esc_attr($value['id']); ?>" |
1020 | 1020 | id="<?php echo esc_attr($value['id']); ?>" |
1021 | 1021 | type="<?php echo esc_attr($value['type']); ?>" |
1022 | - <?php if(isset($value['placeholder'])){?>placeholder="<?php echo esc_attr($value['placeholder']); ?>"<?php }?> |
|
1022 | + <?php if (isset($value['placeholder'])) {?>placeholder="<?php echo esc_attr($value['placeholder']); ?>"<?php }?> |
|
1023 | 1023 | style="<?php echo esc_attr($value['css']); ?>" |
1024 | 1024 | value="<?php if (get_option($value['id']) !== false && get_option($value['id']) !== null) { |
1025 | 1025 | echo esc_attr(stripslashes(get_option($value['id']))); |
@@ -1065,17 +1065,17 @@ discard block |
||
1065 | 1065 | <?php _e('Width', 'geodirectory'); ?> <input |
1066 | 1066 | name="<?php echo esc_attr($value['id']); ?>_width" |
1067 | 1067 | id="<?php echo esc_attr($value['id']); ?>_width" type="text" size="3" |
1068 | - value="<?php if ($size = get_option($value['id'] . '_width')) echo stripslashes($size); else echo $value['std']; ?>"/> |
|
1068 | + value="<?php if ($size = get_option($value['id'].'_width')) echo stripslashes($size); else echo $value['std']; ?>"/> |
|
1069 | 1069 | |
1070 | 1070 | <?php _e('Height', 'geodirectory'); ?> <input |
1071 | 1071 | name="<?php echo esc_attr($value['id']); ?>_height" |
1072 | 1072 | id="<?php echo esc_attr($value['id']); ?>_height" type="text" size="3" |
1073 | - value="<?php if ($size = get_option($value['id'] . '_height')) echo stripslashes($size); else echo $value['std']; ?>"/> |
|
1073 | + value="<?php if ($size = get_option($value['id'].'_height')) echo stripslashes($size); else echo $value['std']; ?>"/> |
|
1074 | 1074 | |
1075 | 1075 | <label><?php _e('Hard Crop', 'geodirectory'); ?> <input |
1076 | 1076 | name="<?php echo esc_attr($value['id']); ?>_crop" |
1077 | 1077 | id="<?php echo esc_attr($value['id']); ?>_crop" |
1078 | - type="checkbox" <?php if (get_option($value['id'] . '_crop') != '') checked(get_option($value['id'] . '_crop'), 1); else checked(1); ?> /></label> |
|
1078 | + type="checkbox" <?php if (get_option($value['id'].'_crop') != '') checked(get_option($value['id'].'_crop'), 1); else checked(1); ?> /></label> |
|
1079 | 1079 | |
1080 | 1080 | <span class="description"><?php echo $value['desc'] ?></span></td> |
1081 | 1081 | </tr><?php |
@@ -1125,7 +1125,7 @@ discard block |
||
1125 | 1125 | id="<?php echo esc_attr($value['id']); ?>" |
1126 | 1126 | style="<?php echo esc_attr($value['css']); ?>" |
1127 | 1127 | class="<?php if (isset($value['class'])) echo $value['class']; ?>" |
1128 | - data-placeholder="<?php if (isset($value['placeholder_text'])) echo $value['placeholder_text'];?>" |
|
1128 | + data-placeholder="<?php if (isset($value['placeholder_text'])) echo $value['placeholder_text']; ?>" |
|
1129 | 1129 | option-ajaxchosen="false"> |
1130 | 1130 | <?php |
1131 | 1131 | foreach ($value['options'] as $key => $val) { |
@@ -1136,7 +1136,7 @@ discard block |
||
1136 | 1136 | } else { |
1137 | 1137 | ?> |
1138 | 1138 | <option |
1139 | - value="<?php echo esc_attr($key); ?>" <?php selected(true, (is_array($option_values) && in_array($key, $option_values)));?>><?php echo ucfirst($val) ?></option> |
|
1139 | + value="<?php echo esc_attr($key); ?>" <?php selected(true, (is_array($option_values) && in_array($key, $option_values))); ?>><?php echo ucfirst($val) ?></option> |
|
1140 | 1140 | <?php |
1141 | 1141 | } |
1142 | 1142 | } |
@@ -1171,7 +1171,7 @@ discard block |
||
1171 | 1171 | ?> |
1172 | 1172 | |
1173 | 1173 | <tr valign="top"> |
1174 | - <th class="titledesc" width="40%"><?php _e('Default map language', 'geodirectory');?></th> |
|
1174 | + <th class="titledesc" width="40%"><?php _e('Default map language', 'geodirectory'); ?></th> |
|
1175 | 1175 | <td width="60%"> |
1176 | 1176 | <select name="geodir_default_map_language" style="width:60%"> |
1177 | 1177 | <?php |
@@ -1253,7 +1253,7 @@ discard block |
||
1253 | 1253 | |
1254 | 1254 | <tr valign="top"> |
1255 | 1255 | <th class="titledesc" |
1256 | - width="40%"><?php _e('Default post type search on map', 'geodirectory');?></th> |
|
1256 | + width="40%"><?php _e('Default post type search on map', 'geodirectory'); ?></th> |
|
1257 | 1257 | <td width="60%"> |
1258 | 1258 | <select name="geodir_default_map_search_pt" style="width:60%"> |
1259 | 1259 | <?php |
@@ -1294,7 +1294,7 @@ discard block |
||
1294 | 1294 | $cat_display = 'checkbox'; |
1295 | 1295 | $gd_post_types = get_option('geodir_exclude_post_type_on_map'); |
1296 | 1296 | $gd_cats = get_option('geodir_exclude_cat_on_map'); |
1297 | - $gd_cats_upgrade = (int)get_option('geodir_exclude_cat_on_map_upgrade'); |
|
1297 | + $gd_cats_upgrade = (int) get_option('geodir_exclude_cat_on_map_upgrade'); |
|
1298 | 1298 | $count = 1; |
1299 | 1299 | ?> |
1300 | 1300 | <table width="70%" class="widefat"> |
@@ -1323,7 +1323,7 @@ discard block |
||
1323 | 1323 | name="home_map_post_types[]" |
1324 | 1324 | id="<?php echo esc_attr($value['id']); ?>" |
1325 | 1325 | value="<?php echo $key; ?>" |
1326 | - class="map_post_type" <?php echo $checked;?> /> |
|
1326 | + class="map_post_type" <?php echo $checked; ?> /> |
|
1327 | 1327 | <?php echo $post_types_obj->labels->singular_name; ?></td> |
1328 | 1328 | <td width="40%"> |
1329 | 1329 | <div class="home_map_category" style="overflow:auto;width:200px;height:100px;" |
@@ -1381,12 +1381,12 @@ discard block |
||
1381 | 1381 | ?> |
1382 | 1382 | <fieldset> |
1383 | 1383 | <legend class="screen-reader-text"><span><?php echo $value['name'] ?></span></legend> |
1384 | - <label for="<?php echo $value['id'];?>"> |
|
1384 | + <label for="<?php echo $value['id']; ?>"> |
|
1385 | 1385 | <input name="<?php echo esc_attr($value['id']); ?>" |
1386 | - id="<?php echo esc_attr($value['id'] . $value['value']); ?>" type="radio" |
|
1386 | + id="<?php echo esc_attr($value['id'].$value['value']); ?>" type="radio" |
|
1387 | 1387 | value="<?php echo $value['value'] ?>" <?php if (get_option($value['id']) == $value['value']) { |
1388 | 1388 | echo 'checked="checked"'; |
1389 | - }elseif(get_option($value['id'])=='' && $value['std']==$value['value']){echo 'checked="checked"';} ?> /> |
|
1389 | + }elseif (get_option($value['id']) == '' && $value['std'] == $value['value']) {echo 'checked="checked"'; } ?> /> |
|
1390 | 1390 | <?php echo $value['desc']; ?></label><br> |
1391 | 1391 | </fieldset> |
1392 | 1392 | <?php |
@@ -1406,9 +1406,9 @@ discard block |
||
1406 | 1406 | <th scope="row" class="titledesc"><?php echo $value['name'] ?></th> |
1407 | 1407 | <td class="forminp"> |
1408 | 1408 | <textarea |
1409 | - <?php if (isset($value['args'])) echo $value['args'] . ' '; ?>name="<?php echo esc_attr($value['id']); ?>" |
|
1409 | + <?php if (isset($value['args'])) echo $value['args'].' '; ?>name="<?php echo esc_attr($value['id']); ?>" |
|
1410 | 1410 | id="<?php echo esc_attr($value['id']); ?>" |
1411 | - <?php if(isset($value['placeholder'])){?>placeholder="<?php echo esc_attr($value['placeholder']); ?>"<?php }?> |
|
1411 | + <?php if (isset($value['placeholder'])) {?>placeholder="<?php echo esc_attr($value['placeholder']); ?>"<?php }?> |
|
1412 | 1412 | 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 |
1413 | 1413 | class="description"><?php echo $value['desc'] ?></span> |
1414 | 1414 | |
@@ -1453,7 +1453,7 @@ discard block |
||
1453 | 1453 | } |
1454 | 1454 | } |
1455 | 1455 | // |
1456 | - $page_setting = (int)get_option($value['id']); |
|
1456 | + $page_setting = (int) get_option($value['id']); |
|
1457 | 1457 | |
1458 | 1458 | $args = array('name' => $value['id'], |
1459 | 1459 | 'id' => $value['id'], |
@@ -1470,7 +1470,7 @@ discard block |
||
1470 | 1470 | <tr valign="top" class="single_select_page"> |
1471 | 1471 | <th scope="row" class="titledesc"><?php echo $value['name'] ?></th> |
1472 | 1472 | <td class="forminp"> |
1473 | - <?php echo str_replace(' id=', " data-placeholder='" . __('Select a page...', 'geodirectory') . "' style='" . $value['css'] . "' class='" . $value['class'] . "' " . $disabled . " id=", wp_dropdown_pages($args)); ?> |
|
1473 | + <?php echo str_replace(' id=', " data-placeholder='".__('Select a page...', 'geodirectory')."' style='".$value['css']."' class='".$value['class']."' ".$disabled." id=", wp_dropdown_pages($args)); ?> |
|
1474 | 1474 | <span class="description"><?php echo $value['desc'] ?></span> |
1475 | 1475 | </td> |
1476 | 1476 | </tr><?php |
@@ -1479,7 +1479,7 @@ discard block |
||
1479 | 1479 | } |
1480 | 1480 | break; |
1481 | 1481 | case 'single_select_country' : |
1482 | - $country_setting = (string)get_option($value['id']); |
|
1482 | + $country_setting = (string) get_option($value['id']); |
|
1483 | 1483 | if (strstr($country_setting, ':')) : |
1484 | 1484 | $country = current(explode(':', $country_setting)); |
1485 | 1485 | $state = end(explode(':', $country_setting)); |
@@ -1502,7 +1502,7 @@ discard block |
||
1502 | 1502 | case 'multi_select_countries' : |
1503 | 1503 | $countries = $geodirectory->countries->countries; |
1504 | 1504 | asort($countries); |
1505 | - $selections = (array)get_option($value['id']); |
|
1505 | + $selections = (array) get_option($value['id']); |
|
1506 | 1506 | ?> |
1507 | 1507 | <tr valign="top"> |
1508 | 1508 | <th scope="row" class="titledesc"><?php echo $value['name'] ?></th> |
@@ -1512,7 +1512,7 @@ discard block |
||
1512 | 1512 | title="Country" class="chosen_select"> |
1513 | 1513 | <?php |
1514 | 1514 | if ($countries) foreach ($countries as $key => $val) : |
1515 | - echo '<option value="' . $key . '" ' . selected(in_array($key, $selections), true, false) . '>' . $val . '</option>'; |
|
1515 | + echo '<option value="'.$key.'" '.selected(in_array($key, $selections), true, false).'>'.$val.'</option>'; |
|
1516 | 1516 | endforeach; |
1517 | 1517 | ?> |
1518 | 1518 | </select> |
@@ -1524,7 +1524,7 @@ discard block |
||
1524 | 1524 | break; |
1525 | 1525 | |
1526 | 1526 | case 'google_analytics' : |
1527 | - $selections = (array)get_option($value['id']); |
|
1527 | + $selections = (array) get_option($value['id']); |
|
1528 | 1528 | ?> |
1529 | 1529 | <tr valign="top"> |
1530 | 1530 | <th scope="row" class="titledesc"><?php echo $value['name'] ?></th> |
@@ -1535,27 +1535,27 @@ discard block |
||
1535 | 1535 | |
1536 | 1536 | $oAuthURL = "https://accounts.google.com/o/oauth2/auth?"; |
1537 | 1537 | $scope = "scope=https://www.googleapis.com/auth/analytics.readonly"; |
1538 | - $state = "&state=123";//any string |
|
1539 | - $redirect_uri = "&redirect_uri=" . admin_url('admin-ajax.php') . "?action=geodir_ga_callback"; |
|
1538 | + $state = "&state=123"; //any string |
|
1539 | + $redirect_uri = "&redirect_uri=".admin_url('admin-ajax.php')."?action=geodir_ga_callback"; |
|
1540 | 1540 | $response_type = "&response_type=code"; |
1541 | 1541 | $client_id = "&client_id=".get_option('geodir_ga_client_id'); |
1542 | 1542 | $access_type = "&access_type=offline"; |
1543 | 1543 | $approval_prompt = "&approval_prompt=force"; |
1544 | 1544 | |
1545 | - $auth_url = $oAuthURL . $scope . $state . $redirect_uri . $response_type . $client_id . $access_type . $approval_prompt; |
|
1545 | + $auth_url = $oAuthURL.$scope.$state.$redirect_uri.$response_type.$client_id.$access_type.$approval_prompt; |
|
1546 | 1546 | |
1547 | 1547 | |
1548 | 1548 | if (get_option('geodir_ga_auth_token')) { |
1549 | 1549 | ?> |
1550 | 1550 | <span class="button-primary" |
1551 | - onclick="window.open('<?php echo geodir_ga_activation_url();?>', 'activate','width=700, height=600, menubar=0, status=0, location=0, toolbar=0')"><?php _e('Re-authorize', 'geodirectory'); ?></span> |
|
1551 | + onclick="window.open('<?php echo geodir_ga_activation_url(); ?>', 'activate','width=700, height=600, menubar=0, status=0, location=0, toolbar=0')"><?php _e('Re-authorize', 'geodirectory'); ?></span> |
|
1552 | 1552 | <span |
1553 | 1553 | style="color: green; font-weight: bold;"><?php _e('Authorized', 'geodirectory'); ?></span> |
1554 | 1554 | <?php |
1555 | 1555 | } else { |
1556 | 1556 | ?> |
1557 | 1557 | <span class="button-primary" |
1558 | - onclick="window.open('<?php echo geodir_ga_activation_url();?>', 'activate','width=700, height=600, menubar=0, status=0, location=0, toolbar=0')"><?php _e('Authorize', 'geodirectory');?></span> |
|
1558 | + onclick="window.open('<?php echo geodir_ga_activation_url(); ?>', 'activate','width=700, height=600, menubar=0, status=0, location=0, toolbar=0')"><?php _e('Authorize', 'geodirectory'); ?></span> |
|
1559 | 1559 | <?php |
1560 | 1560 | } |
1561 | 1561 | ?> |
@@ -1626,9 +1626,9 @@ discard block |
||
1626 | 1626 | |
1627 | 1627 | <?php if (isset($_REQUEST['active_tab']) && $_REQUEST['active_tab'] != '') { ?> |
1628 | 1628 | jQuery('.geodir_option_tabs').removeClass('gd-tab-active'); |
1629 | - jQuery('#<?php echo sanitize_text_field($_REQUEST['active_tab']);?>').addClass('gd-tab-active'); |
|
1629 | + jQuery('#<?php echo sanitize_text_field($_REQUEST['active_tab']); ?>').addClass('gd-tab-active'); |
|
1630 | 1630 | jQuery('.gd-content-heading').hide(); |
1631 | - jQuery('#sub_<?php echo sanitize_text_field($_REQUEST['active_tab']);?>').show(); |
|
1631 | + jQuery('#sub_<?php echo sanitize_text_field($_REQUEST['active_tab']); ?>').show(); |
|
1632 | 1632 | <?php } ?> |
1633 | 1633 | }); |
1634 | 1634 | </script> |
@@ -1714,7 +1714,7 @@ discard block |
||
1714 | 1714 | wp_nonce_field(plugin_basename(__FILE__), 'geodir_post_attachments_noncename'); |
1715 | 1715 | |
1716 | 1716 | if (geodir_get_featured_image($post_id, 'thumbnail')) { |
1717 | - echo '<h4>' . __('Featured Image', 'geodirectory') . '</h4>'; |
|
1717 | + echo '<h4>'.__('Featured Image', 'geodirectory').'</h4>'; |
|
1718 | 1718 | geodir_show_featured_image($post_id, 'thumbnail'); |
1719 | 1719 | } |
1720 | 1720 | |
@@ -1725,13 +1725,13 @@ discard block |
||
1725 | 1725 | |
1726 | 1726 | <h5 class="form_title"> |
1727 | 1727 | <?php if ($image_limit != 0 && $image_limit == 1) { |
1728 | - echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>'; |
|
1728 | + echo '<br /><small>('.__('You can upload', 'geodirectory').' '.$image_limit.' '.__('image with this package', 'geodirectory').')</small>'; |
|
1729 | 1729 | } ?> |
1730 | 1730 | <?php if ($image_limit != 0 && $image_limit > 1) { |
1731 | - echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>'; |
|
1731 | + echo '<br /><small>('.__('You can upload', 'geodirectory').' '.$image_limit.' '.__('images with this package', 'geodirectory').')</small>'; |
|
1732 | 1732 | } ?> |
1733 | 1733 | <?php if ($image_limit == 0) { |
1734 | - echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>'; |
|
1734 | + echo '<br /><small>('.__('You can upload unlimited images with this package', 'geodirectory').')</small>'; |
|
1735 | 1735 | } ?> |
1736 | 1736 | </h5> |
1737 | 1737 | |
@@ -1770,10 +1770,10 @@ discard block |
||
1770 | 1770 | <div |
1771 | 1771 | class="plupload-upload-uic hide-if-no-js <?php if ($multiple): ?>plupload-upload-uic-multiple<?php endif; ?>" |
1772 | 1772 | id="<?php echo $id; ?>plupload-upload-ui"> |
1773 | - <h4><?php _e('Drop files to upload', 'geodirectory');?></h4> |
|
1773 | + <h4><?php _e('Drop files to upload', 'geodirectory'); ?></h4> |
|
1774 | 1774 | <input id="<?php echo $id; ?>plupload-browse-button" type="button" |
1775 | 1775 | value="<?php _e('Select Files', 'geodirectory'); ?>" class="button"/> |
1776 | - <span class="ajaxnonceplu" id="ajaxnonceplu<?php echo wp_create_nonce($id . 'pluploadan'); ?>"></span> |
|
1776 | + <span class="ajaxnonceplu" id="ajaxnonceplu<?php echo wp_create_nonce($id.'pluploadan'); ?>"></span> |
|
1777 | 1777 | <?php if ($width && $height): ?> |
1778 | 1778 | <span class="plupload-resize"></span> |
1779 | 1779 | <span class="plupload-width" id="plupload-width<?php echo $width; ?>"></span> |
@@ -1785,7 +1785,7 @@ discard block |
||
1785 | 1785 | id="<?php echo $id; ?>plupload-thumbs" style="border-top:1px solid #ccc; padding-top:10px;"> |
1786 | 1786 | </div> |
1787 | 1787 | <span |
1788 | - id="upload-msg"><?php _e('Please drag & drop the images to rearrange the order', 'geodirectory');?></span> |
|
1788 | + id="upload-msg"><?php _e('Please drag & drop the images to rearrange the order', 'geodirectory'); ?></span> |
|
1789 | 1789 | <span id="<?php echo $id; ?>upload-error" style="display:none"></span> |
1790 | 1790 | </div> |
1791 | 1791 | |
@@ -1995,9 +1995,9 @@ discard block |
||
1995 | 1995 | $plugin = 'avada-nag'; |
1996 | 1996 | $timestamp = 'avada-nag1234'; |
1997 | 1997 | $message = __('Welcome to GeoDirectory, please have a look <a href="https://docs.wpgeodirectory.com/category/getting-started/" target="_blank">here</a> to get started. :)', 'geodirectory'); |
1998 | - echo '<div id="' . $timestamp . '" class="error">'; |
|
1999 | - echo '<span class="gd-remove-noti" onclick="gdRemoveANotification(\'' . $plugin . '\',\'' . $timestamp . '\');" ><i class="fa fa-times"></i></span>'; |
|
2000 | - echo "<img class='gd-icon-noti' src='" . plugin_dir_url('') . "geodirectory/geodirectory-assets/images/favicon.ico' > "; |
|
1998 | + echo '<div id="'.$timestamp.'" class="error">'; |
|
1999 | + echo '<span class="gd-remove-noti" onclick="gdRemoveANotification(\''.$plugin.'\',\''.$timestamp.'\');" ><i class="fa fa-times"></i></span>'; |
|
2000 | + echo "<img class='gd-icon-noti' src='".plugin_dir_url('')."geodirectory/geodirectory-assets/images/favicon.ico' > "; |
|
2001 | 2001 | echo "<p>$message</p>"; |
2002 | 2002 | echo "</div>"; |
2003 | 2003 | |
@@ -2130,7 +2130,7 @@ discard block |
||
2130 | 2130 | |
2131 | 2131 | // Don't allow same slug url for listing and location |
2132 | 2132 | if (geodir_strtolower($listing_prefix) == geodir_strtolower($location_prefix)) { |
2133 | - $redirect_url = admin_url('admin.php?page=geodirectory&tab=' . $current_tab . '&active_tab=' . $active_tab . '&msg=fail&gderr=21'); |
|
2133 | + $redirect_url = admin_url('admin.php?page=geodirectory&tab='.$current_tab.'&active_tab='.$active_tab.'&msg=fail&gderr=21'); |
|
2134 | 2134 | wp_redirect($redirect_url); |
2135 | 2135 | exit; |
2136 | 2136 | } |
@@ -2142,7 +2142,7 @@ discard block |
||
2142 | 2142 | $default_language = $sitepress->get_default_language(); |
2143 | 2143 | |
2144 | 2144 | if ($current_language != 'all' && $current_language != $default_language) { |
2145 | - $redirect_url = admin_url('admin.php?page=geodirectory&tab=' . $current_tab . '&active_tab=' . $active_tab); |
|
2145 | + $redirect_url = admin_url('admin.php?page=geodirectory&tab='.$current_tab.'&active_tab='.$active_tab); |
|
2146 | 2146 | wp_redirect($redirect_url); |
2147 | 2147 | exit; |
2148 | 2148 | } |
@@ -2163,11 +2163,11 @@ discard block |
||
2163 | 2163 | function geodir_hide_admin_preview_button() { |
2164 | 2164 | global $post_type; |
2165 | 2165 | $post_types = geodir_get_posttypes(); |
2166 | - if(in_array($post_type, $post_types)) |
|
2166 | + if (in_array($post_type, $post_types)) |
|
2167 | 2167 | echo '<style type="text/css">#post-preview, #view-post-btn{display: none;}</style>'; |
2168 | 2168 | } |
2169 | -add_action( 'admin_head-post-new.php', 'geodir_hide_admin_preview_button' ); |
|
2170 | -add_action( 'admin_head-post.php', 'geodir_hide_admin_preview_button' ); |
|
2169 | +add_action('admin_head-post-new.php', 'geodir_hide_admin_preview_button'); |
|
2170 | +add_action('admin_head-post.php', 'geodir_hide_admin_preview_button'); |
|
2171 | 2171 | |
2172 | 2172 | /** |
2173 | 2173 | * Add the tab in left sidebar menu fro import & export page. |
@@ -2177,8 +2177,8 @@ discard block |
||
2177 | 2177 | * |
2178 | 2178 | * @return array Array of tab data. |
2179 | 2179 | */ |
2180 | -function geodir_import_export_tab( $tabs ) { |
|
2181 | - $tabs['import_export'] = array( 'label' => __( 'Import & Export', 'geodirectory' ) ); |
|
2180 | +function geodir_import_export_tab($tabs) { |
|
2181 | + $tabs['import_export'] = array('label' => __('Import & Export', 'geodirectory')); |
|
2182 | 2182 | return $tabs; |
2183 | 2183 | } |
2184 | 2184 | |
@@ -2192,8 +2192,8 @@ discard block |
||
2192 | 2192 | * @return string Html content. |
2193 | 2193 | */ |
2194 | 2194 | function geodir_import_export_page() { |
2195 | - $nonce = wp_create_nonce( 'geodir_import_export_nonce' ); |
|
2196 | - $gd_cats_sample_csv = geodir_plugin_url() . '/geodirectory-assets/gd_sample_categories.csv'; |
|
2195 | + $nonce = wp_create_nonce('geodir_import_export_nonce'); |
|
2196 | + $gd_cats_sample_csv = geodir_plugin_url().'/geodirectory-assets/gd_sample_categories.csv'; |
|
2197 | 2197 | /** |
2198 | 2198 | * Filter sample category data csv file url. |
2199 | 2199 | * |
@@ -2202,9 +2202,9 @@ discard block |
||
2202 | 2202 | * |
2203 | 2203 | * @param string $gd_cats_sample_csv Sample category data csv file url. |
2204 | 2204 | */ |
2205 | - $gd_cats_sample_csv = apply_filters( 'geodir_export_cats_sample_csv', $gd_cats_sample_csv ); |
|
2205 | + $gd_cats_sample_csv = apply_filters('geodir_export_cats_sample_csv', $gd_cats_sample_csv); |
|
2206 | 2206 | |
2207 | - $gd_posts_sample_csv = geodir_plugin_url() . '/geodirectory-assets/place_listing.csv'; |
|
2207 | + $gd_posts_sample_csv = geodir_plugin_url().'/geodirectory-assets/place_listing.csv'; |
|
2208 | 2208 | /** |
2209 | 2209 | * Filter sample post data csv file url. |
2210 | 2210 | * |
@@ -2213,15 +2213,15 @@ discard block |
||
2213 | 2213 | * |
2214 | 2214 | * @param string $gd_posts_sample_csv Sample post data csv file url. |
2215 | 2215 | */ |
2216 | - $gd_posts_sample_csv = apply_filters( 'geodir_export_posts_sample_csv', $gd_posts_sample_csv ); |
|
2216 | + $gd_posts_sample_csv = apply_filters('geodir_export_posts_sample_csv', $gd_posts_sample_csv); |
|
2217 | 2217 | |
2218 | - $gd_posttypes = geodir_get_posttypes( 'array' ); |
|
2218 | + $gd_posttypes = geodir_get_posttypes('array'); |
|
2219 | 2219 | |
2220 | 2220 | $gd_posttypes_option = ''; |
2221 | - foreach ( $gd_posttypes as $gd_posttype => $row ) { |
|
2222 | - $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>'; |
|
2221 | + foreach ($gd_posttypes as $gd_posttype => $row) { |
|
2222 | + $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>'; |
|
2223 | 2223 | } |
2224 | - wp_enqueue_script( 'jquery-ui-progressbar' ); |
|
2224 | + wp_enqueue_script('jquery-ui-progressbar'); |
|
2225 | 2225 | |
2226 | 2226 | $gd_chunksize_options = array(); |
2227 | 2227 | $gd_chunksize_options[100] = 100; |
@@ -2243,49 +2243,49 @@ discard block |
||
2243 | 2243 | * |
2244 | 2244 | * @param string $gd_chunksize_options Entries options. |
2245 | 2245 | */ |
2246 | - $gd_chunksize_options = apply_filters( 'geodir_export_csv_chunksize_options', $gd_chunksize_options ); |
|
2246 | + $gd_chunksize_options = apply_filters('geodir_export_csv_chunksize_options', $gd_chunksize_options); |
|
2247 | 2247 | |
2248 | 2248 | $gd_chunksize_option = ''; |
2249 | 2249 | foreach ($gd_chunksize_options as $value => $title) { |
2250 | - $gd_chunksize_option .= '<option value="' . $value . '" ' . selected($value, 5000, false) . '>' . $title . '</option>'; |
|
2250 | + $gd_chunksize_option .= '<option value="'.$value.'" '.selected($value, 5000, false).'>'.$title.'</option>'; |
|
2251 | 2251 | } |
2252 | 2252 | |
2253 | 2253 | $uploads = wp_upload_dir(); |
2254 | 2254 | ?> |
2255 | 2255 | </form> |
2256 | 2256 | <div class="inner_content_tab_main gd-import-export"> |
2257 | - <h3><?php _e( 'GD Import & Export CSV', 'geodirectory' ) ;?></h3> |
|
2258 | - <span class="description"><?php _e( 'Import & export csv for GD listings & categories.', 'geodirectory' ) ;?></span> |
|
2257 | + <h3><?php _e('GD Import & Export CSV', 'geodirectory'); ?></h3> |
|
2258 | + <span class="description"><?php _e('Import & export csv for GD listings & categories.', 'geodirectory'); ?></span> |
|
2259 | 2259 | <div class="gd-content-heading"> |
2260 | 2260 | |
2261 | 2261 | <?php |
2262 | 2262 | ini_set('max_execution_time', 999999); |
2263 | - $ini_max_execution_time_check = @ini_get( 'max_execution_time' ); |
|
2263 | + $ini_max_execution_time_check = @ini_get('max_execution_time'); |
|
2264 | 2264 | ini_restore('max_execution_time'); |
2265 | 2265 | |
2266 | - if($ini_max_execution_time_check != 999999){ // only show these setting to the user if we can't change the ini setting |
|
2266 | + if ($ini_max_execution_time_check != 999999) { // only show these setting to the user if we can't change the ini setting |
|
2267 | 2267 | ?> |
2268 | 2268 | <div id="gd_ie_reqs" class="metabox-holder"> |
2269 | 2269 | <div class="meta-box-sortables ui-sortable"> |
2270 | 2270 | <div class="postbox"> |
2271 | - <h3 class="hndle"><span style='vertical-align:top;'><?php echo __( 'PHP Requirements for GD Import & Export CSV', 'geodirectory' );?></span></h3> |
|
2271 | + <h3 class="hndle"><span style='vertical-align:top;'><?php echo __('PHP Requirements for GD Import & Export CSV', 'geodirectory'); ?></span></h3> |
|
2272 | 2272 | <div class="inside"> |
2273 | - <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> |
|
2273 | + <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> |
|
2274 | 2274 | <table class="form-table"> |
2275 | 2275 | <thead> |
2276 | 2276 | <tr> |
2277 | - <th><?php _e( 'PHP Settings', 'geodirectory' );?></th><th><?php _e( 'Current Value', 'geodirectory' );?></th><th><?php _e( 'Recommended Value', 'geodirectory' );?></th> |
|
2277 | + <th><?php _e('PHP Settings', 'geodirectory'); ?></th><th><?php _e('Current Value', 'geodirectory'); ?></th><th><?php _e('Recommended Value', 'geodirectory'); ?></th> |
|
2278 | 2278 | </tr> |
2279 | 2279 | </thead> |
2280 | 2280 | <tbody> |
2281 | 2281 | <tr> |
2282 | - <td>max_input_time</td><td><?php echo @ini_get( 'max_input_time' );?></td><td>3000</td> |
|
2282 | + <td>max_input_time</td><td><?php echo @ini_get('max_input_time'); ?></td><td>3000</td> |
|
2283 | 2283 | </tr> |
2284 | 2284 | <tr> |
2285 | - <td>max_execution_time</td><td><?php echo @ini_get( 'max_execution_time' );?></td><td>3000</td> |
|
2285 | + <td>max_execution_time</td><td><?php echo @ini_get('max_execution_time'); ?></td><td>3000</td> |
|
2286 | 2286 | </tr> |
2287 | 2287 | <tr> |
2288 | - <td>memory_limit</td><td><?php echo @ini_get( 'memory_limit' );?></td><td>256M</td> |
|
2288 | + <td>memory_limit</td><td><?php echo @ini_get('memory_limit'); ?></td><td>256M</td> |
|
2289 | 2289 | </tr> |
2290 | 2290 | </tbody> |
2291 | 2291 | </table> |
@@ -2297,21 +2297,21 @@ discard block |
||
2297 | 2297 | <div id="gd_ie_imposts" class="metabox-holder"> |
2298 | 2298 | <div class="meta-box-sortables ui-sortable"> |
2299 | 2299 | <div id="gd_ie_im_posts" class="postbox gd-hndle-pbox"> |
2300 | - <button class="handlediv button-link" type="button"><span class="screen-reader-text"><?php _e( 'Toggle panel - GD Listings: Import CSV', 'geodirectory' );?></span><span aria-hidden="true" class="toggle-indicator"></span></button> |
|
2301 | - <h3 class="hndle gd-hndle-click"><span style='vertical-align:top;'><?php echo __( 'GD Listings: Import CSV', 'geodirectory' );?></span></h3> |
|
2300 | + <button class="handlediv button-link" type="button"><span class="screen-reader-text"><?php _e('Toggle panel - GD Listings: Import CSV', 'geodirectory'); ?></span><span aria-hidden="true" class="toggle-indicator"></span></button> |
|
2301 | + <h3 class="hndle gd-hndle-click"><span style='vertical-align:top;'><?php echo __('GD Listings: Import CSV', 'geodirectory'); ?></span></h3> |
|
2302 | 2302 | <div class="inside"> |
2303 | 2303 | <table class="form-table"> |
2304 | 2304 | <tbody> |
2305 | 2305 | <tr> |
2306 | 2306 | <td class="gd-imex-box"> |
2307 | 2307 | <div class="gd-im-choices"> |
2308 | - <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> |
|
2309 | - <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> |
|
2308 | + <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> |
|
2309 | + <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> |
|
2310 | 2310 | </div> |
2311 | 2311 | <div class="plupload-upload-uic hide-if-no-js" id="gd_im_postplupload-upload-ui"> |
2312 | 2312 | <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');" /> |
2313 | - <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"> |
|
2314 | - <input type="hidden" id="gd_ie_imposts_csv" value="<?php echo $gd_posts_sample_csv;?>" /> |
|
2313 | + <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"> |
|
2314 | + <input type="hidden" id="gd_ie_imposts_csv" value="<?php echo $gd_posts_sample_csv; ?>" /> |
|
2315 | 2315 | <?php |
2316 | 2316 | /** |
2317 | 2317 | * Called just after the sample CSV download link. |
@@ -2320,7 +2320,7 @@ discard block |
||
2320 | 2320 | */ |
2321 | 2321 | do_action('geodir_sample_csv_download_link'); |
2322 | 2322 | ?> |
2323 | - <span class="ajaxnonceplu" id="ajaxnonceplu<?php echo wp_create_nonce( 'gd_im_postpluploadan' ); ?>"></span> |
|
2323 | + <span class="ajaxnonceplu" id="ajaxnonceplu<?php echo wp_create_nonce('gd_im_postpluploadan'); ?>"></span> |
|
2324 | 2324 | <div class="filelist"></div> |
2325 | 2325 | </div> |
2326 | 2326 | <span id="gd_im_catupload-error" style="display:none"></span> |
@@ -2338,7 +2338,7 @@ discard block |
||
2338 | 2338 | <input type="hidden" id="gd_terminateaction" value="continue"/> |
2339 | 2339 | </div> |
2340 | 2340 | <div class="gd-import-progress" id="gd-import-progress" style="display:none"> |
2341 | - <div class="gd-import-file"><b><?php _e("Import Data Status :", 'geodirectory');?> </b><font |
|
2341 | + <div class="gd-import-file"><b><?php _e("Import Data Status :", 'geodirectory'); ?> </b><font |
|
2342 | 2342 | id="gd-import-done">0</font> / <font id="gd-import-total">0</font> ( <font |
2343 | 2343 | id="gd-import-perc">0%</font> ) |
2344 | 2344 | <div class="gd-fileprogress"></div> |
@@ -2350,10 +2350,10 @@ discard block |
||
2350 | 2350 | <div class="gd-imex-btns" style="display:none;"> |
2351 | 2351 | <input type="hidden" class="geodir_import_file" name="geodir_import_file" value="save"/> |
2352 | 2352 | <input onclick="gd_imex_PrepareImport(this, 'post')" type="button" value="<?php echo CSV_IMPORT_DATA; ?>" id="gd_import_data" class="button-primary" /> |
2353 | - <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"/> |
|
2354 | - <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')"/> |
|
2353 | + <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"/> |
|
2354 | + <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')"/> |
|
2355 | 2355 | <div id="gd_process_data" style="display:none"> |
2356 | - <span class="spinner is-active" style="display:inline-block;margin:0 5px 0 5px;float:left"></span><?php _e("Wait, processing import data...", 'geodirectory');?> |
|
2356 | + <span class="spinner is-active" style="display:inline-block;margin:0 5px 0 5px;float:left"></span><?php _e("Wait, processing import data...", 'geodirectory'); ?> |
|
2357 | 2357 | </div> |
2358 | 2358 | </div> |
2359 | 2359 | </td> |
@@ -2367,30 +2367,30 @@ discard block |
||
2367 | 2367 | <div id="gd_ie_excategs" class="metabox-holder"> |
2368 | 2368 | <div class="meta-box-sortables ui-sortable"> |
2369 | 2369 | <div id="gd_ie_ex_posts" class="postbox gd-hndle-pbox"> |
2370 | - <button class="handlediv button-link" type="button"><span class="screen-reader-text"><?php _e( 'Toggle panel - Listings: Export CSV', 'geodirectory' );?></span><span aria-hidden="true" class="toggle-indicator"></span></button> |
|
2371 | - <h3 class="hndle gd-hndle-click"><span style='vertical-align:top;'><?php echo __( 'GD Listings: Export CSV', 'geodirectory' );?></span></h3> |
|
2370 | + <button class="handlediv button-link" type="button"><span class="screen-reader-text"><?php _e('Toggle panel - Listings: Export CSV', 'geodirectory'); ?></span><span aria-hidden="true" class="toggle-indicator"></span></button> |
|
2371 | + <h3 class="hndle gd-hndle-click"><span style='vertical-align:top;'><?php echo __('GD Listings: Export CSV', 'geodirectory'); ?></span></h3> |
|
2372 | 2372 | <div class="inside"> |
2373 | 2373 | <table class="form-table"> |
2374 | 2374 | <tbody> |
2375 | 2375 | <tr> |
2376 | 2376 | <td class="fld"><label for="gd_post_type"> |
2377 | - <?php _e( 'Post Type:', 'geodirectory' );?> |
|
2377 | + <?php _e('Post Type:', 'geodirectory'); ?> |
|
2378 | 2378 | </label></td> |
2379 | 2379 | <td><select name="gd_post_type" id="gd_post_type" style="min-width:140px"> |
2380 | - <?php echo $gd_posttypes_option;?> |
|
2380 | + <?php echo $gd_posttypes_option; ?> |
|
2381 | 2381 | </select></td> |
2382 | 2382 | </tr> |
2383 | 2383 | <tr> |
2384 | - <td class="fld" style="vertical-align:top"><label for="gd_chunk_size"><?php _e( 'Max entries per csv file:', 'geodirectory' );?></label></td> |
|
2385 | - <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> |
|
2384 | + <td class="fld" style="vertical-align:top"><label for="gd_chunk_size"><?php _e('Max entries per csv file:', 'geodirectory'); ?></label></td> |
|
2385 | + <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> |
|
2386 | 2386 | </tr> |
2387 | 2387 | <tr class="gd-imex-dates"> |
2388 | - <td class="fld"><label><?php _e( 'Published Date:', 'geodirectory' );?></label></td> |
|
2389 | - <td><label><span class="label-responsive"><?php _e( 'Start date:', 'geodirectory' );?></span><input type="text" id="gd_imex_start_date" name="gd_imex[start_date]" data-type="date" /></label><label><span class="label-responsive"><?php _e( 'End date:', 'geodirectory' );?></span><input type="text" id="gd_imex_end_date" name="gd_imex[end_date]" data-type="date" /></label></td> |
|
2388 | + <td class="fld"><label><?php _e('Published Date:', 'geodirectory'); ?></label></td> |
|
2389 | + <td><label><span class="label-responsive"><?php _e('Start date:', 'geodirectory'); ?></span><input type="text" id="gd_imex_start_date" name="gd_imex[start_date]" data-type="date" /></label><label><span class="label-responsive"><?php _e('End date:', 'geodirectory'); ?></span><input type="text" id="gd_imex_end_date" name="gd_imex[end_date]" data-type="date" /></label></td> |
|
2390 | 2390 | </tr> |
2391 | 2391 | <tr> |
2392 | 2392 | <td class="fld" style="vertical-align:top"><label> |
2393 | - <?php _e( 'Progress:', 'geodirectory' );?> |
|
2393 | + <?php _e('Progress:', 'geodirectory'); ?> |
|
2394 | 2394 | </label></td> |
2395 | 2395 | <td><div id='gd_progressbar_box'> |
2396 | 2396 | <div id="gd_progressbar" class="gd_progressbar"> |
@@ -2398,13 +2398,13 @@ discard block |
||
2398 | 2398 | </div> |
2399 | 2399 | </div> |
2400 | 2400 | <p style="display:inline-block"> |
2401 | - <?php _e( 'Elapsed Time:', 'geodirectory' );?> |
|
2401 | + <?php _e('Elapsed Time:', 'geodirectory'); ?> |
|
2402 | 2402 | </p> |
2403 | 2403 | |
2404 | 2404 | <p id="gd_timer" class="gd_timer">00:00:00</p></td> |
2405 | 2405 | </tr> |
2406 | 2406 | <tr class="gd-ie-actions"> |
2407 | - <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"> |
|
2407 | + <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"> |
|
2408 | 2408 | </td> |
2409 | 2409 | <td id="gd_ie_ex_files" class="gd-ie-files"></td> |
2410 | 2410 | </tr> |
@@ -2417,21 +2417,21 @@ discard block |
||
2417 | 2417 | <div id="gd_ie_imcategs" class="metabox-holder"> |
2418 | 2418 | <div class="meta-box-sortables ui-sortable"> |
2419 | 2419 | <div id="gd_ie_imcats" class="postbox gd-hndle-pbox"> |
2420 | - <button class="handlediv button-link" type="button"><span class="screen-reader-text"><?php _e( 'Toggle panel - GD Categories: Import CSV', 'geodirectory' );?></span><span aria-hidden="true" class="toggle-indicator"></span></button> |
|
2421 | - <h3 class="hndle gd-hndle-click"><span style='vertical-align:top;'><?php echo __( 'GD Categories: Import CSV', 'geodirectory' );?></span></h3> |
|
2420 | + <button class="handlediv button-link" type="button"><span class="screen-reader-text"><?php _e('Toggle panel - GD Categories: Import CSV', 'geodirectory'); ?></span><span aria-hidden="true" class="toggle-indicator"></span></button> |
|
2421 | + <h3 class="hndle gd-hndle-click"><span style='vertical-align:top;'><?php echo __('GD Categories: Import CSV', 'geodirectory'); ?></span></h3> |
|
2422 | 2422 | <div class="inside"> |
2423 | 2423 | <table class="form-table"> |
2424 | 2424 | <tbody> |
2425 | 2425 | <tr> |
2426 | 2426 | <td class="gd-imex-box"> |
2427 | 2427 | <div class="gd-im-choices"> |
2428 | - <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> |
|
2429 | - <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> |
|
2428 | + <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> |
|
2429 | + <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> |
|
2430 | 2430 | </div> |
2431 | 2431 | <div class="plupload-upload-uic hide-if-no-js" id="gd_im_catplupload-upload-ui"> |
2432 | 2432 | <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');" /> |
2433 | - <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"> |
|
2434 | - <input type="hidden" id="gd_ie_imcats_csv" value="<?php echo $gd_cats_sample_csv;?>" /> |
|
2433 | + <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"> |
|
2434 | + <input type="hidden" id="gd_ie_imcats_csv" value="<?php echo $gd_cats_sample_csv; ?>" /> |
|
2435 | 2435 | <?php |
2436 | 2436 | /** |
2437 | 2437 | * Called just after the sample CSV download link. |
@@ -2441,7 +2441,7 @@ discard block |
||
2441 | 2441 | */ |
2442 | 2442 | do_action('geodir_sample_cats_csv_download_link'); |
2443 | 2443 | ?> |
2444 | - <span class="ajaxnonceplu" id="ajaxnonceplu<?php echo wp_create_nonce( 'gd_im_catpluploadan' ); ?>"></span> |
|
2444 | + <span class="ajaxnonceplu" id="ajaxnonceplu<?php echo wp_create_nonce('gd_im_catpluploadan'); ?>"></span> |
|
2445 | 2445 | <div class="filelist"></div> |
2446 | 2446 | </div> |
2447 | 2447 | <span id="gd_im_catupload-error" style="display:none"></span> |
@@ -2458,7 +2458,7 @@ discard block |
||
2458 | 2458 | <input type="hidden" id="gd_terminateaction" value="continue"/> |
2459 | 2459 | </div> |
2460 | 2460 | <div class="gd-import-progress" id="gd-import-progress" style="display:none"> |
2461 | - <div class="gd-import-file"><b><?php _e("Import Data Status :", 'geodirectory');?> </b><font |
|
2461 | + <div class="gd-import-file"><b><?php _e("Import Data Status :", 'geodirectory'); ?> </b><font |
|
2462 | 2462 | id="gd-import-done">0</font> / <font id="gd-import-total">0</font> ( <font |
2463 | 2463 | id="gd-import-perc">0%</font> ) |
2464 | 2464 | <div class="gd-fileprogress"></div> |
@@ -2470,10 +2470,10 @@ discard block |
||
2470 | 2470 | <div class="gd-imex-btns" style="display:none;"> |
2471 | 2471 | <input type="hidden" class="geodir_import_file" name="geodir_import_file" value="save"/> |
2472 | 2472 | <input onclick="gd_imex_PrepareImport(this, 'cat')" type="button" value="<?php echo CSV_IMPORT_DATA; ?>" id="gd_import_data" class="button-primary" /> |
2473 | - <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"/> |
|
2474 | - <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')"/> |
|
2473 | + <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"/> |
|
2474 | + <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')"/> |
|
2475 | 2475 | <div id="gd_process_data" style="display:none"> |
2476 | - <span class="spinner is-active" style="display:inline-block;margin:0 5px 0 5px;float:left"></span><?php _e("Wait, processing import data...", 'geodirectory');?> |
|
2476 | + <span class="spinner is-active" style="display:inline-block;margin:0 5px 0 5px;float:left"></span><?php _e("Wait, processing import data...", 'geodirectory'); ?> |
|
2477 | 2477 | </div> |
2478 | 2478 | </div> |
2479 | 2479 | </td> |
@@ -2487,26 +2487,26 @@ discard block |
||
2487 | 2487 | <div id="gd_ie_excategs" class="metabox-holder"> |
2488 | 2488 | <div class="meta-box-sortables ui-sortable"> |
2489 | 2489 | <div id="gd_ie_ex_cats" class="postbox gd-hndle-pbox"> |
2490 | - <button class="handlediv button-link" type="button"><span class="screen-reader-text"><?php _e( 'Toggle panel - GD Categories: Export CSV', 'geodirectory' );?></span><span aria-hidden="true" class="toggle-indicator"></span></button> |
|
2491 | - <h3 class="hndle gd-hndle-click"><span style='vertical-align:top;'><?php echo __( 'GD Categories: Export CSV', 'geodirectory' );?></span></h3> |
|
2490 | + <button class="handlediv button-link" type="button"><span class="screen-reader-text"><?php _e('Toggle panel - GD Categories: Export CSV', 'geodirectory'); ?></span><span aria-hidden="true" class="toggle-indicator"></span></button> |
|
2491 | + <h3 class="hndle gd-hndle-click"><span style='vertical-align:top;'><?php echo __('GD Categories: Export CSV', 'geodirectory'); ?></span></h3> |
|
2492 | 2492 | <div class="inside"> |
2493 | 2493 | <table class="form-table"> |
2494 | 2494 | <tbody> |
2495 | 2495 | <tr> |
2496 | - <td class="fld"><label for="gd_post_type"><?php _e( 'Post Type:', 'geodirectory' );?></label></td> |
|
2497 | - <td><select name="gd_post_type" id="gd_post_type" style="min-width:140px"><?php echo $gd_posttypes_option;?></select></td> |
|
2496 | + <td class="fld"><label for="gd_post_type"><?php _e('Post Type:', 'geodirectory'); ?></label></td> |
|
2497 | + <td><select name="gd_post_type" id="gd_post_type" style="min-width:140px"><?php echo $gd_posttypes_option; ?></select></td> |
|
2498 | 2498 | </tr> |
2499 | 2499 | <tr> |
2500 | - <td class="fld" style="vertical-align:top"><label for="gd_chunk_size"><?php _e( 'Max entries per csv file:', 'geodirectory' );?></label></td> |
|
2501 | - <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> |
|
2500 | + <td class="fld" style="vertical-align:top"><label for="gd_chunk_size"><?php _e('Max entries per csv file:', 'geodirectory'); ?></label></td> |
|
2501 | + <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> |
|
2502 | 2502 | </tr> |
2503 | 2503 | <tr> |
2504 | - <td class="fld" style="vertical-align:top"><label><?php _e( 'Progress:', 'geodirectory' );?></label></td> |
|
2505 | - <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> |
|
2504 | + <td class="fld" style="vertical-align:top"><label><?php _e('Progress:', 'geodirectory'); ?></label></td> |
|
2505 | + <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> |
|
2506 | 2506 | </tr> |
2507 | 2507 | <tr class="gd-ie-actions"> |
2508 | 2508 | <td style="vertical-align:top"> |
2509 | - <input type="submit" value="<?php echo esc_attr( __( 'Export CSV', 'geodirectory' ) );?>" class="button-primary" name="gd_ie_excats_submit" id="gd_ie_excats_submit"> |
|
2509 | + <input type="submit" value="<?php echo esc_attr(__('Export CSV', 'geodirectory')); ?>" class="button-primary" name="gd_ie_excats_submit" id="gd_ie_excats_submit"> |
|
2510 | 2510 | </td> |
2511 | 2511 | <td id="gd_ie_ex_files" class="gd-ie-files"></td> |
2512 | 2512 | </tr> |
@@ -2528,7 +2528,7 @@ discard block |
||
2528 | 2528 | * @param array $gd_chunksize_options File chunk size options. |
2529 | 2529 | * @param string $nonce Wordpress security token for GD import & export. |
2530 | 2530 | */ |
2531 | - do_action( 'geodir_import_export', $gd_posttypes, $gd_chunksize_options, $nonce ); |
|
2531 | + do_action('geodir_import_export', $gd_posttypes, $gd_chunksize_options, $nonce); |
|
2532 | 2532 | ?> |
2533 | 2533 | </div> |
2534 | 2534 | </div> |
@@ -2547,7 +2547,7 @@ discard block |
||
2547 | 2547 | jQuery.ajax({ |
2548 | 2548 | url: ajaxurl, |
2549 | 2549 | type: "POST", |
2550 | - data: 'action=geodir_import_export&task=prepare_import&_pt=' + type + '&_file=' + uploadedFile + '&_nonce=<?php echo $nonce;?>', |
|
2550 | + data: 'action=geodir_import_export&task=prepare_import&_pt=' + type + '&_file=' + uploadedFile + '&_nonce=<?php echo $nonce; ?>', |
|
2551 | 2551 | dataType: 'json', |
2552 | 2552 | cache: false, |
2553 | 2553 | success: function(data) { |
@@ -2599,7 +2599,7 @@ discard block |
||
2599 | 2599 | |
2600 | 2600 | jQuery(cont).find('.filelist .file').remove(); |
2601 | 2601 | |
2602 | - jQuery('#gd-import-msg', cont).find('#message').removeClass('updated').addClass('error').html("<p><?php echo esc_attr( PLZ_SELECT_CSV_FILE );?></p>"); |
|
2602 | + jQuery('#gd-import-msg', cont).find('#message').removeClass('updated').addClass('error').html("<p><?php echo esc_attr(PLZ_SELECT_CSV_FILE); ?></p>"); |
|
2603 | 2603 | jQuery('#gd-import-msg', cont).show(); |
2604 | 2604 | |
2605 | 2605 | return false; |
@@ -2658,7 +2658,7 @@ discard block |
||
2658 | 2658 | jQuery.ajax({ |
2659 | 2659 | url: ajaxurl, |
2660 | 2660 | type: "POST", |
2661 | - data: 'action=geodir_import_export&task=import_' + type + '&_pt=' + type + '&_file=' + uploadedFile + gddata + '&_ch=' + choice + '&_nonce=<?php echo $nonce;?>', |
|
2661 | + data: 'action=geodir_import_export&task=import_' + type + '&_pt=' + type + '&_file=' + uploadedFile + gddata + '&_ch=' + choice + '&_nonce=<?php echo $nonce; ?>', |
|
2662 | 2662 | dataType : 'json', |
2663 | 2663 | cache: false, |
2664 | 2664 | success: function (data) { |
@@ -2847,27 +2847,27 @@ discard block |
||
2847 | 2847 | |
2848 | 2848 | var gdMsg = '<p></p>'; |
2849 | 2849 | if ( processed > 0 ) { |
2850 | - var msgParse = '<p><?php echo addslashes( sprintf( __( 'Total %s item(s) found.', 'geodirectory' ), '%s' ) );?></p>'; |
|
2850 | + var msgParse = '<p><?php echo addslashes(sprintf(__('Total %s item(s) found.', 'geodirectory'), '%s')); ?></p>'; |
|
2851 | 2851 | msgParse = msgParse.replace("%s", processed); |
2852 | 2852 | gdMsg += msgParse; |
2853 | 2853 | } |
2854 | 2854 | |
2855 | 2855 | if ( updated > 0 ) { |
2856 | - var msgParse = '<p><?php echo addslashes( sprintf( __( '%s / %s item(s) updated.', 'geodirectory' ), '%s', '%d' ) );?></p>'; |
|
2856 | + var msgParse = '<p><?php echo addslashes(sprintf(__('%s / %s item(s) updated.', 'geodirectory'), '%s', '%d')); ?></p>'; |
|
2857 | 2857 | msgParse = msgParse.replace("%s", updated); |
2858 | 2858 | msgParse = msgParse.replace("%d", processed); |
2859 | 2859 | gdMsg += msgParse; |
2860 | 2860 | } |
2861 | 2861 | |
2862 | 2862 | if ( created > 0 ) { |
2863 | - var msgParse = '<p><?php echo addslashes( sprintf( __( '%s / %s item(s) added.', 'geodirectory' ), '%s', '%d' ) );?></p>'; |
|
2863 | + var msgParse = '<p><?php echo addslashes(sprintf(__('%s / %s item(s) added.', 'geodirectory'), '%s', '%d')); ?></p>'; |
|
2864 | 2864 | msgParse = msgParse.replace("%s", created); |
2865 | 2865 | msgParse = msgParse.replace("%d", processed); |
2866 | 2866 | gdMsg += msgParse; |
2867 | 2867 | } |
2868 | 2868 | |
2869 | 2869 | if ( skipped > 0 ) { |
2870 | - var msgParse = '<p><?php echo addslashes( sprintf( __( '%s / %s item(s) ignored due to already exists.', 'geodirectory' ), '%s', '%d' ) );?></p>'; |
|
2870 | + var msgParse = '<p><?php echo addslashes(sprintf(__('%s / %s item(s) ignored due to already exists.', 'geodirectory'), '%s', '%d')); ?></p>'; |
|
2871 | 2871 | msgParse = msgParse.replace("%s", skipped); |
2872 | 2872 | msgParse = msgParse.replace("%d", processed); |
2873 | 2873 | gdMsg += msgParse; |
@@ -2877,17 +2877,17 @@ discard block |
||
2877 | 2877 | if (type=='loc') { |
2878 | 2878 | invalid_addr = invalid; |
2879 | 2879 | } |
2880 | - 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>'; |
|
2880 | + 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>'; |
|
2881 | 2881 | msgParse = msgParse.replace("%s", invalid_addr); |
2882 | 2882 | msgParse = msgParse.replace("%d", total); |
2883 | 2883 | gdMsg += msgParse; |
2884 | 2884 | } |
2885 | 2885 | |
2886 | 2886 | if (invalid > 0 && type!='loc') { |
2887 | - var msgParse = '<p><?php echo addslashes( sprintf( __( '%s / %s item(s) could not be added due to blank title/invalid post type/invalid characters used in data.', 'geodirectory' ), '%s', '%d' ) );?></p>'; |
|
2887 | + var msgParse = '<p><?php echo addslashes(sprintf(__('%s / %s item(s) could not be added due to blank title/invalid post type/invalid characters used in data.', 'geodirectory'), '%s', '%d')); ?></p>'; |
|
2888 | 2888 | |
2889 | 2889 | if (type=='hood') { |
2890 | - msgParse = '<p><?php echo addslashes( sprintf( __( '%s / %s item(s) could not be added due to invalid neighbourhood data(name, latitude, longitude) or invalid location data(either location_id or city/region/country is empty)', 'geodirectory' ), '%s', '%d' ) );?></p>'; |
|
2890 | + msgParse = '<p><?php echo addslashes(sprintf(__('%s / %s item(s) could not be added due to invalid neighbourhood data(name, latitude, longitude) or invalid location data(either location_id or city/region/country is empty)', 'geodirectory'), '%s', '%d')); ?></p>'; |
|
2891 | 2891 | } |
2892 | 2892 | msgParse = msgParse.replace("%s", invalid); |
2893 | 2893 | msgParse = msgParse.replace("%d", total); |
@@ -2895,7 +2895,7 @@ discard block |
||
2895 | 2895 | } |
2896 | 2896 | |
2897 | 2897 | if (images > 0) { |
2898 | - gdMsg += '<p><?php echo addslashes( sprintf( CSV_TRANSFER_IMG_FOLDER, $uploads['subdir'] ) );?></p>'; |
|
2898 | + gdMsg += '<p><?php echo addslashes(sprintf(CSV_TRANSFER_IMG_FOLDER, $uploads['subdir'])); ?></p>'; |
|
2899 | 2899 | } |
2900 | 2900 | gdMsg += '<p></p>'; |
2901 | 2901 | jQuery('#gd-import-msg', cont).find('#message').removeClass('error').addClass('updated').html(gdMsg); |
@@ -3059,9 +3059,9 @@ discard block |
||
3059 | 3059 | if (typeof filters !== 'undefined' && filters && doFilter) { |
3060 | 3060 | getTotal = true; |
3061 | 3061 | attach += '&_c=1'; |
3062 | - gd_progressbar(el, 0, '<i class="fa fa-refresh fa-spin"></i><?php echo esc_attr( __( 'Preparing...', 'geodirectory' ) );?>'); |
|
3062 | + gd_progressbar(el, 0, '<i class="fa fa-refresh fa-spin"></i><?php echo esc_attr(__('Preparing...', 'geodirectory')); ?>'); |
|
3063 | 3063 | } else { |
3064 | - gd_progressbar(el, 0, '0% (0 / ' + total_posts + ') <i class="fa fa-refresh fa-spin"></i><?php echo esc_attr( __( 'Exporting...', 'geodirectory' ) );?>'); |
|
3064 | + gd_progressbar(el, 0, '0% (0 / ' + total_posts + ') <i class="fa fa-refresh fa-spin"></i><?php echo esc_attr(__('Exporting...', 'geodirectory')); ?>'); |
|
3065 | 3065 | } |
3066 | 3066 | jQuery(el).find('#gd_timer').text('00:00:01'); |
3067 | 3067 | jQuery('#gd_ie_ex_files', el).html(''); |
@@ -3070,7 +3070,7 @@ discard block |
||
3070 | 3070 | jQuery.ajax({ |
3071 | 3071 | url: ajaxurl, |
3072 | 3072 | type: "POST", |
3073 | - data: 'action=geodir_import_export&task=export_posts&_pt=' + post_type + '&_n=' + chunk_size + '&_nonce=<?php echo $nonce;?>&_p=' + page + attach, |
|
3073 | + data: 'action=geodir_import_export&task=export_posts&_pt=' + post_type + '&_n=' + chunk_size + '&_nonce=<?php echo $nonce; ?>&_p=' + page + attach, |
|
3074 | 3074 | dataType : 'json', |
3075 | 3075 | cache: false, |
3076 | 3076 | beforeSend: function (jqXHR, settings) {}, |
@@ -3095,11 +3095,11 @@ discard block |
||
3095 | 3095 | } else { |
3096 | 3096 | if (pages < page || pages == page) { |
3097 | 3097 | window.clearInterval(timer_posts); |
3098 | - gd_progressbar(el, 100, '100% (' + total_posts + ' / ' + total_posts + ') <i class="fa fa-check"></i><?php echo esc_attr( __( 'Complete!', 'geodirectory' ) );?>'); |
|
3098 | + gd_progressbar(el, 100, '100% (' + total_posts + ' / ' + total_posts + ') <i class="fa fa-check"></i><?php echo esc_attr(__('Complete!', 'geodirectory')); ?>'); |
|
3099 | 3099 | } else { |
3100 | 3100 | var percentage = Math.round(((page * chunk_size) / total_posts) * 100); |
3101 | 3101 | percentage = percentage > 100 ? 100 : percentage; |
3102 | - gd_progressbar(el, percentage, '' + percentage + '% (' + ( page * chunk_size ) + ' / ' + total_posts + ') <i class="fa fa-refresh fa-spin"></i><?php echo esc_attr( __( 'Exporting...', 'geodirectory' ) );?>'); |
|
3102 | + gd_progressbar(el, percentage, '' + percentage + '% (' + ( page * chunk_size ) + ' / ' + total_posts + ') <i class="fa fa-refresh fa-spin"></i><?php echo esc_attr(__('Exporting...', 'geodirectory')); ?>'); |
|
3103 | 3103 | } |
3104 | 3104 | if (typeof data.files != 'undefined' && jQuery(data.files).length ) { |
3105 | 3105 | var obj_files = data.files; |
@@ -3130,7 +3130,7 @@ discard block |
||
3130 | 3130 | |
3131 | 3131 | function gd_process_export_cats(el, post_type, total_cats, chunk_size, pages, page) { |
3132 | 3132 | if (page < 2) { |
3133 | - gd_progressbar(el, 0, '0% (0 / ' + total_cats + ') <i class="fa fa-refresh fa-spin"></i><?php echo esc_attr( __( 'Exporting...', 'geodirectory' ) );?>'); |
|
3133 | + gd_progressbar(el, 0, '0% (0 / ' + total_cats + ') <i class="fa fa-refresh fa-spin"></i><?php echo esc_attr(__('Exporting...', 'geodirectory')); ?>'); |
|
3134 | 3134 | jQuery(el).find('#gd_timer').text('00:00:01'); |
3135 | 3135 | jQuery('#gd_ie_ex_files', el).html(''); |
3136 | 3136 | } |
@@ -3138,7 +3138,7 @@ discard block |
||
3138 | 3138 | jQuery.ajax({ |
3139 | 3139 | url: ajaxurl, |
3140 | 3140 | type: "POST", |
3141 | - data: 'action=geodir_import_export&task=export_cats&_pt=' + post_type + '&_n=' + chunk_size + '&_nonce=<?php echo $nonce;?>&_p=' + page, |
|
3141 | + data: 'action=geodir_import_export&task=export_cats&_pt=' + post_type + '&_n=' + chunk_size + '&_nonce=<?php echo $nonce; ?>&_p=' + page, |
|
3142 | 3142 | dataType : 'json', |
3143 | 3143 | cache: false, |
3144 | 3144 | beforeSend: function (jqXHR, settings) {}, |
@@ -3152,11 +3152,11 @@ discard block |
||
3152 | 3152 | } else { |
3153 | 3153 | if (pages < page || pages == page) { |
3154 | 3154 | window.clearInterval(timer_cats); |
3155 | - gd_progressbar(el, 100, '100% (' + total_cats + ' / ' + total_cats + ') <i class="fa fa-check"></i><?php echo esc_attr( __( 'Complete!', 'geodirectory' ) );?>'); |
|
3155 | + gd_progressbar(el, 100, '100% (' + total_cats + ' / ' + total_cats + ') <i class="fa fa-check"></i><?php echo esc_attr(__('Complete!', 'geodirectory')); ?>'); |
|
3156 | 3156 | } else { |
3157 | 3157 | var percentage = Math.round(((page * chunk_size) / total_cats) * 100); |
3158 | 3158 | percentage = percentage > 100 ? 100 : percentage; |
3159 | - gd_progressbar(el, percentage, '' + percentage + '% (' + ( page * chunk_size ) + ' / ' + total_cats + ') <i class="fa fa-refresh fa-spin"></i><?php esc_attr_e( 'Exporting...', 'geodirectory' );?>'); |
|
3159 | + gd_progressbar(el, percentage, '' + percentage + '% (' + ( page * chunk_size ) + ' / ' + total_cats + ') <i class="fa fa-refresh fa-spin"></i><?php esc_attr_e('Exporting...', 'geodirectory'); ?>'); |
|
3160 | 3160 | } |
3161 | 3161 | if (typeof data.files != 'undefined' && jQuery(data.files).length ) { |
3162 | 3162 | var obj_files = data.files; |
@@ -3213,13 +3213,13 @@ discard block |
||
3213 | 3213 | function geodir_init_filesystem() |
3214 | 3214 | { |
3215 | 3215 | |
3216 | - if(!function_exists('get_filesystem_method')){ |
|
3216 | + if (!function_exists('get_filesystem_method')) { |
|
3217 | 3217 | require_once(ABSPATH."/wp-admin/includes/file.php"); |
3218 | 3218 | } |
3219 | 3219 | $access_type = get_filesystem_method(); |
3220 | 3220 | if ($access_type === 'direct') { |
3221 | 3221 | /* you can safely run request_filesystem_credentials() without any issues and don't need to worry about passing in a URL */ |
3222 | - $creds = request_filesystem_credentials(trailingslashit(site_url()) . 'wp-admin/', '', false, false, array()); |
|
3222 | + $creds = request_filesystem_credentials(trailingslashit(site_url()).'wp-admin/', '', false, false, array()); |
|
3223 | 3223 | |
3224 | 3224 | /* initialize the API */ |
3225 | 3225 | if (!WP_Filesystem($creds)) { |
@@ -3232,7 +3232,7 @@ discard block |
||
3232 | 3232 | return $wp_filesystem; |
3233 | 3233 | /* do our file manipulations below */ |
3234 | 3234 | } elseif (defined('FTP_USER')) { |
3235 | - $creds = request_filesystem_credentials(trailingslashit(site_url()) . 'wp-admin/', '', false, false, array()); |
|
3235 | + $creds = request_filesystem_credentials(trailingslashit(site_url()).'wp-admin/', '', false, false, array()); |
|
3236 | 3236 | |
3237 | 3237 | /* initialize the API */ |
3238 | 3238 | if (!WP_Filesystem($creds)) { |
@@ -3267,7 +3267,7 @@ discard block |
||
3267 | 3267 | * @package GeoDirectory |
3268 | 3268 | */ |
3269 | 3269 | function geodir_filesystem_notice() |
3270 | -{ if ( defined( 'DOING_AJAX' ) ){return;} |
|
3270 | +{ if (defined('DOING_AJAX')) {return; } |
|
3271 | 3271 | $access_type = get_filesystem_method(); |
3272 | 3272 | if ($access_type === 'direct') { |
3273 | 3273 | } elseif (!defined('FTP_USER')) { |
@@ -3304,64 +3304,64 @@ discard block |
||
3304 | 3304 | // try to set higher limits for import |
3305 | 3305 | $max_input_time = ini_get('max_input_time'); |
3306 | 3306 | $max_execution_time = ini_get('max_execution_time'); |
3307 | - $memory_limit= ini_get('memory_limit'); |
|
3307 | + $memory_limit = ini_get('memory_limit'); |
|
3308 | 3308 | |
3309 | - if(!$max_input_time || $max_input_time<3000){ |
|
3309 | + if (!$max_input_time || $max_input_time < 3000) { |
|
3310 | 3310 | ini_set('max_input_time', 3000); |
3311 | 3311 | } |
3312 | 3312 | |
3313 | - if(!$max_execution_time || $max_execution_time<3000){ |
|
3313 | + if (!$max_execution_time || $max_execution_time < 3000) { |
|
3314 | 3314 | ini_set('max_execution_time', 3000); |
3315 | 3315 | } |
3316 | 3316 | |
3317 | - if($memory_limit && str_replace('M','',$memory_limit)){ |
|
3318 | - if(str_replace('M','',$memory_limit)<256){ |
|
3317 | + if ($memory_limit && str_replace('M', '', $memory_limit)) { |
|
3318 | + if (str_replace('M', '', $memory_limit) < 256) { |
|
3319 | 3319 | ini_set('memory_limit', '256M'); |
3320 | 3320 | } |
3321 | 3321 | } |
3322 | 3322 | |
3323 | 3323 | $json = array(); |
3324 | 3324 | |
3325 | - if ( !current_user_can( 'manage_options' ) ) { |
|
3326 | - wp_send_json( $json ); |
|
3325 | + if (!current_user_can('manage_options')) { |
|
3326 | + wp_send_json($json); |
|
3327 | 3327 | } |
3328 | 3328 | |
3329 | - $task = isset( $_REQUEST['task'] ) ? $_REQUEST['task'] : NULL; |
|
3330 | - $nonce = isset( $_REQUEST['_nonce'] ) ? $_REQUEST['_nonce'] : NULL; |
|
3331 | - $stat = isset( $_REQUEST['_st'] ) ? $_REQUEST['_st'] : false; |
|
3329 | + $task = isset($_REQUEST['task']) ? $_REQUEST['task'] : NULL; |
|
3330 | + $nonce = isset($_REQUEST['_nonce']) ? $_REQUEST['_nonce'] : NULL; |
|
3331 | + $stat = isset($_REQUEST['_st']) ? $_REQUEST['_st'] : false; |
|
3332 | 3332 | |
3333 | - if ( !wp_verify_nonce( $nonce, 'geodir_import_export_nonce' ) ) { |
|
3334 | - wp_send_json( $json ); |
|
3333 | + if (!wp_verify_nonce($nonce, 'geodir_import_export_nonce')) { |
|
3334 | + wp_send_json($json); |
|
3335 | 3335 | } |
3336 | 3336 | |
3337 | - $post_type = isset( $_REQUEST['_pt'] ) ? $_REQUEST['_pt'] : NULL; |
|
3338 | - $chunk_per_page = isset( $_REQUEST['_n'] ) ? absint($_REQUEST['_n']) : NULL; |
|
3337 | + $post_type = isset($_REQUEST['_pt']) ? $_REQUEST['_pt'] : NULL; |
|
3338 | + $chunk_per_page = isset($_REQUEST['_n']) ? absint($_REQUEST['_n']) : NULL; |
|
3339 | 3339 | $chunk_per_page = $chunk_per_page < 50 || $chunk_per_page > 100000 ? 5000 : $chunk_per_page; |
3340 | - $chunk_page_no = isset( $_REQUEST['_p'] ) ? absint($_REQUEST['_p']) : 1; |
|
3340 | + $chunk_page_no = isset($_REQUEST['_p']) ? absint($_REQUEST['_p']) : 1; |
|
3341 | 3341 | |
3342 | 3342 | $wp_filesystem = geodir_init_filesystem(); |
3343 | 3343 | if (!$wp_filesystem) { |
3344 | - $json['error'] = __( 'Filesystem ERROR: Could not access filesystem.', 'geodirectory' ); |
|
3345 | - wp_send_json( $json ); |
|
3344 | + $json['error'] = __('Filesystem ERROR: Could not access filesystem.', 'geodirectory'); |
|
3345 | + wp_send_json($json); |
|
3346 | 3346 | } |
3347 | 3347 | |
3348 | 3348 | if (!empty($wp_filesystem) && isset($wp_filesystem->errors) && is_wp_error($wp_filesystem->errors) && $wp_filesystem->errors->get_error_code()) { |
3349 | - $json['error'] = __( 'Filesystem ERROR: ' . $wp_filesystem->errors->get_error_message(), 'geodirectory' ); |
|
3350 | - wp_send_json( $json ); |
|
3349 | + $json['error'] = __('Filesystem ERROR: '.$wp_filesystem->errors->get_error_message(), 'geodirectory'); |
|
3350 | + wp_send_json($json); |
|
3351 | 3351 | } |
3352 | 3352 | |
3353 | - $csv_file_dir = geodir_path_import_export( false ); |
|
3354 | - if ( !$wp_filesystem->is_dir( $csv_file_dir ) ) { |
|
3355 | - if ( !$wp_filesystem->mkdir( $csv_file_dir, FS_CHMOD_DIR ) ) { |
|
3356 | - $json['error'] = __( 'ERROR: Could not create cache directory. This is usually due to inconsistent file permissions.', 'geodirectory' ); |
|
3357 | - wp_send_json( $json ); |
|
3353 | + $csv_file_dir = geodir_path_import_export(false); |
|
3354 | + if (!$wp_filesystem->is_dir($csv_file_dir)) { |
|
3355 | + if (!$wp_filesystem->mkdir($csv_file_dir, FS_CHMOD_DIR)) { |
|
3356 | + $json['error'] = __('ERROR: Could not create cache directory. This is usually due to inconsistent file permissions.', 'geodirectory'); |
|
3357 | + wp_send_json($json); |
|
3358 | 3358 | } |
3359 | 3359 | } |
3360 | 3360 | |
3361 | 3361 | $location_manager = function_exists('geodir_location_plugin_activated') ? true : false; // Check location manager installed & active. |
3362 | 3362 | $neighbourhood_active = $location_manager && get_option('location_neighbourhoods') ? true : false; |
3363 | 3363 | |
3364 | - switch ( $task ) { |
|
3364 | + switch ($task) { |
|
3365 | 3365 | case 'export_posts': { |
3366 | 3366 | // WPML |
3367 | 3367 | $is_wpml = geodir_is_wpml(); |
@@ -3372,36 +3372,36 @@ discard block |
||
3372 | 3372 | $sitepress->switch_lang('all', true); |
3373 | 3373 | } |
3374 | 3374 | // WPML |
3375 | - if ( $post_type == 'gd_event' ) { |
|
3376 | - add_filter( 'geodir_imex_export_posts_query', 'geodir_imex_get_events_query', 10, 2 ); |
|
3375 | + if ($post_type == 'gd_event') { |
|
3376 | + add_filter('geodir_imex_export_posts_query', 'geodir_imex_get_events_query', 10, 2); |
|
3377 | 3377 | } |
3378 | - $filters = !empty( $_REQUEST['gd_imex'] ) && is_array( $_REQUEST['gd_imex'] ) ? $_REQUEST['gd_imex'] : NULL; |
|
3378 | + $filters = !empty($_REQUEST['gd_imex']) && is_array($_REQUEST['gd_imex']) ? $_REQUEST['gd_imex'] : NULL; |
|
3379 | 3379 | |
3380 | - $file_name = $post_type . '_' . date( 'dmyHi' ); |
|
3381 | - if ( $filters && isset( $filters['start_date'] ) && isset( $filters['end_date'] ) ) { |
|
3382 | - $file_name = $post_type . '_' . date_i18n( 'dmy', strtotime( $filters['start_date'] ) ) . '_' . date_i18n( 'dmy', strtotime( $filters['end_date'] ) ); |
|
3380 | + $file_name = $post_type.'_'.date('dmyHi'); |
|
3381 | + if ($filters && isset($filters['start_date']) && isset($filters['end_date'])) { |
|
3382 | + $file_name = $post_type.'_'.date_i18n('dmy', strtotime($filters['start_date'])).'_'.date_i18n('dmy', strtotime($filters['end_date'])); |
|
3383 | 3383 | } |
3384 | - $posts_count = geodir_get_posts_count( $post_type ); |
|
3385 | - $file_url_base = geodir_path_import_export() . '/'; |
|
3386 | - $file_url = $file_url_base . $file_name . '.csv'; |
|
3387 | - $file_path = $csv_file_dir . '/' . $file_name . '.csv'; |
|
3388 | - $file_path_temp = $csv_file_dir . '/' . $post_type . '_' . $nonce . '.csv'; |
|
3384 | + $posts_count = geodir_get_posts_count($post_type); |
|
3385 | + $file_url_base = geodir_path_import_export().'/'; |
|
3386 | + $file_url = $file_url_base.$file_name.'.csv'; |
|
3387 | + $file_path = $csv_file_dir.'/'.$file_name.'.csv'; |
|
3388 | + $file_path_temp = $csv_file_dir.'/'.$post_type.'_'.$nonce.'.csv'; |
|
3389 | 3389 | |
3390 | 3390 | $chunk_file_paths = array(); |
3391 | 3391 | |
3392 | - if ( isset( $_REQUEST['_c'] ) ) { |
|
3392 | + if (isset($_REQUEST['_c'])) { |
|
3393 | 3393 | $json['total'] = $posts_count; |
3394 | 3394 | // WPML |
3395 | 3395 | if ($is_wpml) { |
3396 | 3396 | $sitepress->switch_lang($active_lang, true); |
3397 | 3397 | } |
3398 | 3398 | // WPML |
3399 | - wp_send_json( $json ); |
|
3399 | + wp_send_json($json); |
|
3400 | 3400 | gd_die(); |
3401 | - } else if ( isset( $_REQUEST['_st'] ) ) { |
|
3402 | - $line_count = (int)geodir_import_export_line_count( $file_path_temp ); |
|
3403 | - $percentage = count( $posts_count ) > 0 && $line_count > 0 ? ceil( $line_count / $posts_count ) * 100 : 0; |
|
3404 | - $percentage = min( $percentage, 100 ); |
|
3401 | + } else if (isset($_REQUEST['_st'])) { |
|
3402 | + $line_count = (int) geodir_import_export_line_count($file_path_temp); |
|
3403 | + $percentage = count($posts_count) > 0 && $line_count > 0 ? ceil($line_count / $posts_count) * 100 : 0; |
|
3404 | + $percentage = min($percentage, 100); |
|
3405 | 3405 | |
3406 | 3406 | $json['percentage'] = $percentage; |
3407 | 3407 | // WPML |
@@ -3409,45 +3409,45 @@ discard block |
||
3409 | 3409 | $sitepress->switch_lang($active_lang, true); |
3410 | 3410 | } |
3411 | 3411 | // WPML |
3412 | - wp_send_json( $json ); |
|
3412 | + wp_send_json($json); |
|
3413 | 3413 | gd_die(); |
3414 | 3414 | } else { |
3415 | - if ( !$posts_count > 0 ) { |
|
3416 | - $json['error'] = __( 'No records to export.', 'geodirectory' ); |
|
3415 | + if (!$posts_count > 0) { |
|
3416 | + $json['error'] = __('No records to export.', 'geodirectory'); |
|
3417 | 3417 | } else { |
3418 | 3418 | $total_posts = $posts_count; |
3419 | 3419 | if ($chunk_per_page > $total_posts) { |
3420 | 3420 | $chunk_per_page = $total_posts; |
3421 | 3421 | } |
3422 | - $chunk_total_pages = ceil( $total_posts / $chunk_per_page ); |
|
3422 | + $chunk_total_pages = ceil($total_posts / $chunk_per_page); |
|
3423 | 3423 | |
3424 | 3424 | $j = $chunk_page_no; |
3425 | - $chunk_save_posts = geodir_imex_get_posts( $post_type, $chunk_per_page, $j ); |
|
3425 | + $chunk_save_posts = geodir_imex_get_posts($post_type, $chunk_per_page, $j); |
|
3426 | 3426 | |
3427 | 3427 | $per_page = 500; |
3428 | 3428 | if ($per_page > $chunk_per_page) { |
3429 | 3429 | $per_page = $chunk_per_page; |
3430 | 3430 | } |
3431 | - $total_pages = ceil( $chunk_per_page / $per_page ); |
|
3431 | + $total_pages = ceil($chunk_per_page / $per_page); |
|
3432 | 3432 | |
3433 | - for ( $i = 0; $i <= $total_pages; $i++ ) { |
|
3434 | - $save_posts = array_slice( $chunk_save_posts , ( $i * $per_page ), $per_page ); |
|
3433 | + for ($i = 0; $i <= $total_pages; $i++) { |
|
3434 | + $save_posts = array_slice($chunk_save_posts, ($i * $per_page), $per_page); |
|
3435 | 3435 | |
3436 | 3436 | $clear = $i == 0 ? true : false; |
3437 | - geodir_save_csv_data( $file_path_temp, $save_posts, $clear ); |
|
3437 | + geodir_save_csv_data($file_path_temp, $save_posts, $clear); |
|
3438 | 3438 | } |
3439 | 3439 | |
3440 | - if ( $wp_filesystem->exists( $file_path_temp ) ) { |
|
3441 | - $chunk_page_no = $chunk_total_pages > 1 ? '-' . $j : ''; |
|
3442 | - $chunk_file_name = $file_name . $chunk_page_no . '.csv'; |
|
3443 | - $file_path = $csv_file_dir . '/' . $chunk_file_name; |
|
3444 | - $wp_filesystem->move( $file_path_temp, $file_path, true ); |
|
3440 | + if ($wp_filesystem->exists($file_path_temp)) { |
|
3441 | + $chunk_page_no = $chunk_total_pages > 1 ? '-'.$j : ''; |
|
3442 | + $chunk_file_name = $file_name.$chunk_page_no.'.csv'; |
|
3443 | + $file_path = $csv_file_dir.'/'.$chunk_file_name; |
|
3444 | + $wp_filesystem->move($file_path_temp, $file_path, true); |
|
3445 | 3445 | |
3446 | - $file_url = $file_url_base . $chunk_file_name; |
|
3447 | - $chunk_file_paths[] = array('i' => $j . '.', 'u' => $file_url, 's' => size_format(filesize($file_path), 2)); |
|
3446 | + $file_url = $file_url_base.$chunk_file_name; |
|
3447 | + $chunk_file_paths[] = array('i' => $j.'.', 'u' => $file_url, 's' => size_format(filesize($file_path), 2)); |
|
3448 | 3448 | } |
3449 | 3449 | |
3450 | - if ( !empty($chunk_file_paths) ) { |
|
3450 | + if (!empty($chunk_file_paths)) { |
|
3451 | 3451 | $json['total'] = $posts_count; |
3452 | 3452 | $json['files'] = $chunk_file_paths; |
3453 | 3453 | } else { |
@@ -3455,7 +3455,7 @@ discard block |
||
3455 | 3455 | $json['total'] = $posts_count; |
3456 | 3456 | $json['files'] = array(); |
3457 | 3457 | } else { |
3458 | - $json['error'] = __( 'ERROR: Could not create csv file. This is usually due to inconsistent file permissions.', 'geodirectory' ); |
|
3458 | + $json['error'] = __('ERROR: Could not create csv file. This is usually due to inconsistent file permissions.', 'geodirectory'); |
|
3459 | 3459 | } |
3460 | 3460 | } |
3461 | 3461 | } |
@@ -3464,7 +3464,7 @@ discard block |
||
3464 | 3464 | $sitepress->switch_lang($active_lang, true); |
3465 | 3465 | } |
3466 | 3466 | // WPML |
3467 | - wp_send_json( $json ); |
|
3467 | + wp_send_json($json); |
|
3468 | 3468 | } |
3469 | 3469 | } |
3470 | 3470 | break; |
@@ -3478,20 +3478,20 @@ discard block |
||
3478 | 3478 | $sitepress->switch_lang('all', true); |
3479 | 3479 | } |
3480 | 3480 | // WPML |
3481 | - $file_name = $post_type . 'category_' . date( 'dmyHi' ); |
|
3481 | + $file_name = $post_type.'category_'.date('dmyHi'); |
|
3482 | 3482 | |
3483 | - $terms_count = geodir_get_terms_count( $post_type ); |
|
3484 | - $file_url_base = geodir_path_import_export() . '/'; |
|
3485 | - $file_url = $file_url_base . $file_name . '.csv'; |
|
3486 | - $file_path = $csv_file_dir . '/' . $file_name . '.csv'; |
|
3487 | - $file_path_temp = $csv_file_dir . '/' . $post_type . 'category_' . $nonce . '.csv'; |
|
3483 | + $terms_count = geodir_get_terms_count($post_type); |
|
3484 | + $file_url_base = geodir_path_import_export().'/'; |
|
3485 | + $file_url = $file_url_base.$file_name.'.csv'; |
|
3486 | + $file_path = $csv_file_dir.'/'.$file_name.'.csv'; |
|
3487 | + $file_path_temp = $csv_file_dir.'/'.$post_type.'category_'.$nonce.'.csv'; |
|
3488 | 3488 | |
3489 | 3489 | $chunk_file_paths = array(); |
3490 | 3490 | |
3491 | - if ( isset( $_REQUEST['_st'] ) ) { |
|
3492 | - $line_count = (int)geodir_import_export_line_count( $file_path_temp ); |
|
3493 | - $percentage = count( $terms_count ) > 0 && $line_count > 0 ? ceil( $line_count / $terms_count ) * 100 : 0; |
|
3494 | - $percentage = min( $percentage, 100 ); |
|
3491 | + if (isset($_REQUEST['_st'])) { |
|
3492 | + $line_count = (int) geodir_import_export_line_count($file_path_temp); |
|
3493 | + $percentage = count($terms_count) > 0 && $line_count > 0 ? ceil($line_count / $terms_count) * 100 : 0; |
|
3494 | + $percentage = min($percentage, 100); |
|
3495 | 3495 | |
3496 | 3496 | $json['percentage'] = $percentage; |
3497 | 3497 | // WPML |
@@ -3499,48 +3499,48 @@ discard block |
||
3499 | 3499 | $sitepress->switch_lang($active_lang, true); |
3500 | 3500 | } |
3501 | 3501 | // WPML |
3502 | - wp_send_json( $json ); |
|
3502 | + wp_send_json($json); |
|
3503 | 3503 | } else { |
3504 | - if ( !$terms_count > 0 ) { |
|
3505 | - $json['error'] = __( 'No records to export.', 'geodirectory' ); |
|
3504 | + if (!$terms_count > 0) { |
|
3505 | + $json['error'] = __('No records to export.', 'geodirectory'); |
|
3506 | 3506 | } else { |
3507 | 3507 | $total_terms = $terms_count; |
3508 | 3508 | if ($chunk_per_page > $terms_count) { |
3509 | 3509 | $chunk_per_page = $terms_count; |
3510 | 3510 | } |
3511 | - $chunk_total_pages = ceil( $total_terms / $chunk_per_page ); |
|
3511 | + $chunk_total_pages = ceil($total_terms / $chunk_per_page); |
|
3512 | 3512 | |
3513 | 3513 | $j = $chunk_page_no; |
3514 | - $chunk_save_terms = geodir_imex_get_terms( $post_type, $chunk_per_page, $j ); |
|
3514 | + $chunk_save_terms = geodir_imex_get_terms($post_type, $chunk_per_page, $j); |
|
3515 | 3515 | |
3516 | 3516 | $per_page = 500; |
3517 | 3517 | if ($per_page > $chunk_per_page) { |
3518 | 3518 | $per_page = $chunk_per_page; |
3519 | 3519 | } |
3520 | - $total_pages = ceil( $chunk_per_page / $per_page ); |
|
3520 | + $total_pages = ceil($chunk_per_page / $per_page); |
|
3521 | 3521 | |
3522 | - for ( $i = 0; $i <= $total_pages; $i++ ) { |
|
3523 | - $save_terms = array_slice( $chunk_save_terms , ( $i * $per_page ), $per_page ); |
|
3522 | + for ($i = 0; $i <= $total_pages; $i++) { |
|
3523 | + $save_terms = array_slice($chunk_save_terms, ($i * $per_page), $per_page); |
|
3524 | 3524 | |
3525 | 3525 | $clear = $i == 0 ? true : false; |
3526 | - geodir_save_csv_data( $file_path_temp, $save_terms, $clear ); |
|
3526 | + geodir_save_csv_data($file_path_temp, $save_terms, $clear); |
|
3527 | 3527 | } |
3528 | 3528 | |
3529 | - if ( $wp_filesystem->exists( $file_path_temp ) ) { |
|
3530 | - $chunk_page_no = $chunk_total_pages > 1 ? '-' . $j : ''; |
|
3531 | - $chunk_file_name = $file_name . $chunk_page_no . '.csv'; |
|
3532 | - $file_path = $csv_file_dir . '/' . $chunk_file_name; |
|
3533 | - $wp_filesystem->move( $file_path_temp, $file_path, true ); |
|
3529 | + if ($wp_filesystem->exists($file_path_temp)) { |
|
3530 | + $chunk_page_no = $chunk_total_pages > 1 ? '-'.$j : ''; |
|
3531 | + $chunk_file_name = $file_name.$chunk_page_no.'.csv'; |
|
3532 | + $file_path = $csv_file_dir.'/'.$chunk_file_name; |
|
3533 | + $wp_filesystem->move($file_path_temp, $file_path, true); |
|
3534 | 3534 | |
3535 | - $file_url = $file_url_base . $chunk_file_name; |
|
3536 | - $chunk_file_paths[] = array('i' => $j . '.', 'u' => $file_url, 's' => size_format(filesize($file_path), 2)); |
|
3535 | + $file_url = $file_url_base.$chunk_file_name; |
|
3536 | + $chunk_file_paths[] = array('i' => $j.'.', 'u' => $file_url, 's' => size_format(filesize($file_path), 2)); |
|
3537 | 3537 | } |
3538 | 3538 | |
3539 | - if ( !empty($chunk_file_paths) ) { |
|
3539 | + if (!empty($chunk_file_paths)) { |
|
3540 | 3540 | $json['total'] = $terms_count; |
3541 | 3541 | $json['files'] = $chunk_file_paths; |
3542 | 3542 | } else { |
3543 | - $json['error'] = __( 'ERROR: Could not create csv file. This is usually due to inconsistent file permissions.', 'geodirectory' ); |
|
3543 | + $json['error'] = __('ERROR: Could not create csv file. This is usually due to inconsistent file permissions.', 'geodirectory'); |
|
3544 | 3544 | } |
3545 | 3545 | } |
3546 | 3546 | // WPML |
@@ -3548,127 +3548,127 @@ discard block |
||
3548 | 3548 | $sitepress->switch_lang($active_lang, true); |
3549 | 3549 | } |
3550 | 3550 | // WPML |
3551 | - wp_send_json( $json ); |
|
3551 | + wp_send_json($json); |
|
3552 | 3552 | } |
3553 | 3553 | } |
3554 | 3554 | break; |
3555 | 3555 | case 'export_locations': { |
3556 | - $file_url_base = geodir_path_import_export() . '/'; |
|
3557 | - $file_name = 'gd_locations_' . date( 'dmyHi' ); |
|
3558 | - $file_url = $file_url_base . $file_name . '.csv'; |
|
3559 | - $file_path = $csv_file_dir . '/' . $file_name . '.csv'; |
|
3560 | - $file_path_temp = $csv_file_dir . '/gd_locations_' . $nonce . '.csv'; |
|
3556 | + $file_url_base = geodir_path_import_export().'/'; |
|
3557 | + $file_name = 'gd_locations_'.date('dmyHi'); |
|
3558 | + $file_url = $file_url_base.$file_name.'.csv'; |
|
3559 | + $file_path = $csv_file_dir.'/'.$file_name.'.csv'; |
|
3560 | + $file_path_temp = $csv_file_dir.'/gd_locations_'.$nonce.'.csv'; |
|
3561 | 3561 | |
3562 | - $items_count = (int)geodir_location_imex_count_locations(); |
|
3562 | + $items_count = (int) geodir_location_imex_count_locations(); |
|
3563 | 3563 | |
3564 | - if ( isset( $_REQUEST['_st'] ) ) { |
|
3565 | - $line_count = (int)geodir_import_export_line_count( $file_path_temp ); |
|
3566 | - $percentage = count( $items_count ) > 0 && $line_count > 0 ? ceil( $line_count / $items_count ) * 100 : 0; |
|
3567 | - $percentage = min( $percentage, 100 ); |
|
3564 | + if (isset($_REQUEST['_st'])) { |
|
3565 | + $line_count = (int) geodir_import_export_line_count($file_path_temp); |
|
3566 | + $percentage = count($items_count) > 0 && $line_count > 0 ? ceil($line_count / $items_count) * 100 : 0; |
|
3567 | + $percentage = min($percentage, 100); |
|
3568 | 3568 | |
3569 | 3569 | $json['percentage'] = $percentage; |
3570 | - wp_send_json( $json ); |
|
3570 | + wp_send_json($json); |
|
3571 | 3571 | } else { |
3572 | 3572 | $chunk_file_paths = array(); |
3573 | 3573 | |
3574 | - if ( !$items_count > 0 ) { |
|
3575 | - $json['error'] = __( 'No records to export.', 'geodirectory' ); |
|
3574 | + if (!$items_count > 0) { |
|
3575 | + $json['error'] = __('No records to export.', 'geodirectory'); |
|
3576 | 3576 | } else { |
3577 | - $chunk_per_page = min( $chunk_per_page, $items_count ); |
|
3578 | - $chunk_total_pages = ceil( $items_count / $chunk_per_page ); |
|
3577 | + $chunk_per_page = min($chunk_per_page, $items_count); |
|
3578 | + $chunk_total_pages = ceil($items_count / $chunk_per_page); |
|
3579 | 3579 | |
3580 | 3580 | $j = $chunk_page_no; |
3581 | - $chunk_save_items = geodir_location_imex_locations_data( $chunk_per_page, $j ); |
|
3581 | + $chunk_save_items = geodir_location_imex_locations_data($chunk_per_page, $j); |
|
3582 | 3582 | |
3583 | 3583 | $per_page = 500; |
3584 | - $per_page = min( $per_page, $chunk_per_page ); |
|
3585 | - $total_pages = ceil( $chunk_per_page / $per_page ); |
|
3584 | + $per_page = min($per_page, $chunk_per_page); |
|
3585 | + $total_pages = ceil($chunk_per_page / $per_page); |
|
3586 | 3586 | |
3587 | - for ( $i = 0; $i <= $total_pages; $i++ ) { |
|
3588 | - $save_items = array_slice( $chunk_save_items , ( $i * $per_page ), $per_page ); |
|
3587 | + for ($i = 0; $i <= $total_pages; $i++) { |
|
3588 | + $save_items = array_slice($chunk_save_items, ($i * $per_page), $per_page); |
|
3589 | 3589 | |
3590 | 3590 | $clear = $i == 0 ? true : false; |
3591 | - geodir_save_csv_data( $file_path_temp, $save_items, $clear ); |
|
3591 | + geodir_save_csv_data($file_path_temp, $save_items, $clear); |
|
3592 | 3592 | } |
3593 | 3593 | |
3594 | - if ( $wp_filesystem->exists( $file_path_temp ) ) { |
|
3595 | - $chunk_page_no = $chunk_total_pages > 1 ? '-' . $j : ''; |
|
3596 | - $chunk_file_name = $file_name . $chunk_page_no . '.csv'; |
|
3597 | - $file_path = $csv_file_dir . '/' . $chunk_file_name; |
|
3598 | - $wp_filesystem->move( $file_path_temp, $file_path, true ); |
|
3594 | + if ($wp_filesystem->exists($file_path_temp)) { |
|
3595 | + $chunk_page_no = $chunk_total_pages > 1 ? '-'.$j : ''; |
|
3596 | + $chunk_file_name = $file_name.$chunk_page_no.'.csv'; |
|
3597 | + $file_path = $csv_file_dir.'/'.$chunk_file_name; |
|
3598 | + $wp_filesystem->move($file_path_temp, $file_path, true); |
|
3599 | 3599 | |
3600 | - $file_url = $file_url_base . $chunk_file_name; |
|
3601 | - $chunk_file_paths[] = array('i' => $j . '.', 'u' => $file_url, 's' => size_format(filesize($file_path), 2)); |
|
3600 | + $file_url = $file_url_base.$chunk_file_name; |
|
3601 | + $chunk_file_paths[] = array('i' => $j.'.', 'u' => $file_url, 's' => size_format(filesize($file_path), 2)); |
|
3602 | 3602 | } |
3603 | 3603 | |
3604 | - if ( !empty($chunk_file_paths) ) { |
|
3604 | + if (!empty($chunk_file_paths)) { |
|
3605 | 3605 | $json['total'] = $items_count; |
3606 | 3606 | $json['files'] = $chunk_file_paths; |
3607 | 3607 | } else { |
3608 | - $json['error'] = __( 'Fail, something wrong to create csv file.', 'geodirectory' ); |
|
3608 | + $json['error'] = __('Fail, something wrong to create csv file.', 'geodirectory'); |
|
3609 | 3609 | } |
3610 | 3610 | } |
3611 | - wp_send_json( $json ); |
|
3611 | + wp_send_json($json); |
|
3612 | 3612 | } |
3613 | 3613 | } |
3614 | 3614 | break; |
3615 | 3615 | case 'export_hoods': { |
3616 | - $file_url_base = geodir_path_import_export() . '/'; |
|
3617 | - $file_name = 'gd_neighbourhoods_' . date( 'dmyHi' ); |
|
3618 | - $file_url = $file_url_base . $file_name . '.csv'; |
|
3619 | - $file_path = $csv_file_dir . '/' . $file_name . '.csv'; |
|
3620 | - $file_path_temp = $csv_file_dir . '/gd_neighbourhoods_' . $nonce . '.csv'; |
|
3616 | + $file_url_base = geodir_path_import_export().'/'; |
|
3617 | + $file_name = 'gd_neighbourhoods_'.date('dmyHi'); |
|
3618 | + $file_url = $file_url_base.$file_name.'.csv'; |
|
3619 | + $file_path = $csv_file_dir.'/'.$file_name.'.csv'; |
|
3620 | + $file_path_temp = $csv_file_dir.'/gd_neighbourhoods_'.$nonce.'.csv'; |
|
3621 | 3621 | |
3622 | - $items_count = (int)geodir_location_imex_count_neighbourhoods(); |
|
3622 | + $items_count = (int) geodir_location_imex_count_neighbourhoods(); |
|
3623 | 3623 | |
3624 | - if ( isset( $_REQUEST['_st'] ) ) { |
|
3625 | - $line_count = (int)geodir_import_export_line_count( $file_path_temp ); |
|
3626 | - $percentage = count( $items_count ) > 0 && $line_count > 0 ? ceil( $line_count / $items_count ) * 100 : 0; |
|
3627 | - $percentage = min( $percentage, 100 ); |
|
3624 | + if (isset($_REQUEST['_st'])) { |
|
3625 | + $line_count = (int) geodir_import_export_line_count($file_path_temp); |
|
3626 | + $percentage = count($items_count) > 0 && $line_count > 0 ? ceil($line_count / $items_count) * 100 : 0; |
|
3627 | + $percentage = min($percentage, 100); |
|
3628 | 3628 | |
3629 | 3629 | $json['percentage'] = $percentage; |
3630 | - wp_send_json( $json ); |
|
3630 | + wp_send_json($json); |
|
3631 | 3631 | } else { |
3632 | 3632 | $chunk_file_paths = array(); |
3633 | 3633 | |
3634 | - if ( !$items_count > 0 ) { |
|
3635 | - $json['error'] = __( 'No records to export.', 'geodirectory' ); |
|
3634 | + if (!$items_count > 0) { |
|
3635 | + $json['error'] = __('No records to export.', 'geodirectory'); |
|
3636 | 3636 | } else { |
3637 | - $chunk_per_page = min( $chunk_per_page, $items_count ); |
|
3638 | - $chunk_total_pages = ceil( $items_count / $chunk_per_page ); |
|
3637 | + $chunk_per_page = min($chunk_per_page, $items_count); |
|
3638 | + $chunk_total_pages = ceil($items_count / $chunk_per_page); |
|
3639 | 3639 | |
3640 | 3640 | $j = $chunk_page_no; |
3641 | - $chunk_save_items = geodir_location_imex_neighbourhoods_data( $chunk_per_page, $j ); |
|
3641 | + $chunk_save_items = geodir_location_imex_neighbourhoods_data($chunk_per_page, $j); |
|
3642 | 3642 | |
3643 | 3643 | $per_page = 500; |
3644 | - $per_page = min( $per_page, $chunk_per_page ); |
|
3645 | - $total_pages = ceil( $chunk_per_page / $per_page ); |
|
3644 | + $per_page = min($per_page, $chunk_per_page); |
|
3645 | + $total_pages = ceil($chunk_per_page / $per_page); |
|
3646 | 3646 | |
3647 | - for ( $i = 0; $i <= $total_pages; $i++ ) { |
|
3648 | - $save_items = array_slice( $chunk_save_items , ( $i * $per_page ), $per_page ); |
|
3647 | + for ($i = 0; $i <= $total_pages; $i++) { |
|
3648 | + $save_items = array_slice($chunk_save_items, ($i * $per_page), $per_page); |
|
3649 | 3649 | |
3650 | 3650 | $clear = $i == 0 ? true : false; |
3651 | - geodir_save_csv_data( $file_path_temp, $save_items, $clear ); |
|
3651 | + geodir_save_csv_data($file_path_temp, $save_items, $clear); |
|
3652 | 3652 | } |
3653 | 3653 | |
3654 | - if ( $wp_filesystem->exists( $file_path_temp ) ) { |
|
3655 | - $chunk_page_no = $chunk_total_pages > 1 ? '-' . $j : ''; |
|
3656 | - $chunk_file_name = $file_name . $chunk_page_no . '.csv'; |
|
3657 | - $file_path = $csv_file_dir . '/' . $chunk_file_name; |
|
3658 | - $wp_filesystem->move( $file_path_temp, $file_path, true ); |
|
3654 | + if ($wp_filesystem->exists($file_path_temp)) { |
|
3655 | + $chunk_page_no = $chunk_total_pages > 1 ? '-'.$j : ''; |
|
3656 | + $chunk_file_name = $file_name.$chunk_page_no.'.csv'; |
|
3657 | + $file_path = $csv_file_dir.'/'.$chunk_file_name; |
|
3658 | + $wp_filesystem->move($file_path_temp, $file_path, true); |
|
3659 | 3659 | |
3660 | - $file_url = $file_url_base . $chunk_file_name; |
|
3661 | - $chunk_file_paths[] = array('i' => $j . '.', 'u' => $file_url, 's' => size_format(filesize($file_path), 2)); |
|
3660 | + $file_url = $file_url_base.$chunk_file_name; |
|
3661 | + $chunk_file_paths[] = array('i' => $j.'.', 'u' => $file_url, 's' => size_format(filesize($file_path), 2)); |
|
3662 | 3662 | } |
3663 | 3663 | |
3664 | - if ( !empty($chunk_file_paths) ) { |
|
3664 | + if (!empty($chunk_file_paths)) { |
|
3665 | 3665 | $json['total'] = $items_count; |
3666 | 3666 | $json['files'] = $chunk_file_paths; |
3667 | 3667 | } else { |
3668 | - $json['error'] = __( 'Fail, something wrong to create csv file.', 'geodirectory' ); |
|
3668 | + $json['error'] = __('Fail, something wrong to create csv file.', 'geodirectory'); |
|
3669 | 3669 | } |
3670 | 3670 | } |
3671 | - wp_send_json( $json ); |
|
3671 | + wp_send_json($json); |
|
3672 | 3672 | } |
3673 | 3673 | } |
3674 | 3674 | break; |
@@ -3685,25 +3685,25 @@ discard block |
||
3685 | 3685 | } |
3686 | 3686 | // WPML |
3687 | 3687 | |
3688 | - ini_set( 'auto_detect_line_endings', true ); |
|
3688 | + ini_set('auto_detect_line_endings', true); |
|
3689 | 3689 | |
3690 | 3690 | $uploads = wp_upload_dir(); |
3691 | 3691 | $uploads_dir = $uploads['path']; |
3692 | 3692 | $uploads_subdir = $uploads['subdir']; |
3693 | 3693 | |
3694 | - $csv_file = isset( $_POST['_file'] ) ? $_POST['_file'] : NULL; |
|
3695 | - $import_choice = isset( $_REQUEST['_ch'] ) ? $_REQUEST['_ch'] : 'skip'; |
|
3694 | + $csv_file = isset($_POST['_file']) ? $_POST['_file'] : NULL; |
|
3695 | + $import_choice = isset($_REQUEST['_ch']) ? $_REQUEST['_ch'] : 'skip'; |
|
3696 | 3696 | |
3697 | - $csv_file_arr = explode( '/', $csv_file ); |
|
3698 | - $csv_filename = end( $csv_file_arr ); |
|
3699 | - $target_path = $uploads_dir . '/temp_' . $current_user->data->ID . '/' . $csv_filename; |
|
3697 | + $csv_file_arr = explode('/', $csv_file); |
|
3698 | + $csv_filename = end($csv_file_arr); |
|
3699 | + $target_path = $uploads_dir.'/temp_'.$current_user->data->ID.'/'.$csv_filename; |
|
3700 | 3700 | |
3701 | 3701 | $json['file'] = $csv_file; |
3702 | - $json['error'] = __( 'The uploaded file is not a valid csv file. Please try again.', 'geodirectory' ); |
|
3702 | + $json['error'] = __('The uploaded file is not a valid csv file. Please try again.', 'geodirectory'); |
|
3703 | 3703 | $file = array(); |
3704 | 3704 | |
3705 | - if ( $csv_file && $wp_filesystem->is_file( $target_path ) && $wp_filesystem->exists( $target_path ) ) { |
|
3706 | - $wp_filetype = wp_check_filetype_and_ext( $target_path, $csv_filename ); |
|
3705 | + if ($csv_file && $wp_filesystem->is_file($target_path) && $wp_filesystem->exists($target_path)) { |
|
3706 | + $wp_filetype = wp_check_filetype_and_ext($target_path, $csv_filename); |
|
3707 | 3707 | |
3708 | 3708 | if (!empty($wp_filetype) && isset($wp_filetype['ext']) && geodir_strtolower($wp_filetype['ext']) == 'csv') { |
3709 | 3709 | $json['error'] = NULL; |
@@ -3711,9 +3711,9 @@ discard block |
||
3711 | 3711 | |
3712 | 3712 | $lc_all = setlocale(LC_ALL, 0); // Fix issue of fgetcsv ignores special characters when they are at the beginning of line |
3713 | 3713 | setlocale(LC_ALL, 'en_US.UTF-8'); |
3714 | - if ( ( $handle = fopen($target_path, "r" ) ) !== FALSE ) { |
|
3715 | - while ( ( $data = fgetcsv( $handle, 100000, "," ) ) !== FALSE ) { |
|
3716 | - if ( !empty( $data ) ) { |
|
3714 | + if (($handle = fopen($target_path, "r")) !== FALSE) { |
|
3715 | + while (($data = fgetcsv($handle, 100000, ",")) !== FALSE) { |
|
3716 | + if (!empty($data)) { |
|
3717 | 3717 | $file[] = $data; |
3718 | 3718 | } |
3719 | 3719 | } |
@@ -3727,19 +3727,19 @@ discard block |
||
3727 | 3727 | $json['error'] = __('No data found in csv file.', 'geodirectory'); |
3728 | 3728 | } |
3729 | 3729 | } else { |
3730 | - wp_send_json( $json ); |
|
3730 | + wp_send_json($json); |
|
3731 | 3731 | } |
3732 | 3732 | } else { |
3733 | - wp_send_json( $json ); |
|
3733 | + wp_send_json($json); |
|
3734 | 3734 | } |
3735 | 3735 | |
3736 | - if ( $task == 'prepare_import' || !empty( $json['error'] ) ) { |
|
3737 | - wp_send_json( $json ); |
|
3736 | + if ($task == 'prepare_import' || !empty($json['error'])) { |
|
3737 | + wp_send_json($json); |
|
3738 | 3738 | } |
3739 | 3739 | |
3740 | 3740 | $total = $json['rows']; |
3741 | - $limit = isset($_POST['limit']) ? (int)$_POST['limit'] : 1; |
|
3742 | - $processed = isset($_POST['processed']) ? (int)$_POST['processed'] : 0; |
|
3741 | + $limit = isset($_POST['limit']) ? (int) $_POST['limit'] : 1; |
|
3742 | + $processed = isset($_POST['processed']) ? (int) $_POST['processed'] : 0; |
|
3743 | 3743 | |
3744 | 3744 | $count = $limit; |
3745 | 3745 | |
@@ -3764,13 +3764,13 @@ discard block |
||
3764 | 3764 | |
3765 | 3765 | $post_types = geodir_get_posttypes(); |
3766 | 3766 | |
3767 | - if ( $task == 'import_cat' ) { |
|
3767 | + if ($task == 'import_cat') { |
|
3768 | 3768 | if (!empty($file)) { |
3769 | 3769 | $columns = isset($file[0]) ? $file[0] : NULL; |
3770 | 3770 | |
3771 | 3771 | if (empty($columns) || (!empty($columns) && $columns[0] == '')) { |
3772 | 3772 | $json['error'] = CSV_INVAILD_FILE; |
3773 | - wp_send_json( $json ); |
|
3773 | + wp_send_json($json); |
|
3774 | 3774 | exit; |
3775 | 3775 | } |
3776 | 3776 | |
@@ -3781,7 +3781,7 @@ discard block |
||
3781 | 3781 | |
3782 | 3782 | if (isset($file[$index])) { |
3783 | 3783 | $row = $file[$index]; |
3784 | - $row = array_map( 'trim', $row ); |
|
3784 | + $row = array_map('trim', $row); |
|
3785 | 3785 | //$row = array_map( 'utf8_encode', $row ); |
3786 | 3786 | |
3787 | 3787 | $cat_id = ''; |
@@ -3798,42 +3798,42 @@ discard block |
||
3798 | 3798 | $cat_id_original = ''; |
3799 | 3799 | |
3800 | 3800 | $c = 0; |
3801 | - foreach ($columns as $column ) { |
|
3802 | - if ( $column == 'cat_id' ) { |
|
3803 | - $cat_id = (int)$row[$c]; |
|
3804 | - } else if ( $column == 'cat_name' ) { |
|
3801 | + foreach ($columns as $column) { |
|
3802 | + if ($column == 'cat_id') { |
|
3803 | + $cat_id = (int) $row[$c]; |
|
3804 | + } else if ($column == 'cat_name') { |
|
3805 | 3805 | $cat_name = $row[$c]; |
3806 | - } else if ( $column == 'cat_slug' ) { |
|
3806 | + } else if ($column == 'cat_slug') { |
|
3807 | 3807 | $cat_slug = $row[$c]; |
3808 | - } else if ( $column == 'cat_posttype' ) { |
|
3808 | + } else if ($column == 'cat_posttype') { |
|
3809 | 3809 | $cat_posttype = $row[$c]; |
3810 | - } else if ( $column == 'cat_parent' ) { |
|
3810 | + } else if ($column == 'cat_parent') { |
|
3811 | 3811 | $cat_parent = trim($row[$c]); |
3812 | - } else if ( $column == 'cat_schema' && $row[$c] != '' ) { |
|
3812 | + } else if ($column == 'cat_schema' && $row[$c] != '') { |
|
3813 | 3813 | $cat_schema = $row[$c]; |
3814 | - } else if ( $column == 'cat_description' ) { |
|
3814 | + } else if ($column == 'cat_description') { |
|
3815 | 3815 | $cat_description = $row[$c]; |
3816 | - } else if ( $column == 'cat_top_description' ) { |
|
3816 | + } else if ($column == 'cat_top_description') { |
|
3817 | 3817 | $cat_top_description = $row[$c]; |
3818 | - } else if ( $column == 'cat_image' ) { |
|
3818 | + } else if ($column == 'cat_image') { |
|
3819 | 3819 | $cat_image = $row[$c]; |
3820 | - } else if ( $column == 'cat_icon' ) { |
|
3820 | + } else if ($column == 'cat_icon') { |
|
3821 | 3821 | $cat_icon = $row[$c]; |
3822 | 3822 | } |
3823 | 3823 | // WPML |
3824 | - if ( $is_wpml ) { |
|
3825 | - if ( $column == 'cat_language' ) { |
|
3826 | - $cat_language = geodir_strtolower( trim( $row[$c] ) ); |
|
3827 | - } else if ( $column == 'cat_id_original' ) { |
|
3828 | - $cat_id_original = (int)$row[$c]; |
|
3824 | + if ($is_wpml) { |
|
3825 | + if ($column == 'cat_language') { |
|
3826 | + $cat_language = geodir_strtolower(trim($row[$c])); |
|
3827 | + } else if ($column == 'cat_id_original') { |
|
3828 | + $cat_id_original = (int) $row[$c]; |
|
3829 | 3829 | } |
3830 | 3830 | } |
3831 | 3831 | // WPML |
3832 | 3832 | $c++; |
3833 | 3833 | } |
3834 | 3834 | |
3835 | - if ( $cat_name == '' || !in_array( $cat_posttype, $post_types ) ) { |
|
3836 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . __( 'Could not be added due to blank title/invalid post type', 'geodirectory' ) ); |
|
3835 | + if ($cat_name == '' || !in_array($cat_posttype, $post_types)) { |
|
3836 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.__('Could not be added due to blank title/invalid post type', 'geodirectory')); |
|
3837 | 3837 | |
3838 | 3838 | $invalid++; |
3839 | 3839 | continue; |
@@ -3851,24 +3851,24 @@ discard block |
||
3851 | 3851 | $term_data['description'] = $cat_description; |
3852 | 3852 | $term_data['cat_schema'] = $cat_schema; |
3853 | 3853 | $term_data['top_description'] = $cat_top_description; |
3854 | - $term_data['image'] = $cat_image != '' ? basename( $cat_image ) : ''; |
|
3855 | - $term_data['icon'] = $cat_icon != '' ? basename( $cat_icon ) : ''; |
|
3854 | + $term_data['image'] = $cat_image != '' ? basename($cat_image) : ''; |
|
3855 | + $term_data['icon'] = $cat_icon != '' ? basename($cat_icon) : ''; |
|
3856 | 3856 | |
3857 | 3857 | //$term_data = array_map( 'utf8_encode', $term_data ); |
3858 | 3858 | |
3859 | - $taxonomy = $cat_posttype . 'category'; |
|
3859 | + $taxonomy = $cat_posttype.'category'; |
|
3860 | 3860 | |
3861 | 3861 | $term_data['taxonomy'] = $taxonomy; |
3862 | 3862 | |
3863 | 3863 | $term_parent_id = 0; |
3864 | - if ($cat_parent != "" || (int)$cat_parent > 0) { |
|
3864 | + if ($cat_parent != "" || (int) $cat_parent > 0) { |
|
3865 | 3865 | $term_parent = ''; |
3866 | 3866 | |
3867 | - if ( $term_parent = get_term_by( 'name', $cat_parent, $taxonomy ) ) { |
|
3867 | + if ($term_parent = get_term_by('name', $cat_parent, $taxonomy)) { |
|
3868 | 3868 | // |
3869 | - } else if ( $term_parent = get_term_by( 'slug', $cat_parent, $taxonomy ) ) { |
|
3869 | + } else if ($term_parent = get_term_by('slug', $cat_parent, $taxonomy)) { |
|
3870 | 3870 | // |
3871 | - } else if ( $term_parent = get_term_by( 'id', $cat_parent, $taxonomy ) ) { |
|
3871 | + } else if ($term_parent = get_term_by('id', $cat_parent, $taxonomy)) { |
|
3872 | 3872 | // |
3873 | 3873 | } else { |
3874 | 3874 | $term_parent_data = array(); |
@@ -3876,104 +3876,104 @@ discard block |
||
3876 | 3876 | //$term_parent_data = array_map( 'utf8_encode', $term_parent_data ); |
3877 | 3877 | $term_parent_data['taxonomy'] = $taxonomy; |
3878 | 3878 | |
3879 | - $term_parent_id = (int)geodir_imex_insert_term( $taxonomy, $term_parent_data ); |
|
3879 | + $term_parent_id = (int) geodir_imex_insert_term($taxonomy, $term_parent_data); |
|
3880 | 3880 | } |
3881 | 3881 | |
3882 | - if ( !empty( $term_parent ) && !is_wp_error( $term_parent ) ) { |
|
3883 | - $term_parent_id = (int)$term_parent->term_id; |
|
3882 | + if (!empty($term_parent) && !is_wp_error($term_parent)) { |
|
3883 | + $term_parent_id = (int) $term_parent->term_id; |
|
3884 | 3884 | } |
3885 | 3885 | } |
3886 | - $term_data['parent'] = (int)$term_parent_id; |
|
3886 | + $term_data['parent'] = (int) $term_parent_id; |
|
3887 | 3887 | |
3888 | 3888 | $term_id = NULL; |
3889 | - if ( $import_choice == 'update' ) { |
|
3890 | - if ( $cat_id > 0 && $term = (array)term_exists( $cat_id, $taxonomy ) ) { |
|
3889 | + if ($import_choice == 'update') { |
|
3890 | + if ($cat_id > 0 && $term = (array) term_exists($cat_id, $taxonomy)) { |
|
3891 | 3891 | $term_data['term_id'] = $term['term_id']; |
3892 | 3892 | |
3893 | - if ( $term_id = geodir_imex_update_term( $taxonomy, $term_data ) ) { |
|
3893 | + if ($term_id = geodir_imex_update_term($taxonomy, $term_data)) { |
|
3894 | 3894 | $updated++; |
3895 | 3895 | } else { |
3896 | 3896 | $invalid++; |
3897 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . __( 'Could not be updated due to invalid data (check & remove if any invalid characters used in data)', 'geodirectory' ) ); |
|
3897 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.__('Could not be updated due to invalid data (check & remove if any invalid characters used in data)', 'geodirectory')); |
|
3898 | 3898 | } |
3899 | - } else if ( $term_data['slug'] != '' && $term = (array)term_exists( $term_data['slug'], $taxonomy ) ) { |
|
3899 | + } else if ($term_data['slug'] != '' && $term = (array) term_exists($term_data['slug'], $taxonomy)) { |
|
3900 | 3900 | $term_data['term_id'] = $term['term_id']; |
3901 | 3901 | |
3902 | - if ( $term_id = geodir_imex_update_term( $taxonomy, $term_data ) ) { |
|
3902 | + if ($term_id = geodir_imex_update_term($taxonomy, $term_data)) { |
|
3903 | 3903 | $updated++; |
3904 | 3904 | } else { |
3905 | 3905 | $invalid++; |
3906 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . __( 'Could not be updated due to invalid data (check & remove if any invalid characters used in data)', 'geodirectory' ) ); |
|
3906 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.__('Could not be updated due to invalid data (check & remove if any invalid characters used in data)', 'geodirectory')); |
|
3907 | 3907 | } |
3908 | 3908 | } else { |
3909 | - if ( $term_id = geodir_imex_insert_term( $taxonomy, $term_data ) ) { |
|
3909 | + if ($term_id = geodir_imex_insert_term($taxonomy, $term_data)) { |
|
3910 | 3910 | $created++; |
3911 | 3911 | } else { |
3912 | 3912 | $invalid++; |
3913 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . __( 'Could not be added due to invalid data (check & remove if any invalid characters used in data)', 'geodirectory' ) ); |
|
3913 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.__('Could not be added due to invalid data (check & remove if any invalid characters used in data)', 'geodirectory')); |
|
3914 | 3914 | } |
3915 | 3915 | } |
3916 | - } else if ( $import_choice == 'skip' ) { |
|
3917 | - if ( $cat_id > 0 && $term = (array)term_exists( $cat_id, $taxonomy ) ) { |
|
3916 | + } else if ($import_choice == 'skip') { |
|
3917 | + if ($cat_id > 0 && $term = (array) term_exists($cat_id, $taxonomy)) { |
|
3918 | 3918 | $skipped++; |
3919 | - } else if ( $term_data['slug'] != '' && $term = (array)term_exists( $term_data['slug'], $taxonomy ) ) { |
|
3919 | + } else if ($term_data['slug'] != '' && $term = (array) term_exists($term_data['slug'], $taxonomy)) { |
|
3920 | 3920 | $skipped++; |
3921 | 3921 | } else { |
3922 | - if ( $term_id = geodir_imex_insert_term( $taxonomy, $term_data ) ) { |
|
3922 | + if ($term_id = geodir_imex_insert_term($taxonomy, $term_data)) { |
|
3923 | 3923 | $created++; |
3924 | 3924 | } else { |
3925 | 3925 | $invalid++; |
3926 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . __( 'Could not be updated due to invalid data (check & remove if any invalid characters used in data)', 'geodirectory' ) ); |
|
3926 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.__('Could not be updated due to invalid data (check & remove if any invalid characters used in data)', 'geodirectory')); |
|
3927 | 3927 | } |
3928 | 3928 | } |
3929 | 3929 | } else { |
3930 | 3930 | $invalid++; |
3931 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . __( 'Could not be added due to invalid data (check & remove if any invalid characters used in data)', 'geodirectory' ) ); |
|
3931 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.__('Could not be added due to invalid data (check & remove if any invalid characters used in data)', 'geodirectory')); |
|
3932 | 3932 | } |
3933 | 3933 | |
3934 | - if ( $term_id ) { |
|
3934 | + if ($term_id) { |
|
3935 | 3935 | // WPML |
3936 | 3936 | if ($is_wpml && $cat_id_original > 0 && $cat_language != '') { |
3937 | - $wpml_element_type = 'tax_' . $taxonomy; |
|
3938 | - $source_language = geodir_get_language_for_element( $cat_id_original, $wpml_element_type ); |
|
3937 | + $wpml_element_type = 'tax_'.$taxonomy; |
|
3938 | + $source_language = geodir_get_language_for_element($cat_id_original, $wpml_element_type); |
|
3939 | 3939 | $source_language = $source_language != '' ? $source_language : $sitepress->get_default_language(); |
3940 | 3940 | |
3941 | - $trid = $sitepress->get_element_trid( $cat_id_original, $wpml_element_type ); |
|
3941 | + $trid = $sitepress->get_element_trid($cat_id_original, $wpml_element_type); |
|
3942 | 3942 | |
3943 | - $sitepress->set_element_language_details( $term_id, $wpml_element_type, $trid, $cat_language, $source_language ); |
|
3943 | + $sitepress->set_element_language_details($term_id, $wpml_element_type, $trid, $cat_language, $source_language); |
|
3944 | 3944 | } |
3945 | 3945 | // WPML |
3946 | 3946 | |
3947 | - if ( isset( $term_data['top_description'] ) ) { |
|
3948 | - update_tax_meta( $term_id, 'ct_cat_top_desc', $term_data['top_description'], $cat_posttype ); |
|
3947 | + if (isset($term_data['top_description'])) { |
|
3948 | + update_tax_meta($term_id, 'ct_cat_top_desc', $term_data['top_description'], $cat_posttype); |
|
3949 | 3949 | } |
3950 | 3950 | |
3951 | - if ( isset( $term_data['cat_schema'] ) ) { |
|
3952 | - update_tax_meta( $term_id, 'ct_cat_schema', $term_data['cat_schema'], $cat_posttype ); |
|
3951 | + if (isset($term_data['cat_schema'])) { |
|
3952 | + update_tax_meta($term_id, 'ct_cat_schema', $term_data['cat_schema'], $cat_posttype); |
|
3953 | 3953 | } |
3954 | 3954 | |
3955 | 3955 | $attachment = false; |
3956 | - if ( isset( $term_data['image'] ) && $term_data['image'] != '' ) { |
|
3957 | - $cat_image = geodir_get_default_catimage( $term_id, $cat_posttype ); |
|
3958 | - $cat_image = !empty( $cat_image ) && isset( $cat_image['src'] ) ? $cat_image['src'] : ''; |
|
3956 | + if (isset($term_data['image']) && $term_data['image'] != '') { |
|
3957 | + $cat_image = geodir_get_default_catimage($term_id, $cat_posttype); |
|
3958 | + $cat_image = !empty($cat_image) && isset($cat_image['src']) ? $cat_image['src'] : ''; |
|
3959 | 3959 | |
3960 | - if ( basename($cat_image) != $term_data['image'] ) { |
|
3960 | + if (basename($cat_image) != $term_data['image']) { |
|
3961 | 3961 | $attachment = true; |
3962 | - update_tax_meta( $term_id, 'ct_cat_default_img', array( 'id' => 'image', 'src' => $uploads['url'] . '/' . $term_data['image'] ), $cat_posttype ); |
|
3962 | + update_tax_meta($term_id, 'ct_cat_default_img', array('id' => 'image', 'src' => $uploads['url'].'/'.$term_data['image']), $cat_posttype); |
|
3963 | 3963 | } |
3964 | 3964 | } |
3965 | 3965 | |
3966 | - if ( isset( $term_data['icon'] ) && $term_data['icon'] != '' ) { |
|
3967 | - $cat_icon = get_tax_meta( $term_id, 'ct_cat_icon', false, $cat_posttype ); |
|
3968 | - $cat_icon = !empty( $cat_icon ) && isset( $cat_icon['src'] ) ? $cat_icon['src'] : ''; |
|
3966 | + if (isset($term_data['icon']) && $term_data['icon'] != '') { |
|
3967 | + $cat_icon = get_tax_meta($term_id, 'ct_cat_icon', false, $cat_posttype); |
|
3968 | + $cat_icon = !empty($cat_icon) && isset($cat_icon['src']) ? $cat_icon['src'] : ''; |
|
3969 | 3969 | |
3970 | - if ( basename($cat_icon) != $term_data['icon'] ) { |
|
3970 | + if (basename($cat_icon) != $term_data['icon']) { |
|
3971 | 3971 | $attachment = true; |
3972 | - update_tax_meta( $term_id, 'ct_cat_icon', array( 'id' => 'icon', 'src' => $uploads['url'] . '/' . $term_data['icon'] ), $cat_posttype ); |
|
3972 | + update_tax_meta($term_id, 'ct_cat_icon', array('id' => 'icon', 'src' => $uploads['url'].'/'.$term_data['icon']), $cat_posttype); |
|
3973 | 3973 | } |
3974 | 3974 | } |
3975 | 3975 | |
3976 | - if ( $attachment ) { |
|
3976 | + if ($attachment) { |
|
3977 | 3977 | $images++; |
3978 | 3978 | } |
3979 | 3979 | } |
@@ -3995,34 +3995,34 @@ discard block |
||
3995 | 3995 | $json['invalid'] = $invalid; |
3996 | 3996 | $json['images'] = $images; |
3997 | 3997 | |
3998 | - wp_send_json( $json ); |
|
3998 | + wp_send_json($json); |
|
3999 | 3999 | exit; |
4000 | - } else if ( $task == 'import_post' ) { |
|
4000 | + } else if ($task == 'import_post') { |
|
4001 | 4001 | //run some stuff to make the import quicker |
4002 | - wp_defer_term_counting( true ); |
|
4003 | - wp_defer_comment_counting( true ); |
|
4004 | - $wpdb->query( 'SET autocommit = 0;' ); |
|
4002 | + wp_defer_term_counting(true); |
|
4003 | + wp_defer_comment_counting(true); |
|
4004 | + $wpdb->query('SET autocommit = 0;'); |
|
4005 | 4005 | |
4006 | 4006 | //remove_all_actions('publish_post'); |
4007 | 4007 | //remove_all_actions('transition_post_status'); |
4008 | 4008 | //remove_all_actions('publish_future_post'); |
4009 | 4009 | |
4010 | 4010 | if (!empty($file)) { |
4011 | - $is_claim_active = is_plugin_active( 'geodir_claim_listing/geodir_claim_listing.php' ) && get_option('geodir_claim_enable') === 'yes' ? true : false; |
|
4011 | + $is_claim_active = is_plugin_active('geodir_claim_listing/geodir_claim_listing.php') && get_option('geodir_claim_enable') === 'yes' ? true : false; |
|
4012 | 4012 | $wp_post_statuses = get_post_statuses(); // All of the WordPress supported post statuses. |
4013 | 4013 | $default_status = 'publish'; |
4014 | - $current_date = date_i18n( 'Y-m-d', time() ); |
|
4014 | + $current_date = date_i18n('Y-m-d', time()); |
|
4015 | 4015 | |
4016 | 4016 | $columns = isset($file[0]) ? $file[0] : NULL; |
4017 | 4017 | |
4018 | 4018 | if (empty($columns) || (!empty($columns) && $columns[0] == '')) { |
4019 | 4019 | $json['error'] = CSV_INVAILD_FILE; |
4020 | - wp_send_json( $json ); |
|
4020 | + wp_send_json($json); |
|
4021 | 4021 | exit; |
4022 | 4022 | } |
4023 | 4023 | |
4024 | 4024 | $gd_error_log = __('GD IMPORT LISTINGS [ROW %d]:', 'geodirectory'); |
4025 | - $wp_chars_error = __( '(check & remove if any invalid characters used in data)', 'geodirectory' ); |
|
4025 | + $wp_chars_error = __('(check & remove if any invalid characters used in data)', 'geodirectory'); |
|
4026 | 4026 | $processed_actual = 0; |
4027 | 4027 | for ($i = 1; $i <= $limit; $i++) { |
4028 | 4028 | $index = $processed + $i; |
@@ -4031,9 +4031,9 @@ discard block |
||
4031 | 4031 | if (isset($file[$index])) { |
4032 | 4032 | $processed_actual++; |
4033 | 4033 | $row = $file[$index]; |
4034 | - $row = array_map( 'trim', $row ); |
|
4034 | + $row = array_map('trim', $row); |
|
4035 | 4035 | //$row = array_map( 'utf8_encode', $row ); |
4036 | - $row = array_map( 'addslashes_gpc', $row ); |
|
4036 | + $row = array_map('addslashes_gpc', $row); |
|
4037 | 4037 | |
4038 | 4038 | $post_id = ''; |
4039 | 4039 | $post_title = ''; |
@@ -4070,78 +4070,78 @@ discard block |
||
4070 | 4070 | $original_post_id = ''; |
4071 | 4071 | |
4072 | 4072 | $c = 0; |
4073 | - foreach ($columns as $column ) { |
|
4073 | + foreach ($columns as $column) { |
|
4074 | 4074 | $gd_post[$column] = $row[$c]; |
4075 | 4075 | |
4076 | - if ( $column == 'post_id' ) { |
|
4076 | + if ($column == 'post_id') { |
|
4077 | 4077 | $post_id = $row[$c]; |
4078 | - } else if ( $column == 'post_title' ) { |
|
4078 | + } else if ($column == 'post_title') { |
|
4079 | 4079 | $post_title = sanitize_text_field($row[$c]); |
4080 | - } else if ( $column == 'post_author' ) { |
|
4080 | + } else if ($column == 'post_author') { |
|
4081 | 4081 | $post_author = $row[$c]; |
4082 | - } else if ( $column == 'post_content' ) { |
|
4082 | + } else if ($column == 'post_content') { |
|
4083 | 4083 | $post_content = $row[$c]; |
4084 | - } else if ( $column == 'post_category' && $row[$c] != '' ) { |
|
4085 | - $post_category_arr = explode( ',', $row[$c] ); |
|
4086 | - } else if ( $column == 'default_category' ) { |
|
4084 | + } else if ($column == 'post_category' && $row[$c] != '') { |
|
4085 | + $post_category_arr = explode(',', $row[$c]); |
|
4086 | + } else if ($column == 'default_category') { |
|
4087 | 4087 | $default_category = wp_kses_normalize_entities($row[$c]); |
4088 | - } else if ( $column == 'post_tags' && $row[$c] != '' ) { |
|
4089 | - $post_tags = explode( ',', sanitize_text_field($row[$c]) ); |
|
4090 | - } else if ( $column == 'post_type' ) { |
|
4088 | + } else if ($column == 'post_tags' && $row[$c] != '') { |
|
4089 | + $post_tags = explode(',', sanitize_text_field($row[$c])); |
|
4090 | + } else if ($column == 'post_type') { |
|
4091 | 4091 | $post_type = $row[$c]; |
4092 | - } else if ( $column == 'post_status' ) { |
|
4093 | - $post_status = sanitize_key( $row[$c] ); |
|
4094 | - } else if ( $column == 'is_featured' ) { |
|
4095 | - $is_featured = (int)$row[$c]; |
|
4096 | - } else if ( $column == 'geodir_video' ) { |
|
4092 | + } else if ($column == 'post_status') { |
|
4093 | + $post_status = sanitize_key($row[$c]); |
|
4094 | + } else if ($column == 'is_featured') { |
|
4095 | + $is_featured = (int) $row[$c]; |
|
4096 | + } else if ($column == 'geodir_video') { |
|
4097 | 4097 | $geodir_video = $row[$c]; |
4098 | - } else if ( $column == 'post_address' ) { |
|
4098 | + } else if ($column == 'post_address') { |
|
4099 | 4099 | $post_address = sanitize_text_field($row[$c]); |
4100 | - } else if ( $column == 'post_city' ) { |
|
4100 | + } else if ($column == 'post_city') { |
|
4101 | 4101 | $post_city = sanitize_text_field($row[$c]); |
4102 | - } else if ( $column == 'post_region' ) { |
|
4102 | + } else if ($column == 'post_region') { |
|
4103 | 4103 | $post_region = sanitize_text_field($row[$c]); |
4104 | - } else if ( $column == 'post_country' ) { |
|
4104 | + } else if ($column == 'post_country') { |
|
4105 | 4105 | $post_country = sanitize_text_field($row[$c]); |
4106 | - } else if ( $column == 'post_zip' ) { |
|
4106 | + } else if ($column == 'post_zip') { |
|
4107 | 4107 | $post_zip = sanitize_text_field($row[$c]); |
4108 | - } else if ( $column == 'post_latitude' ) { |
|
4108 | + } else if ($column == 'post_latitude') { |
|
4109 | 4109 | $post_latitude = sanitize_text_field($row[$c]); |
4110 | - } else if ( $column == 'post_longitude' ) { |
|
4110 | + } else if ($column == 'post_longitude') { |
|
4111 | 4111 | $post_longitude = sanitize_text_field($row[$c]); |
4112 | - } else if ( $column == 'post_neighbourhood' ) { |
|
4112 | + } else if ($column == 'post_neighbourhood') { |
|
4113 | 4113 | $post_neighbourhood = sanitize_text_field($row[$c]); |
4114 | 4114 | unset($gd_post[$column]); |
4115 | - } else if ( $column == 'neighbourhood_latitude' ) { |
|
4115 | + } else if ($column == 'neighbourhood_latitude') { |
|
4116 | 4116 | $neighbourhood_latitude = sanitize_text_field($row[$c]); |
4117 | - } else if ( $column == 'neighbourhood_longitude' ) { |
|
4117 | + } else if ($column == 'neighbourhood_longitude') { |
|
4118 | 4118 | $neighbourhood_longitude = sanitize_text_field($row[$c]); |
4119 | - } else if ( $column == 'geodir_timing' ) { |
|
4119 | + } else if ($column == 'geodir_timing') { |
|
4120 | 4120 | $geodir_timing = sanitize_text_field($row[$c]); |
4121 | - } else if ( $column == 'geodir_contact' ) { |
|
4121 | + } else if ($column == 'geodir_contact') { |
|
4122 | 4122 | $geodir_contact = sanitize_text_field($row[$c]); |
4123 | - } else if ( $column == 'geodir_email' ) { |
|
4123 | + } else if ($column == 'geodir_email') { |
|
4124 | 4124 | $geodir_email = sanitize_email($row[$c]); |
4125 | - } else if ( $column == 'geodir_website' ) { |
|
4125 | + } else if ($column == 'geodir_website') { |
|
4126 | 4126 | $geodir_website = sanitize_text_field($row[$c]); |
4127 | - } else if ( $column == 'geodir_twitter' ) { |
|
4127 | + } else if ($column == 'geodir_twitter') { |
|
4128 | 4128 | $geodir_twitter = sanitize_text_field($row[$c]); |
4129 | - } else if ( $column == 'geodir_facebook' ) { |
|
4129 | + } else if ($column == 'geodir_facebook') { |
|
4130 | 4130 | $geodir_facebook = sanitize_text_field($row[$c]); |
4131 | - } else if ( $column == 'IMAGE' && !empty( $row[$c] ) && $row[$c] != '' ) { |
|
4131 | + } else if ($column == 'IMAGE' && !empty($row[$c]) && $row[$c] != '') { |
|
4132 | 4132 | $post_images[] = $row[$c]; |
4133 | - } else if ( $column == 'alive_days' && (int)$row[$c] > 0 ) { |
|
4134 | - $expire_date = date_i18n( 'Y-m-d', strtotime( $current_date . '+' . (int)$row[$c] . ' days' ) ); |
|
4135 | - } else if ( $column == 'expire_date' && $row[$c] != '' && geodir_strtolower($row[$c]) != 'never' ) { |
|
4133 | + } else if ($column == 'alive_days' && (int) $row[$c] > 0) { |
|
4134 | + $expire_date = date_i18n('Y-m-d', strtotime($current_date.'+'.(int) $row[$c].' days')); |
|
4135 | + } else if ($column == 'expire_date' && $row[$c] != '' && geodir_strtolower($row[$c]) != 'never') { |
|
4136 | 4136 | $row[$c] = str_replace('/', '-', $row[$c]); |
4137 | - $expire_date = date_i18n( 'Y-m-d', strtotime( $row[$c] ) ); |
|
4137 | + $expire_date = date_i18n('Y-m-d', strtotime($row[$c])); |
|
4138 | 4138 | } |
4139 | 4139 | // WPML |
4140 | 4140 | if ($is_wpml) { |
4141 | 4141 | if ($column == 'language') { |
4142 | 4142 | $language = geodir_strtolower(trim($row[$c])); |
4143 | 4143 | } else if ($column == 'original_post_id') { |
4144 | - $original_post_id = (int)$row[$c]; |
|
4144 | + $original_post_id = (int) $row[$c]; |
|
4145 | 4145 | } |
4146 | 4146 | } |
4147 | 4147 | // WPML |
@@ -4149,7 +4149,7 @@ discard block |
||
4149 | 4149 | } |
4150 | 4150 | // listing claimed or not |
4151 | 4151 | if ($is_claim_active && isset($gd_post['claimed'])) { |
4152 | - $gd_post['claimed'] = (int)$gd_post['claimed'] == 1 ? 1 : 0; |
|
4152 | + $gd_post['claimed'] = (int) $gd_post['claimed'] == 1 ? 1 : 0; |
|
4153 | 4153 | } |
4154 | 4154 | |
4155 | 4155 | // WPML |
@@ -4160,43 +4160,43 @@ discard block |
||
4160 | 4160 | |
4161 | 4161 | $gd_post['IMAGE'] = $post_images; |
4162 | 4162 | |
4163 | - $post_status = !empty( $post_status ) ? sanitize_key( $post_status ) : $default_status; |
|
4164 | - $post_status = !empty( $wp_post_statuses ) && !isset( $wp_post_statuses[$post_status] ) ? $default_status : $post_status; |
|
4163 | + $post_status = !empty($post_status) ? sanitize_key($post_status) : $default_status; |
|
4164 | + $post_status = !empty($wp_post_statuses) && !isset($wp_post_statuses[$post_status]) ? $default_status : $post_status; |
|
4165 | 4165 | |
4166 | 4166 | $valid = true; |
4167 | 4167 | |
4168 | - if ( $post_title == '' || !in_array( $post_type, $post_types ) ) { |
|
4168 | + if ($post_title == '' || !in_array($post_type, $post_types)) { |
|
4169 | 4169 | $invalid++; |
4170 | 4170 | $valid = false; |
4171 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . __( 'Could not be added due to blank title/invalid post type', 'geodirectory' ) ); |
|
4171 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.__('Could not be added due to blank title/invalid post type', 'geodirectory')); |
|
4172 | 4172 | } |
4173 | 4173 | |
4174 | - $location_allowed = function_exists( 'geodir_cpt_no_location' ) && geodir_cpt_no_location( $post_type ) ? false : true; |
|
4175 | - if ( $location_allowed ) { |
|
4174 | + $location_allowed = function_exists('geodir_cpt_no_location') && geodir_cpt_no_location($post_type) ? false : true; |
|
4175 | + if ($location_allowed) { |
|
4176 | 4176 | $location_result = geodir_get_default_location(); |
4177 | - if ( $post_address == '' || $post_city == '' || $post_region == '' || $post_country == '' || $post_latitude == '' || $post_longitude == '' ) { |
|
4177 | + if ($post_address == '' || $post_city == '' || $post_region == '' || $post_country == '' || $post_latitude == '' || $post_longitude == '') { |
|
4178 | 4178 | $invalid_addr++; |
4179 | 4179 | $valid = false; |
4180 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . __( 'Could not be added due to blank/invalid address(city, region, country, latitude, longitude).', 'geodirectory' ) ); |
|
4181 | - } else if ( !empty( $location_result ) && $location_result->location_id == 0 ) { |
|
4182 | - 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 ) ) ) { |
|
4180 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.__('Could not be added due to blank/invalid address(city, region, country, latitude, longitude).', 'geodirectory')); |
|
4181 | + } else if (!empty($location_result) && $location_result->location_id == 0) { |
|
4182 | + 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))) { |
|
4183 | 4183 | $invalid_addr++; |
4184 | 4184 | $valid = false; |
4185 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . __( 'Could not be added due to blank/invalid address(city, region, country, latitude, longitude).', 'geodirectory' ) ); |
|
4185 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.__('Could not be added due to blank/invalid address(city, region, country, latitude, longitude).', 'geodirectory')); |
|
4186 | 4186 | } else { |
4187 | 4187 | if (!$location_manager) { |
4188 | - $gd_post['post_locations'] = '[' . $location_result->city_slug . '],[' . $location_result->region_slug . '],[' . $location_result->country_slug . ']'; // Set the default location when location manager not activated. |
|
4188 | + $gd_post['post_locations'] = '['.$location_result->city_slug.'],['.$location_result->region_slug.'],['.$location_result->country_slug.']'; // Set the default location when location manager not activated. |
|
4189 | 4189 | } |
4190 | 4190 | } |
4191 | 4191 | } |
4192 | 4192 | } |
4193 | 4193 | |
4194 | - if ( !$valid ) { |
|
4194 | + if (!$valid) { |
|
4195 | 4195 | continue; |
4196 | 4196 | } |
4197 | 4197 | |
4198 | - $cat_taxonomy = $post_type . 'category'; |
|
4199 | - $tags_taxonomy = $post_type . '_tags'; |
|
4198 | + $cat_taxonomy = $post_type.'category'; |
|
4199 | + $tags_taxonomy = $post_type.'_tags'; |
|
4200 | 4200 | |
4201 | 4201 | if ($default_category != '' && !in_array($default_category, $post_category_arr)) { |
4202 | 4202 | $post_category_arr = array_merge(array($default_category), $post_category_arr); |
@@ -4204,29 +4204,29 @@ discard block |
||
4204 | 4204 | |
4205 | 4205 | $post_category = array(); |
4206 | 4206 | $default_category_id = NULL; |
4207 | - if ( !empty( $post_category_arr ) ) { |
|
4208 | - foreach ( $post_category_arr as $value ) { |
|
4209 | - $category_name = wp_kses_normalize_entities( trim( $value ) ); |
|
4207 | + if (!empty($post_category_arr)) { |
|
4208 | + foreach ($post_category_arr as $value) { |
|
4209 | + $category_name = wp_kses_normalize_entities(trim($value)); |
|
4210 | 4210 | |
4211 | - if ( $category_name != '' ) { |
|
4211 | + if ($category_name != '') { |
|
4212 | 4212 | $term_category = array(); |
4213 | 4213 | |
4214 | - if ( $term = get_term_by( 'name', $category_name, $cat_taxonomy ) ) { |
|
4214 | + if ($term = get_term_by('name', $category_name, $cat_taxonomy)) { |
|
4215 | 4215 | $term_category = $term; |
4216 | - } else if ( $term = get_term_by( 'slug', $category_name, $cat_taxonomy ) ) { |
|
4216 | + } else if ($term = get_term_by('slug', $category_name, $cat_taxonomy)) { |
|
4217 | 4217 | $term_category = $term; |
4218 | 4218 | } else { |
4219 | 4219 | $term_data = array(); |
4220 | 4220 | $term_data['name'] = $category_name; |
4221 | 4221 | $term_data['taxonomy'] = $cat_taxonomy; |
4222 | 4222 | |
4223 | - $term_id = geodir_imex_insert_term( $cat_taxonomy, $term_data ); |
|
4224 | - if ( $term_id ) { |
|
4225 | - $term_category = get_term( $term_id, $cat_taxonomy ); |
|
4223 | + $term_id = geodir_imex_insert_term($cat_taxonomy, $term_data); |
|
4224 | + if ($term_id) { |
|
4225 | + $term_category = get_term($term_id, $cat_taxonomy); |
|
4226 | 4226 | } |
4227 | 4227 | } |
4228 | 4228 | |
4229 | - if ( !empty( $term_category ) && !is_wp_error( $term_category ) ) { |
|
4229 | + if (!empty($term_category) && !is_wp_error($term_category)) { |
|
4230 | 4230 | $post_category[] = intval($term_category->term_id); |
4231 | 4231 | |
4232 | 4232 | if ($category_name == $default_category) { |
@@ -4247,15 +4247,15 @@ discard block |
||
4247 | 4247 | $save_post['post_tags'] = $post_tags; |
4248 | 4248 | |
4249 | 4249 | $saved_post_id = NULL; |
4250 | - if ( $import_choice == 'update' ) { |
|
4251 | - $gd_wp_error = __( 'Unable to add listing, please check the listing data.', 'geodirectory' ); |
|
4250 | + if ($import_choice == 'update') { |
|
4251 | + $gd_wp_error = __('Unable to add listing, please check the listing data.', 'geodirectory'); |
|
4252 | 4252 | |
4253 | - if ( $post_id > 0 && get_post( $post_id ) ) { |
|
4253 | + if ($post_id > 0 && get_post($post_id)) { |
|
4254 | 4254 | $save_post['ID'] = $post_id; |
4255 | 4255 | |
4256 | - if ( $saved_post_id = wp_update_post( $save_post, true ) ) { |
|
4257 | - if ( is_wp_error( $saved_post_id ) ) { |
|
4258 | - $gd_wp_error = $saved_post_id->get_error_message() . ' ' . $wp_chars_error; |
|
4256 | + if ($saved_post_id = wp_update_post($save_post, true)) { |
|
4257 | + if (is_wp_error($saved_post_id)) { |
|
4258 | + $gd_wp_error = $saved_post_id->get_error_message().' '.$wp_chars_error; |
|
4259 | 4259 | $saved_post_id = 0; |
4260 | 4260 | } else { |
4261 | 4261 | $saved_post_id = $post_id; |
@@ -4263,9 +4263,9 @@ discard block |
||
4263 | 4263 | } |
4264 | 4264 | } |
4265 | 4265 | } else { |
4266 | - if ( $saved_post_id = wp_insert_post( $save_post, true ) ) { |
|
4267 | - if ( is_wp_error( $saved_post_id ) ) { |
|
4268 | - $gd_wp_error = $saved_post_id->get_error_message() . ' ' . $wp_chars_error; |
|
4266 | + if ($saved_post_id = wp_insert_post($save_post, true)) { |
|
4267 | + if (is_wp_error($saved_post_id)) { |
|
4268 | + $gd_wp_error = $saved_post_id->get_error_message().' '.$wp_chars_error; |
|
4269 | 4269 | $saved_post_id = 0; |
4270 | 4270 | } else { |
4271 | 4271 | $created++; |
@@ -4273,19 +4273,19 @@ discard block |
||
4273 | 4273 | } |
4274 | 4274 | } |
4275 | 4275 | |
4276 | - if ( !$saved_post_id > 0 ) { |
|
4276 | + if (!$saved_post_id > 0) { |
|
4277 | 4277 | $invalid++; |
4278 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_wp_error ); |
|
4278 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$gd_wp_error); |
|
4279 | 4279 | } |
4280 | - } else if ( $import_choice == 'skip' ) { |
|
4281 | - if ( $post_id > 0 && get_post( $post_id ) ) { |
|
4280 | + } else if ($import_choice == 'skip') { |
|
4281 | + if ($post_id > 0 && get_post($post_id)) { |
|
4282 | 4282 | $skipped++; |
4283 | 4283 | } else { |
4284 | - if ( $saved_post_id = wp_insert_post( $save_post, true ) ) { |
|
4285 | - if ( is_wp_error( $saved_post_id ) ) { |
|
4284 | + if ($saved_post_id = wp_insert_post($save_post, true)) { |
|
4285 | + if (is_wp_error($saved_post_id)) { |
|
4286 | 4286 | $invalid++; |
4287 | 4287 | |
4288 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $saved_post_id->get_error_message() . ' ' . $wp_chars_error ); |
|
4288 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$saved_post_id->get_error_message().' '.$wp_chars_error); |
|
4289 | 4289 | $saved_post_id = 0; |
4290 | 4290 | } else { |
4291 | 4291 | $created++; |
@@ -4293,28 +4293,28 @@ discard block |
||
4293 | 4293 | } else { |
4294 | 4294 | $invalid++; |
4295 | 4295 | |
4296 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $wp_chars_error ); |
|
4296 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$wp_chars_error); |
|
4297 | 4297 | } |
4298 | 4298 | } |
4299 | 4299 | } else { |
4300 | 4300 | $invalid++; |
4301 | 4301 | |
4302 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $wp_chars_error ); |
|
4302 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$wp_chars_error); |
|
4303 | 4303 | } |
4304 | 4304 | |
4305 | - if ( (int)$saved_post_id > 0 ) { |
|
4305 | + if ((int) $saved_post_id > 0) { |
|
4306 | 4306 | // WPML |
4307 | 4307 | if ($is_wpml && $original_post_id > 0 && $language != '') { |
4308 | - $wpml_post_type = 'post_' . $post_type; |
|
4309 | - $source_language = geodir_get_language_for_element( $original_post_id, $wpml_post_type ); |
|
4308 | + $wpml_post_type = 'post_'.$post_type; |
|
4309 | + $source_language = geodir_get_language_for_element($original_post_id, $wpml_post_type); |
|
4310 | 4310 | $source_language = $source_language != '' ? $source_language : $sitepress->get_default_language(); |
4311 | 4311 | |
4312 | - $trid = $sitepress->get_element_trid( $original_post_id, $wpml_post_type ); |
|
4312 | + $trid = $sitepress->get_element_trid($original_post_id, $wpml_post_type); |
|
4313 | 4313 | |
4314 | - $sitepress->set_element_language_details( $saved_post_id, $wpml_post_type, $trid, $language, $source_language ); |
|
4314 | + $sitepress->set_element_language_details($saved_post_id, $wpml_post_type, $trid, $language, $source_language); |
|
4315 | 4315 | } |
4316 | 4316 | // WPML |
4317 | - $gd_post_info = geodir_get_post_info( $saved_post_id ); |
|
4317 | + $gd_post_info = geodir_get_post_info($saved_post_id); |
|
4318 | 4318 | |
4319 | 4319 | $gd_post['post_id'] = $saved_post_id; |
4320 | 4320 | $gd_post['ID'] = $saved_post_id; |
@@ -4326,7 +4326,7 @@ discard block |
||
4326 | 4326 | |
4327 | 4327 | // post location |
4328 | 4328 | $post_location_id = 0; |
4329 | - if ( $location_allowed && !empty( $location_result ) && $location_result->location_id > 0 ) { |
|
4329 | + if ($location_allowed && !empty($location_result) && $location_result->location_id > 0) { |
|
4330 | 4330 | $gd_post['post_neighbourhood'] = ''; |
4331 | 4331 | |
4332 | 4332 | $post_location_info = array( |
@@ -4336,7 +4336,7 @@ discard block |
||
4336 | 4336 | 'geo_lat' => $post_latitude, |
4337 | 4337 | 'geo_lng' => $post_longitude |
4338 | 4338 | ); |
4339 | - if ( $location_id = (int)geodir_add_new_location( $post_location_info ) ) { |
|
4339 | + if ($location_id = (int) geodir_add_new_location($post_location_info)) { |
|
4340 | 4340 | $post_location_id = $location_id; |
4341 | 4341 | } |
4342 | 4342 | |
@@ -4374,14 +4374,14 @@ discard block |
||
4374 | 4374 | $gd_post['post_location_id'] = $post_location_id; |
4375 | 4375 | |
4376 | 4376 | // post package info |
4377 | - $package_id = isset( $gd_post['package_id'] ) && !empty( $gd_post['package_id'] ) ? (int)$gd_post['package_id'] : 0; |
|
4377 | + $package_id = isset($gd_post['package_id']) && !empty($gd_post['package_id']) ? (int) $gd_post['package_id'] : 0; |
|
4378 | 4378 | if (!$package_id && !empty($gd_post_info) && isset($gd_post_info->package_id) && $gd_post_info->package_id) { |
4379 | 4379 | $package_id = $gd_post_info->package_id; |
4380 | 4380 | } |
4381 | 4381 | |
4382 | 4382 | $package_info = array(); |
4383 | 4383 | if ($package_id && function_exists('geodir_get_package_info_by_id')) { |
4384 | - $package_info = (array)geodir_get_package_info_by_id($package_id); |
|
4384 | + $package_info = (array) geodir_get_package_info_by_id($package_id); |
|
4385 | 4385 | |
4386 | 4386 | if (!(!empty($package_info) && isset($package_info['post_type']) && $package_info['post_type'] == $post_type)) { |
4387 | 4387 | $package_info = array(); |
@@ -4389,18 +4389,18 @@ discard block |
||
4389 | 4389 | } |
4390 | 4390 | |
4391 | 4391 | if (empty($package_info)) { |
4392 | - $package_info = (array)geodir_post_package_info( array(), '', $post_type ); |
|
4392 | + $package_info = (array) geodir_post_package_info(array(), '', $post_type); |
|
4393 | 4393 | } |
4394 | 4394 | |
4395 | - if (!empty($package_info)) { |
|
4395 | + if (!empty($package_info)) { |
|
4396 | 4396 | $package_id = $package_info['pid']; |
4397 | 4397 | |
4398 | 4398 | if (isset($gd_post['alive_days']) || isset($gd_post['expire_date'])) { |
4399 | 4399 | $gd_post['expire_date'] = $expire_date; |
4400 | 4400 | } else { |
4401 | - if ( isset( $package_info['days'] ) && (int)$package_info['days'] > 0 ) { |
|
4402 | - $gd_post['alive_days'] = (int)$package_info['days']; |
|
4403 | - $gd_post['expire_date'] = date_i18n( 'Y-m-d', strtotime( $current_date . '+' . (int)$package_info['days'] . ' days' ) ); |
|
4401 | + if (isset($package_info['days']) && (int) $package_info['days'] > 0) { |
|
4402 | + $gd_post['alive_days'] = (int) $package_info['days']; |
|
4403 | + $gd_post['expire_date'] = date_i18n('Y-m-d', strtotime($current_date.'+'.(int) $package_info['days'].' days')); |
|
4404 | 4404 | } else { |
4405 | 4405 | $gd_post['expire_date'] = 'Never'; |
4406 | 4406 | } |
@@ -4409,7 +4409,7 @@ discard block |
||
4409 | 4409 | $gd_post['package_id'] = $package_id; |
4410 | 4410 | } |
4411 | 4411 | |
4412 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
4412 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
4413 | 4413 | |
4414 | 4414 | if ($post_type == 'gd_event') { |
4415 | 4415 | $gd_post = geodir_imex_process_event_data($gd_post); |
@@ -4420,28 +4420,28 @@ discard block |
||
4420 | 4420 | } |
4421 | 4421 | |
4422 | 4422 | // Export franchise fields |
4423 | - $is_franchise_active = is_plugin_active( 'geodir_franchise/geodir_franchise.php' ) && geodir_franchise_enabled( $post_type ) ? true : false; |
|
4423 | + $is_franchise_active = is_plugin_active('geodir_franchise/geodir_franchise.php') && geodir_franchise_enabled($post_type) ? true : false; |
|
4424 | 4424 | if ($is_franchise_active) { |
4425 | - if ( isset( $gd_post['gd_is_franchise'] ) && (int)$gd_post['gd_is_franchise'] == 1 ) { |
|
4425 | + if (isset($gd_post['gd_is_franchise']) && (int) $gd_post['gd_is_franchise'] == 1) { |
|
4426 | 4426 | $gd_franchise_lock = array(); |
4427 | 4427 | |
4428 | - if ( isset( $gd_post['gd_franchise_lock'] ) ) { |
|
4429 | - $gd_franchise_lock = str_replace(" ", "", $gd_post['gd_franchise_lock'] ); |
|
4430 | - $gd_franchise_lock = trim( $gd_franchise_lock ); |
|
4431 | - $gd_franchise_lock = explode( ",", $gd_franchise_lock ); |
|
4428 | + if (isset($gd_post['gd_franchise_lock'])) { |
|
4429 | + $gd_franchise_lock = str_replace(" ", "", $gd_post['gd_franchise_lock']); |
|
4430 | + $gd_franchise_lock = trim($gd_franchise_lock); |
|
4431 | + $gd_franchise_lock = explode(",", $gd_franchise_lock); |
|
4432 | 4432 | } |
4433 | 4433 | |
4434 | - update_post_meta( $saved_post_id, 'gd_is_franchise', 1 ); |
|
4435 | - update_post_meta( $saved_post_id, 'gd_franchise_lock', $gd_franchise_lock ); |
|
4434 | + update_post_meta($saved_post_id, 'gd_is_franchise', 1); |
|
4435 | + update_post_meta($saved_post_id, 'gd_franchise_lock', $gd_franchise_lock); |
|
4436 | 4436 | } else { |
4437 | - if ( isset( $gd_post['franchise'] ) && (int)$gd_post['franchise'] > 0 && geodir_franchise_check( (int)$gd_post['franchise'] ) ) { |
|
4438 | - geodir_save_post_meta( $saved_post_id, 'franchise', (int)$gd_post['franchise'] ); |
|
4437 | + if (isset($gd_post['franchise']) && (int) $gd_post['franchise'] > 0 && geodir_franchise_check((int) $gd_post['franchise'])) { |
|
4438 | + geodir_save_post_meta($saved_post_id, 'franchise', (int) $gd_post['franchise']); |
|
4439 | 4439 | } |
4440 | 4440 | } |
4441 | 4441 | } |
4442 | 4442 | |
4443 | 4443 | if (!empty($save_post['post_category']) && is_array($save_post['post_category'])) { |
4444 | - $save_post['post_category'] = array_unique( array_map( 'intval', $save_post['post_category'] ) ); |
|
4444 | + $save_post['post_category'] = array_unique(array_map('intval', $save_post['post_category'])); |
|
4445 | 4445 | if ($default_category_id) { |
4446 | 4446 | $save_post['post_default_category'] = $default_category_id; |
4447 | 4447 | $gd_post['default_category'] = $default_category_id; |
@@ -4450,34 +4450,34 @@ discard block |
||
4450 | 4450 | } |
4451 | 4451 | |
4452 | 4452 | // Save post info |
4453 | - geodir_save_post_info( $saved_post_id, $gd_post ); |
|
4453 | + geodir_save_post_info($saved_post_id, $gd_post); |
|
4454 | 4454 | // post taxonomies |
4455 | - if ( !empty( $save_post['post_category'] ) ) { |
|
4456 | - wp_set_object_terms( $saved_post_id, $save_post['post_category'], $cat_taxonomy ); |
|
4455 | + if (!empty($save_post['post_category'])) { |
|
4456 | + wp_set_object_terms($saved_post_id, $save_post['post_category'], $cat_taxonomy); |
|
4457 | 4457 | |
4458 | - $post_default_category = isset( $save_post['post_default_category'] ) ? $save_post['post_default_category'] : ''; |
|
4458 | + $post_default_category = isset($save_post['post_default_category']) ? $save_post['post_default_category'] : ''; |
|
4459 | 4459 | if ($default_category_id) { |
4460 | 4460 | $post_default_category = $default_category_id; |
4461 | 4461 | } |
4462 | 4462 | $post_cat_ids = geodir_get_post_meta($saved_post_id, $cat_taxonomy); |
4463 | 4463 | $save_post['post_category'] = !empty($post_cat_ids) ? explode(",", trim($post_cat_ids, ",")) : $save_post['post_category']; |
4464 | - $post_category_str = !empty($save_post['post_category']) ? implode(",y:#", $save_post['post_category']) . ',y:' : ''; |
|
4464 | + $post_category_str = !empty($save_post['post_category']) ? implode(",y:#", $save_post['post_category']).',y:' : ''; |
|
4465 | 4465 | |
4466 | 4466 | if ($post_category_str != '' && $post_default_category) { |
4467 | - $post_category_str = str_replace($post_default_category . ',y:', $post_default_category . ',y,d:', $post_category_str); |
|
4467 | + $post_category_str = str_replace($post_default_category.',y:', $post_default_category.',y,d:', $post_category_str); |
|
4468 | 4468 | } |
4469 | 4469 | |
4470 | 4470 | $post_category_str = $post_category_str != '' ? array($cat_taxonomy => $post_category_str) : ''; |
4471 | 4471 | |
4472 | - geodir_set_postcat_structure( $saved_post_id, $cat_taxonomy, $post_default_category, $post_category_str ); |
|
4472 | + geodir_set_postcat_structure($saved_post_id, $cat_taxonomy, $post_default_category, $post_category_str); |
|
4473 | 4473 | } |
4474 | 4474 | |
4475 | - if ( !empty( $save_post['post_tags'] ) ) { |
|
4476 | - wp_set_object_terms( $saved_post_id, $save_post['post_tags'], $tags_taxonomy ); |
|
4475 | + if (!empty($save_post['post_tags'])) { |
|
4476 | + wp_set_object_terms($saved_post_id, $save_post['post_tags'], $tags_taxonomy); |
|
4477 | 4477 | } |
4478 | 4478 | |
4479 | 4479 | // Post images |
4480 | - if ( !empty( $post_images ) ) { |
|
4480 | + if (!empty($post_images)) { |
|
4481 | 4481 | $post_images = array_unique($post_images); |
4482 | 4482 | |
4483 | 4483 | $old_post_images_arr = array(); |
@@ -4485,61 +4485,61 @@ discard block |
||
4485 | 4485 | |
4486 | 4486 | $order = 1; |
4487 | 4487 | |
4488 | - $old_post_images = geodir_get_images( $saved_post_id ); |
|
4488 | + $old_post_images = geodir_get_images($saved_post_id); |
|
4489 | 4489 | if (!empty($old_post_images)) { |
4490 | - foreach( $old_post_images as $old_post_image ) { |
|
4490 | + foreach ($old_post_images as $old_post_image) { |
|
4491 | 4491 | if (!empty($old_post_image) && isset($old_post_image->file) && $old_post_image->file != '') { |
4492 | 4492 | $old_post_images_arr[] = $old_post_image->file; |
4493 | 4493 | } |
4494 | 4494 | } |
4495 | 4495 | } |
4496 | 4496 | |
4497 | - foreach ( $post_images as $post_image ) { |
|
4498 | - $image_name = basename( $post_image ); |
|
4497 | + foreach ($post_images as $post_image) { |
|
4498 | + $image_name = basename($post_image); |
|
4499 | 4499 | $saved_post_images_arr[] = $image_name; |
4500 | 4500 | |
4501 | - if (!empty($old_post_images_arr) && in_array( $image_name, $old_post_images_arr) ) { |
|
4501 | + if (!empty($old_post_images_arr) && in_array($image_name, $old_post_images_arr)) { |
|
4502 | 4502 | continue; // Skip if image already exists. |
4503 | 4503 | } |
4504 | 4504 | |
4505 | - $image_name_parts = explode( '.', $image_name ); |
|
4506 | - array_pop( $image_name_parts ); |
|
4507 | - $proper_image_name = implode( '.', $image_name_parts ); |
|
4505 | + $image_name_parts = explode('.', $image_name); |
|
4506 | + array_pop($image_name_parts); |
|
4507 | + $proper_image_name = implode('.', $image_name_parts); |
|
4508 | 4508 | |
4509 | - $arr_file_type = wp_check_filetype( $image_name ); |
|
4509 | + $arr_file_type = wp_check_filetype($image_name); |
|
4510 | 4510 | |
4511 | - if ( !empty( $arr_file_type ) ) { |
|
4511 | + if (!empty($arr_file_type)) { |
|
4512 | 4512 | $uploaded_file_type = $arr_file_type['type']; |
4513 | 4513 | |
4514 | 4514 | $attachment = array(); |
4515 | 4515 | $attachment['post_id'] = $saved_post_id; |
4516 | 4516 | $attachment['title'] = $proper_image_name; |
4517 | 4517 | $attachment['content'] = ''; |
4518 | - $attachment['file'] = $uploads_subdir . '/' . $image_name; |
|
4518 | + $attachment['file'] = $uploads_subdir.'/'.$image_name; |
|
4519 | 4519 | $attachment['mime_type'] = $uploaded_file_type; |
4520 | 4520 | $attachment['menu_order'] = $order; |
4521 | 4521 | $attachment['is_featured'] = 0; |
4522 | 4522 | |
4523 | 4523 | $attachment_set = ''; |
4524 | - foreach ( $attachment as $key => $val ) { |
|
4525 | - if ( $val != '' ) { |
|
4526 | - $attachment_set .= $key . " = '" . $val . "', "; |
|
4524 | + foreach ($attachment as $key => $val) { |
|
4525 | + if ($val != '') { |
|
4526 | + $attachment_set .= $key." = '".$val."', "; |
|
4527 | 4527 | } |
4528 | 4528 | } |
4529 | - $attachment_set = trim( $attachment_set, ", " ); |
|
4529 | + $attachment_set = trim($attachment_set, ", "); |
|
4530 | 4530 | |
4531 | 4531 | // Add new attachment |
4532 | - $wpdb->query( "INSERT INTO " . GEODIR_ATTACHMENT_TABLE . " SET " . $attachment_set ); |
|
4532 | + $wpdb->query("INSERT INTO ".GEODIR_ATTACHMENT_TABLE." SET ".$attachment_set); |
|
4533 | 4533 | |
4534 | 4534 | $order++; |
4535 | 4535 | } |
4536 | 4536 | } |
4537 | 4537 | |
4538 | - $saved_post_images_sql = !empty($saved_post_images_arr) ? " AND ( file NOT LIKE '%/" . implode("' AND file NOT LIKE '%/", $saved_post_images_arr) . "' )" : ''; |
|
4538 | + $saved_post_images_sql = !empty($saved_post_images_arr) ? " AND ( file NOT LIKE '%/".implode("' AND file NOT LIKE '%/", $saved_post_images_arr)."' )" : ''; |
|
4539 | 4539 | // Remove previous attachment |
4540 | - $wpdb->query( "DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id = " . (int)$saved_post_id . " " . $saved_post_images_sql ); |
|
4540 | + $wpdb->query("DELETE FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id = ".(int) $saved_post_id." ".$saved_post_images_sql); |
|
4541 | 4541 | |
4542 | - if ( !empty( $saved_post_images_arr ) ) { |
|
4542 | + if (!empty($saved_post_images_arr)) { |
|
4543 | 4543 | geodir_set_wp_featured_image($saved_post_id); |
4544 | 4544 | /* |
4545 | 4545 | $menu_order = 1; |
@@ -4556,13 +4556,13 @@ discard block |
||
4556 | 4556 | }*/ |
4557 | 4557 | } |
4558 | 4558 | |
4559 | - if ( $order > 1 ) { |
|
4559 | + if ($order > 1) { |
|
4560 | 4560 | $images++; |
4561 | 4561 | } |
4562 | 4562 | } |
4563 | 4563 | |
4564 | 4564 | /** This action is documented in geodirectory-functions/post-functions.php */ |
4565 | - do_action( 'geodir_after_save_listing', $saved_post_id, $gd_post ); |
|
4565 | + do_action('geodir_after_save_listing', $saved_post_id, $gd_post); |
|
4566 | 4566 | |
4567 | 4567 | if (isset($is_featured)) { |
4568 | 4568 | geodir_save_post_meta($saved_post_id, 'is_featured', $is_featured); |
@@ -4582,10 +4582,10 @@ discard block |
||
4582 | 4582 | } |
4583 | 4583 | |
4584 | 4584 | //undo some stuff to make the import quicker |
4585 | - wp_defer_term_counting( false ); |
|
4586 | - wp_defer_comment_counting( false ); |
|
4587 | - $wpdb->query( 'COMMIT;' ); |
|
4588 | - $wpdb->query( 'SET autocommit = 1;' ); |
|
4585 | + wp_defer_term_counting(false); |
|
4586 | + wp_defer_comment_counting(false); |
|
4587 | + $wpdb->query('COMMIT;'); |
|
4588 | + $wpdb->query('SET autocommit = 1;'); |
|
4589 | 4589 | |
4590 | 4590 | $json = array(); |
4591 | 4591 | $json['processed'] = $processed_actual; |
@@ -4596,9 +4596,9 @@ discard block |
||
4596 | 4596 | $json['invalid_addr'] = $invalid_addr; |
4597 | 4597 | $json['images'] = $images; |
4598 | 4598 | |
4599 | - wp_send_json( $json ); |
|
4599 | + wp_send_json($json); |
|
4600 | 4600 | exit; |
4601 | - } else if ( $task == 'import_loc' ) { |
|
4601 | + } else if ($task == 'import_loc') { |
|
4602 | 4602 | global $gd_post_types; |
4603 | 4603 | $gd_post_types = $post_types; |
4604 | 4604 | |
@@ -4607,82 +4607,82 @@ discard block |
||
4607 | 4607 | |
4608 | 4608 | if (empty($columns) || (!empty($columns) && $columns[0] == '')) { |
4609 | 4609 | $json['error'] = __('File you are uploading is not valid. Columns does not matching.', 'geodirectory'); |
4610 | - wp_send_json( $json ); |
|
4610 | + wp_send_json($json); |
|
4611 | 4611 | } |
4612 | 4612 | |
4613 | 4613 | $gd_error_log = __('GD IMPORT LOCATIONS [ROW %d]:', 'geodirectory'); |
4614 | - $gd_error_location = __( 'Could not be saved due to blank/invalid address(city, region, country, latitude, longitude)', 'geodirectory' ); |
|
4614 | + $gd_error_location = __('Could not be saved due to blank/invalid address(city, region, country, latitude, longitude)', 'geodirectory'); |
|
4615 | 4615 | for ($i = 1; $i <= $limit; $i++) { |
4616 | 4616 | $index = $processed + $i; |
4617 | 4617 | |
4618 | 4618 | if (isset($file[$index])) { |
4619 | 4619 | $row = $file[$index]; |
4620 | - $row = array_map( 'trim', $row ); |
|
4620 | + $row = array_map('trim', $row); |
|
4621 | 4621 | $data = array(); |
4622 | 4622 | |
4623 | - foreach ($columns as $c => $column ) { |
|
4623 | + foreach ($columns as $c => $column) { |
|
4624 | 4624 | if (in_array($column, array('location_id', 'latitude', 'longitude', 'city', 'city_slug', 'region', 'country', 'city_meta_title', 'city_meta_desc', 'city_desc', 'region_meta_title', 'region_meta_desc', 'region_desc', 'country_meta_title', 'country_meta_desc', 'country_desc'))) { |
4625 | 4625 | $data[$column] = $row[$c]; |
4626 | 4626 | } |
4627 | 4627 | } |
4628 | 4628 | |
4629 | - if ( empty($data['city']) || empty($data['region']) || empty($data['country']) || empty($data['latitude']) || empty($data['longitude']) ) { |
|
4629 | + if (empty($data['city']) || empty($data['region']) || empty($data['country']) || empty($data['latitude']) || empty($data['longitude'])) { |
|
4630 | 4630 | $invalid++; |
4631 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_location ); |
|
4631 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$gd_error_location); |
|
4632 | 4632 | continue; |
4633 | 4633 | } |
4634 | 4634 | |
4635 | 4635 | $data['location_id'] = isset($data['location_id']) ? absint($data['location_id']) : 0; |
4636 | 4636 | |
4637 | - if ( $import_choice == 'update' ) { |
|
4638 | - if ( (int)$data['location_id'] > 0 && $location = geodir_get_location_by_id( '', (int)$data['location_id'] ) ) { |
|
4639 | - if ( $location_id = geodir_location_update_city( $data, true, $location ) ) { |
|
4637 | + if ($import_choice == 'update') { |
|
4638 | + if ((int) $data['location_id'] > 0 && $location = geodir_get_location_by_id('', (int) $data['location_id'])) { |
|
4639 | + if ($location_id = geodir_location_update_city($data, true, $location)) { |
|
4640 | 4640 | $updated++; |
4641 | 4641 | } else { |
4642 | 4642 | $invalid++; |
4643 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_location ); |
|
4643 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$gd_error_location); |
|
4644 | 4644 | } |
4645 | - } else if ( !empty( $data['city_slug'] ) && $location = geodir_get_location_by_slug( 'city', array( 'city_slug' => $data['city_slug'] ) ) ) { |
|
4646 | - $data['location_id'] = (int)$location->location_id; |
|
4645 | + } else if (!empty($data['city_slug']) && $location = geodir_get_location_by_slug('city', array('city_slug' => $data['city_slug']))) { |
|
4646 | + $data['location_id'] = (int) $location->location_id; |
|
4647 | 4647 | |
4648 | - if ( $location = geodir_get_location_by_slug( 'city', array( 'city_slug' => $data['city_slug'], 'country' => $data['country'], 'region' => $data['region'] ) ) ) { |
|
4649 | - $data['location_id'] = (int)$location->location_id; |
|
4650 | - } else if ( $location = geodir_get_location_by_slug( 'city', array( 'city_slug' => $data['city_slug'], 'region' => $data['region'] ) ) ) { |
|
4651 | - $data['location_id'] = (int)$location->location_id; |
|
4652 | - } else if ( $location = geodir_get_location_by_slug( 'city', array( 'city_slug' => $data['city_slug'], 'country' => $data['country'] ) ) ) { |
|
4653 | - $data['location_id'] = (int)$location->location_id; |
|
4648 | + if ($location = geodir_get_location_by_slug('city', array('city_slug' => $data['city_slug'], 'country' => $data['country'], 'region' => $data['region']))) { |
|
4649 | + $data['location_id'] = (int) $location->location_id; |
|
4650 | + } else if ($location = geodir_get_location_by_slug('city', array('city_slug' => $data['city_slug'], 'region' => $data['region']))) { |
|
4651 | + $data['location_id'] = (int) $location->location_id; |
|
4652 | + } else if ($location = geodir_get_location_by_slug('city', array('city_slug' => $data['city_slug'], 'country' => $data['country']))) { |
|
4653 | + $data['location_id'] = (int) $location->location_id; |
|
4654 | 4654 | } |
4655 | 4655 | |
4656 | - if ( $location_id = geodir_location_update_city( $data, true, $location ) ) { |
|
4656 | + if ($location_id = geodir_location_update_city($data, true, $location)) { |
|
4657 | 4657 | $updated++; |
4658 | 4658 | } else { |
4659 | 4659 | $invalid++; |
4660 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_location ); |
|
4660 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$gd_error_location); |
|
4661 | 4661 | } |
4662 | 4662 | } else { |
4663 | - if ( $location_id = geodir_location_insert_city( $data, true ) ) { |
|
4663 | + if ($location_id = geodir_location_insert_city($data, true)) { |
|
4664 | 4664 | $created++; |
4665 | 4665 | } else { |
4666 | 4666 | $invalid++; |
4667 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_location ); |
|
4667 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$gd_error_location); |
|
4668 | 4668 | } |
4669 | 4669 | } |
4670 | - } elseif ( $import_choice == 'skip' ) { |
|
4671 | - if ( (int)$data['location_id'] > 0 && $location = geodir_get_location_by_id( '', (int)$data['location_id'] ) ) { |
|
4670 | + } elseif ($import_choice == 'skip') { |
|
4671 | + if ((int) $data['location_id'] > 0 && $location = geodir_get_location_by_id('', (int) $data['location_id'])) { |
|
4672 | 4672 | $skipped++; |
4673 | - } else if ( !empty( $data['city_slug'] ) && $location = geodir_get_location_by_slug( 'city', array( 'city_slug' => $data['city_slug'] ) ) ) { |
|
4673 | + } else if (!empty($data['city_slug']) && $location = geodir_get_location_by_slug('city', array('city_slug' => $data['city_slug']))) { |
|
4674 | 4674 | $skipped++; |
4675 | 4675 | } else { |
4676 | - if ( $location_id = geodir_location_insert_city( $data, true ) ) { |
|
4676 | + if ($location_id = geodir_location_insert_city($data, true)) { |
|
4677 | 4677 | $created++; |
4678 | 4678 | } else { |
4679 | 4679 | $invalid++; |
4680 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_location ); |
|
4680 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$gd_error_location); |
|
4681 | 4681 | } |
4682 | 4682 | } |
4683 | 4683 | } else { |
4684 | 4684 | $invalid++; |
4685 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_location ); |
|
4685 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$gd_error_location); |
|
4686 | 4686 | } |
4687 | 4687 | } |
4688 | 4688 | } |
@@ -4696,24 +4696,24 @@ discard block |
||
4696 | 4696 | $json['invalid'] = $invalid; |
4697 | 4697 | $json['images'] = $images; |
4698 | 4698 | |
4699 | - wp_send_json( $json ); |
|
4700 | - } else if ( $task == 'import_hood' ) { |
|
4699 | + wp_send_json($json); |
|
4700 | + } else if ($task == 'import_hood') { |
|
4701 | 4701 | if (!empty($file)) { |
4702 | 4702 | $columns = isset($file[0]) ? $file[0] : NULL; |
4703 | 4703 | |
4704 | 4704 | if (empty($columns) || (!empty($columns) && $columns[0] == '')) { |
4705 | 4705 | $json['error'] = __('File you are uploading is not valid. Columns does not matching.', 'geodirectory'); |
4706 | - wp_send_json( $json ); |
|
4706 | + wp_send_json($json); |
|
4707 | 4707 | } |
4708 | 4708 | |
4709 | 4709 | $gd_error_log = __('GD IMPORT NEIGHBOURHOODS [ROW %d]:', 'geodirectory'); |
4710 | - $gd_error_hood = __( 'Could not be saved due to invalid neighbourhood data(name, latitude, longitude) or invalid location data(either location_id or city/region/country is empty)', 'geodirectory' ); |
|
4710 | + $gd_error_hood = __('Could not be saved due to invalid neighbourhood data(name, latitude, longitude) or invalid location data(either location_id or city/region/country is empty)', 'geodirectory'); |
|
4711 | 4711 | for ($i = 1; $i <= $limit; $i++) { |
4712 | 4712 | $index = $processed + $i; |
4713 | 4713 | |
4714 | 4714 | if (isset($file[$index])) { |
4715 | 4715 | $row = $file[$index]; |
4716 | - $row = array_map( 'trim', $row ); |
|
4716 | + $row = array_map('trim', $row); |
|
4717 | 4717 | $data = array(); |
4718 | 4718 | |
4719 | 4719 | foreach ($columns as $c => $column) { |
@@ -4724,20 +4724,20 @@ discard block |
||
4724 | 4724 | |
4725 | 4725 | if (empty($data['neighbourhood_name']) || empty($data['latitude']) || empty($data['longitude'])) { |
4726 | 4726 | $invalid++; |
4727 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_hood ); |
|
4727 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$gd_error_hood); |
|
4728 | 4728 | continue; |
4729 | 4729 | } |
4730 | 4730 | |
4731 | 4731 | $location_info = array(); |
4732 | - if (!empty($data['location_id']) && (int)$data['location_id'] > 0) { |
|
4733 | - $location_info = geodir_get_location_by_id('', (int)$data['location_id']); |
|
4732 | + if (!empty($data['location_id']) && (int) $data['location_id'] > 0) { |
|
4733 | + $location_info = geodir_get_location_by_id('', (int) $data['location_id']); |
|
4734 | 4734 | } else if (!empty($data['city']) && !empty($data['region']) && !empty($data['country'])) { |
4735 | 4735 | $location_info = geodir_get_location_by_slug('city', array('fields' => 'location_id', 'city' => $data['city'], 'country' => $data['country'], 'region' => $data['region'])); |
4736 | 4736 | } |
4737 | 4737 | |
4738 | 4738 | if (empty($location_info)) { |
4739 | 4739 | $invalid++; |
4740 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_hood ); |
|
4740 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$gd_error_hood); |
|
4741 | 4741 | continue; |
4742 | 4742 | } |
4743 | 4743 | |
@@ -4752,35 +4752,35 @@ discard block |
||
4752 | 4752 | $hood_data['hood_longitude'] = $data['longitude']; |
4753 | 4753 | $hood_data['hood_location_id'] = $location_id; |
4754 | 4754 | |
4755 | - if ( $import_choice == 'update' ) { |
|
4756 | - if ((int)$data['neighbourhood_id'] > 0 && ($neighbourhood = geodir_location_get_neighbourhood_by_id((int)$data['neighbourhood_id']))) { |
|
4757 | - $hood_data['hood_id'] = (int)$data['neighbourhood_id']; |
|
4755 | + if ($import_choice == 'update') { |
|
4756 | + if ((int) $data['neighbourhood_id'] > 0 && ($neighbourhood = geodir_location_get_neighbourhood_by_id((int) $data['neighbourhood_id']))) { |
|
4757 | + $hood_data['hood_id'] = (int) $data['neighbourhood_id']; |
|
4758 | 4758 | |
4759 | 4759 | if ($neighbourhood = geodir_location_insert_update_neighbourhood($hood_data)) { |
4760 | 4760 | $updated++; |
4761 | 4761 | } else { |
4762 | 4762 | $invalid++; |
4763 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_hood ); |
|
4763 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$gd_error_hood); |
|
4764 | 4764 | } |
4765 | 4765 | } else if (!empty($data['neighbourhood_slug']) && ($neighbourhood = geodir_location_get_neighbourhood_by_id($data['neighbourhood_slug'], true))) { |
4766 | - $hood_data['hood_id'] = (int)$neighbourhood->hood_id; |
|
4766 | + $hood_data['hood_id'] = (int) $neighbourhood->hood_id; |
|
4767 | 4767 | |
4768 | 4768 | if ($neighbourhood = geodir_location_insert_update_neighbourhood($hood_data)) { |
4769 | 4769 | $updated++; |
4770 | 4770 | } else { |
4771 | 4771 | $invalid++; |
4772 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_hood ); |
|
4772 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$gd_error_hood); |
|
4773 | 4773 | } |
4774 | 4774 | } else { |
4775 | 4775 | if ($neighbourhood = geodir_location_insert_update_neighbourhood($hood_data)) { |
4776 | 4776 | $created++; |
4777 | 4777 | } else { |
4778 | 4778 | $invalid++; |
4779 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_hood ); |
|
4779 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$gd_error_hood); |
|
4780 | 4780 | } |
4781 | 4781 | } |
4782 | - } elseif ( $import_choice == 'skip' ) { |
|
4783 | - if ((int)$data['neighbourhood_id'] > 0 && ($neighbourhood = geodir_location_get_neighbourhood_by_id((int)$data['neighbourhood_id']))) { |
|
4782 | + } elseif ($import_choice == 'skip') { |
|
4783 | + if ((int) $data['neighbourhood_id'] > 0 && ($neighbourhood = geodir_location_get_neighbourhood_by_id((int) $data['neighbourhood_id']))) { |
|
4784 | 4784 | $skipped++; |
4785 | 4785 | } else if (!empty($data['neighbourhood_slug']) && ($neighbourhood = geodir_location_get_neighbourhood_by_id($data['neighbourhood_slug'], true))) { |
4786 | 4786 | $skipped++; |
@@ -4790,12 +4790,12 @@ discard block |
||
4790 | 4790 | $created++; |
4791 | 4791 | } else { |
4792 | 4792 | $invalid++; |
4793 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_hood ); |
|
4793 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$gd_error_hood); |
|
4794 | 4794 | } |
4795 | 4795 | } |
4796 | 4796 | } else { |
4797 | 4797 | $invalid++; |
4798 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_hood ); |
|
4798 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$gd_error_hood); |
|
4799 | 4799 | } |
4800 | 4800 | } |
4801 | 4801 | } |
@@ -4809,7 +4809,7 @@ discard block |
||
4809 | 4809 | $json['invalid'] = $invalid; |
4810 | 4810 | $json['images'] = $images; |
4811 | 4811 | |
4812 | - wp_send_json( $json ); |
|
4812 | + wp_send_json($json); |
|
4813 | 4813 | } |
4814 | 4814 | } |
4815 | 4815 | break; |
@@ -4853,29 +4853,29 @@ discard block |
||
4853 | 4853 | * } |
4854 | 4854 | * @return int|bool Term id when success, false when fail. |
4855 | 4855 | */ |
4856 | -function geodir_imex_insert_term( $taxonomy, $term_data ) { |
|
4857 | - if ( empty( $taxonomy ) || empty( $term_data ) ) { |
|
4856 | +function geodir_imex_insert_term($taxonomy, $term_data) { |
|
4857 | + if (empty($taxonomy) || empty($term_data)) { |
|
4858 | 4858 | return false; |
4859 | 4859 | } |
4860 | 4860 | |
4861 | - $term = isset( $term_data['name'] ) && !empty( $term_data['name'] ) ? $term_data['name'] : ''; |
|
4861 | + $term = isset($term_data['name']) && !empty($term_data['name']) ? $term_data['name'] : ''; |
|
4862 | 4862 | $args = array(); |
4863 | - $args['description'] = isset( $term_data['description'] ) ? $term_data['description'] : ''; |
|
4864 | - $args['slug'] = isset( $term_data['slug'] ) ? $term_data['slug'] : ''; |
|
4865 | - $args['parent'] = isset( $term_data['parent'] ) ? (int)$term_data['parent'] : ''; |
|
4863 | + $args['description'] = isset($term_data['description']) ? $term_data['description'] : ''; |
|
4864 | + $args['slug'] = isset($term_data['slug']) ? $term_data['slug'] : ''; |
|
4865 | + $args['parent'] = isset($term_data['parent']) ? (int) $term_data['parent'] : ''; |
|
4866 | 4866 | |
4867 | - if ( ( !empty( $args['slug'] ) && term_exists( $args['slug'], $taxonomy ) ) || empty( $args['slug'] ) ) { |
|
4868 | - $term_args = array_merge( $term_data, $args ); |
|
4869 | - $defaults = array( 'alias_of' => '', 'description' => '', 'parent' => 0, 'slug' => ''); |
|
4870 | - $term_args = wp_parse_args( $term_args, $defaults ); |
|
4871 | - $term_args = sanitize_term( $term_args, $taxonomy, 'db' ); |
|
4872 | - $args['slug'] = wp_unique_term_slug( $args['slug'], (object)$term_args ); |
|
4867 | + if ((!empty($args['slug']) && term_exists($args['slug'], $taxonomy)) || empty($args['slug'])) { |
|
4868 | + $term_args = array_merge($term_data, $args); |
|
4869 | + $defaults = array('alias_of' => '', 'description' => '', 'parent' => 0, 'slug' => ''); |
|
4870 | + $term_args = wp_parse_args($term_args, $defaults); |
|
4871 | + $term_args = sanitize_term($term_args, $taxonomy, 'db'); |
|
4872 | + $args['slug'] = wp_unique_term_slug($args['slug'], (object) $term_args); |
|
4873 | 4873 | } |
4874 | 4874 | |
4875 | - if( !empty( $term ) ) { |
|
4876 | - $result = wp_insert_term( $term, $taxonomy, $args ); |
|
4877 | - if( !is_wp_error( $result ) ) { |
|
4878 | - return isset( $result['term_id'] ) ? $result['term_id'] : 0; |
|
4875 | + if (!empty($term)) { |
|
4876 | + $result = wp_insert_term($term, $taxonomy, $args); |
|
4877 | + if (!is_wp_error($result)) { |
|
4878 | + return isset($result['term_id']) ? $result['term_id'] : 0; |
|
4879 | 4879 | } |
4880 | 4880 | } |
4881 | 4881 | |
@@ -4905,36 +4905,36 @@ discard block |
||
4905 | 4905 | * } |
4906 | 4906 | * @return int|bool Term id when success, false when fail. |
4907 | 4907 | */ |
4908 | -function geodir_imex_update_term( $taxonomy, $term_data ) { |
|
4909 | - if ( empty( $taxonomy ) || empty( $term_data ) ) { |
|
4908 | +function geodir_imex_update_term($taxonomy, $term_data) { |
|
4909 | + if (empty($taxonomy) || empty($term_data)) { |
|
4910 | 4910 | return false; |
4911 | 4911 | } |
4912 | 4912 | |
4913 | - $term_id = isset( $term_data['term_id'] ) && !empty( $term_data['term_id'] ) ? $term_data['term_id'] : 0; |
|
4913 | + $term_id = isset($term_data['term_id']) && !empty($term_data['term_id']) ? $term_data['term_id'] : 0; |
|
4914 | 4914 | |
4915 | 4915 | $args = array(); |
4916 | - $args['description'] = isset( $term_data['description'] ) ? $term_data['description'] : ''; |
|
4917 | - $args['slug'] = isset( $term_data['slug'] ) ? $term_data['slug'] : ''; |
|
4918 | - $args['parent'] = isset( $term_data['parent'] ) ? (int)$term_data['parent'] : ''; |
|
4916 | + $args['description'] = isset($term_data['description']) ? $term_data['description'] : ''; |
|
4917 | + $args['slug'] = isset($term_data['slug']) ? $term_data['slug'] : ''; |
|
4918 | + $args['parent'] = isset($term_data['parent']) ? (int) $term_data['parent'] : ''; |
|
4919 | 4919 | |
4920 | - if ( $term_id > 0 && $term_info = (array)get_term( $term_id, $taxonomy ) ) { |
|
4920 | + if ($term_id > 0 && $term_info = (array) get_term($term_id, $taxonomy)) { |
|
4921 | 4921 | $term_data['term_id'] = $term_info['term_id']; |
4922 | 4922 | |
4923 | - $result = wp_update_term( $term_data['term_id'], $taxonomy, $term_data ); |
|
4923 | + $result = wp_update_term($term_data['term_id'], $taxonomy, $term_data); |
|
4924 | 4924 | |
4925 | - if( !is_wp_error( $result ) ) { |
|
4926 | - return isset( $result['term_id'] ) ? $result['term_id'] : 0; |
|
4925 | + if (!is_wp_error($result)) { |
|
4926 | + return isset($result['term_id']) ? $result['term_id'] : 0; |
|
4927 | 4927 | } |
4928 | - } else if ( $term_data['slug'] != '' && $term_info = (array)term_exists( $term_data['slug'], $taxonomy ) ) { |
|
4928 | + } else if ($term_data['slug'] != '' && $term_info = (array) term_exists($term_data['slug'], $taxonomy)) { |
|
4929 | 4929 | $term_data['term_id'] = $term_info['term_id']; |
4930 | 4930 | |
4931 | - $result = wp_update_term( $term_data['term_id'], $taxonomy, $term_data ); |
|
4931 | + $result = wp_update_term($term_data['term_id'], $taxonomy, $term_data); |
|
4932 | 4932 | |
4933 | - if( !is_wp_error( $result ) ) { |
|
4934 | - return isset( $result['term_id'] ) ? $result['term_id'] : 0; |
|
4933 | + if (!is_wp_error($result)) { |
|
4934 | + return isset($result['term_id']) ? $result['term_id'] : 0; |
|
4935 | 4935 | } |
4936 | 4936 | } else { |
4937 | - return geodir_imex_insert_term( $taxonomy, $term_data ); |
|
4937 | + return geodir_imex_insert_term($taxonomy, $term_data); |
|
4938 | 4938 | } |
4939 | 4939 | |
4940 | 4940 | return false; |
@@ -4953,20 +4953,20 @@ discard block |
||
4953 | 4953 | * @param string $post_type Post type. |
4954 | 4954 | * @return int Posts count. |
4955 | 4955 | */ |
4956 | -function geodir_get_posts_count( $post_type ) { |
|
4956 | +function geodir_get_posts_count($post_type) { |
|
4957 | 4957 | global $wpdb, $plugin_prefix; |
4958 | 4958 | |
4959 | - if ( !post_type_exists( $post_type ) ) { |
|
4959 | + if (!post_type_exists($post_type)) { |
|
4960 | 4960 | return 0; |
4961 | 4961 | } |
4962 | 4962 | |
4963 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
4963 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
4964 | 4964 | |
4965 | 4965 | // Skip listing with statuses trash, auto-draft etc... |
4966 | 4966 | $skip_statuses = geodir_imex_export_skip_statuses(); |
4967 | 4967 | $where_statuses = ''; |
4968 | - if ( !empty( $skip_statuses ) && is_array( $skip_statuses ) ) { |
|
4969 | - $where_statuses = "AND `" . $wpdb->posts . "`.`post_status` NOT IN('" . implode( "','", $skip_statuses ) . "')"; |
|
4968 | + if (!empty($skip_statuses) && is_array($skip_statuses)) { |
|
4969 | + $where_statuses = "AND `".$wpdb->posts."`.`post_status` NOT IN('".implode("','", $skip_statuses)."')"; |
|
4970 | 4970 | } |
4971 | 4971 | |
4972 | 4972 | /** |
@@ -4977,11 +4977,11 @@ discard block |
||
4977 | 4977 | * |
4978 | 4978 | * @param string $where SQL where clause part. |
4979 | 4979 | */ |
4980 | - $where_statuses = apply_filters( 'geodir_get_posts_count', $where_statuses, $post_type ); |
|
4980 | + $where_statuses = apply_filters('geodir_get_posts_count', $where_statuses, $post_type); |
|
4981 | 4981 | |
4982 | - $query = $wpdb->prepare( "SELECT COUNT({$wpdb->posts}.ID) FROM {$wpdb->posts} INNER JOIN {$table} ON {$table}.post_id = {$wpdb->posts}.ID WHERE {$wpdb->posts}.post_type = %s " . $where_statuses, $post_type ); |
|
4982 | + $query = $wpdb->prepare("SELECT COUNT({$wpdb->posts}.ID) FROM {$wpdb->posts} INNER JOIN {$table} ON {$table}.post_id = {$wpdb->posts}.ID WHERE {$wpdb->posts}.post_type = %s ".$where_statuses, $post_type); |
|
4983 | 4983 | |
4984 | - $posts_count = (int)$wpdb->get_var( $query ); |
|
4984 | + $posts_count = (int) $wpdb->get_var($query); |
|
4985 | 4985 | |
4986 | 4986 | /** |
4987 | 4987 | * Modify returned post counts for the current post type. |
@@ -4992,7 +4992,7 @@ discard block |
||
4992 | 4992 | * @param int $posts_count Post counts. |
4993 | 4993 | * @param string $post_type Post type. |
4994 | 4994 | */ |
4995 | - $posts_count = apply_filters( 'geodir_imex_count_posts', $posts_count, $post_type ); |
|
4995 | + $posts_count = apply_filters('geodir_imex_count_posts', $posts_count, $post_type); |
|
4996 | 4996 | |
4997 | 4997 | return $posts_count; |
4998 | 4998 | } |
@@ -5013,19 +5013,19 @@ discard block |
||
5013 | 5013 | * @param int $page_no Page number. Default 0. |
5014 | 5014 | * @return array Array of posts data. |
5015 | 5015 | */ |
5016 | -function geodir_imex_get_posts( $post_type, $per_page = 0, $page_no = 0 ) { |
|
5016 | +function geodir_imex_get_posts($post_type, $per_page = 0, $page_no = 0) { |
|
5017 | 5017 | global $wp_filesystem; |
5018 | 5018 | |
5019 | - $posts = geodir_get_export_posts( $post_type, $per_page, $page_no ); |
|
5019 | + $posts = geodir_get_export_posts($post_type, $per_page, $page_no); |
|
5020 | 5020 | |
5021 | 5021 | $csv_rows = array(); |
5022 | 5022 | |
5023 | - if ( !empty( $posts ) ) { |
|
5024 | - $is_payment_plugin = is_plugin_active( 'geodir_payment_manager/geodir_payment_manager.php' ); |
|
5023 | + if (!empty($posts)) { |
|
5024 | + $is_payment_plugin = is_plugin_active('geodir_payment_manager/geodir_payment_manager.php'); |
|
5025 | 5025 | $location_manager = function_exists('geodir_location_plugin_activated') ? true : false; // Check location manager installed & active. |
5026 | - $location_allowed = function_exists( 'geodir_cpt_no_location' ) && geodir_cpt_no_location( $post_type ) ? false : true; |
|
5026 | + $location_allowed = function_exists('geodir_cpt_no_location') && geodir_cpt_no_location($post_type) ? false : true; |
|
5027 | 5027 | $neighbourhood_active = $location_manager && $location_allowed && get_option('location_neighbourhoods') ? true : false; |
5028 | - $is_claim_active = is_plugin_active( 'geodir_claim_listing/geodir_claim_listing.php' ) && get_option('geodir_claim_enable') === 'yes' ? true : false; |
|
5028 | + $is_claim_active = is_plugin_active('geodir_claim_listing/geodir_claim_listing.php') && get_option('geodir_claim_enable') === 'yes' ? true : false; |
|
5029 | 5029 | |
5030 | 5030 | $csv_row = array(); |
5031 | 5031 | $csv_row[] = 'post_id'; |
@@ -5036,7 +5036,7 @@ discard block |
||
5036 | 5036 | $csv_row[] = 'default_category'; |
5037 | 5037 | $csv_row[] = 'post_tags'; |
5038 | 5038 | $csv_row[] = 'post_type'; |
5039 | - if ( $post_type == 'gd_event' ) { |
|
5039 | + if ($post_type == 'gd_event') { |
|
5040 | 5040 | $csv_row[] = 'event_date'; |
5041 | 5041 | $csv_row[] = 'event_enddate'; |
5042 | 5042 | $csv_row[] = 'starttime'; |
@@ -5094,15 +5094,15 @@ discard block |
||
5094 | 5094 | } |
5095 | 5095 | // WPML |
5096 | 5096 | |
5097 | - $custom_fields = geodir_imex_get_custom_fields( $post_type ); |
|
5098 | - if ( !empty( $custom_fields ) ) { |
|
5099 | - foreach ( $custom_fields as $custom_field ) { |
|
5097 | + $custom_fields = geodir_imex_get_custom_fields($post_type); |
|
5098 | + if (!empty($custom_fields)) { |
|
5099 | + foreach ($custom_fields as $custom_field) { |
|
5100 | 5100 | $csv_row[] = $custom_field->htmlvar_name; |
5101 | 5101 | } |
5102 | 5102 | } |
5103 | 5103 | |
5104 | 5104 | // Export franchise fields |
5105 | - $is_franchise_active = is_plugin_active( 'geodir_franchise/geodir_franchise.php' ) && geodir_franchise_enabled( $post_type ) ? true : false; |
|
5105 | + $is_franchise_active = is_plugin_active('geodir_franchise/geodir_franchise.php') && geodir_franchise_enabled($post_type) ? true : false; |
|
5106 | 5106 | if ($is_franchise_active) { |
5107 | 5107 | $csv_row[] = 'gd_is_franchise'; |
5108 | 5108 | $csv_row[] = 'gd_franchise_lock'; |
@@ -5123,28 +5123,28 @@ discard block |
||
5123 | 5123 | $csv_rows[] = $csv_row; |
5124 | 5124 | |
5125 | 5125 | $images_count = 5; |
5126 | - $xx=0; |
|
5127 | - foreach ( $posts as $post ) {$xx++; |
|
5126 | + $xx = 0; |
|
5127 | + foreach ($posts as $post) {$xx++; |
|
5128 | 5128 | $post_id = $post['ID']; |
5129 | 5129 | |
5130 | - $gd_post_info = geodir_get_post_info( $post_id ); |
|
5131 | - $post_info = (array)$gd_post_info; |
|
5130 | + $gd_post_info = geodir_get_post_info($post_id); |
|
5131 | + $post_info = (array) $gd_post_info; |
|
5132 | 5132 | |
5133 | - $taxonomy_category = $post_type . 'category'; |
|
5134 | - $taxonomy_tags = $post_type . '_tags'; |
|
5133 | + $taxonomy_category = $post_type.'category'; |
|
5134 | + $taxonomy_tags = $post_type.'_tags'; |
|
5135 | 5135 | |
5136 | 5136 | $post_category = ''; |
5137 | 5137 | $default_category_id = $gd_post_info->default_category; |
5138 | 5138 | $default_category = ''; |
5139 | 5139 | $post_tags = ''; |
5140 | - $terms = wp_get_post_terms( $post_id, array( $taxonomy_category, $taxonomy_tags ) ); |
|
5140 | + $terms = wp_get_post_terms($post_id, array($taxonomy_category, $taxonomy_tags)); |
|
5141 | 5141 | |
5142 | - if ( !empty( $terms ) && !is_wp_error( $terms ) ) { |
|
5142 | + if (!empty($terms) && !is_wp_error($terms)) { |
|
5143 | 5143 | $post_category = array(); |
5144 | 5144 | $post_tags = array(); |
5145 | 5145 | |
5146 | - foreach ( $terms as $term ) { |
|
5147 | - if ( $term->taxonomy == $taxonomy_category ) { |
|
5146 | + foreach ($terms as $term) { |
|
5147 | + if ($term->taxonomy == $taxonomy_category) { |
|
5148 | 5148 | $post_category[] = $term->name; |
5149 | 5149 | |
5150 | 5150 | if ($default_category_id == $term->term_id) { |
@@ -5152,7 +5152,7 @@ discard block |
||
5152 | 5152 | } |
5153 | 5153 | } |
5154 | 5154 | |
5155 | - if ( $term->taxonomy == $taxonomy_tags ) { |
|
5155 | + if ($term->taxonomy == $taxonomy_tags) { |
|
5156 | 5156 | $post_tags[] = $term->name; |
5157 | 5157 | } |
5158 | 5158 | } |
@@ -5160,47 +5160,47 @@ discard block |
||
5160 | 5160 | if (empty($default_category) && !empty($post_category)) { |
5161 | 5161 | $default_category = $post_category[0]; // Set first one as default category. |
5162 | 5162 | } |
5163 | - $post_category = !empty( $post_category ) ? implode( ',', $post_category ) : ''; |
|
5164 | - $post_tags = !empty( $post_tags ) ? implode( ',', $post_tags ) : ''; |
|
5163 | + $post_category = !empty($post_category) ? implode(',', $post_category) : ''; |
|
5164 | + $post_tags = !empty($post_tags) ? implode(',', $post_tags) : ''; |
|
5165 | 5165 | } |
5166 | 5166 | |
5167 | 5167 | // Franchise data |
5168 | - if ($is_franchise_active && isset($post_info['franchise']) && (int)$post_info['franchise'] > 0 && geodir_franchise_check((int)$post_info['franchise'])) { |
|
5168 | + if ($is_franchise_active && isset($post_info['franchise']) && (int) $post_info['franchise'] > 0 && geodir_franchise_check((int) $post_info['franchise'])) { |
|
5169 | 5169 | $franchise_id = $post_info['franchise']; |
5170 | 5170 | $gd_franchise_info = geodir_get_post_info($franchise_id); |
5171 | 5171 | |
5172 | 5172 | if (geodir_franchise_pkg_is_active($gd_franchise_info)) { |
5173 | - $franchise_info = (array)$gd_franchise_info; |
|
5173 | + $franchise_info = (array) $gd_franchise_info; |
|
5174 | 5174 | $locked_fields = geodir_franchise_get_locked_fields($franchise_id, true); |
5175 | 5175 | |
5176 | 5176 | if (!empty($locked_fields)) { |
5177 | - foreach( $locked_fields as $locked_field) { |
|
5177 | + foreach ($locked_fields as $locked_field) { |
|
5178 | 5178 | if (isset($post_info[$locked_field]) && isset($franchise_info[$locked_field])) { |
5179 | 5179 | $post_info[$locked_field] = $franchise_info[$locked_field]; |
5180 | 5180 | } |
5181 | 5181 | |
5182 | 5182 | if (in_array($taxonomy_category, $locked_fields) || in_array('post_tags', $locked_fields)) { |
5183 | - $franchise_terms = wp_get_post_terms( $franchise_id, array( $taxonomy_category, $taxonomy_tags ) ); |
|
5183 | + $franchise_terms = wp_get_post_terms($franchise_id, array($taxonomy_category, $taxonomy_tags)); |
|
5184 | 5184 | |
5185 | - if ( !empty( $franchise_terms ) && !is_wp_error( $franchise_terms ) ) { |
|
5185 | + if (!empty($franchise_terms) && !is_wp_error($franchise_terms)) { |
|
5186 | 5186 | $franchise_post_category = array(); |
5187 | 5187 | $franchise_post_tags = array(); |
5188 | 5188 | |
5189 | - foreach ( $franchise_terms as $franchise_term ) { |
|
5190 | - if ( $franchise_term->taxonomy == $taxonomy_category ) { |
|
5189 | + foreach ($franchise_terms as $franchise_term) { |
|
5190 | + if ($franchise_term->taxonomy == $taxonomy_category) { |
|
5191 | 5191 | $franchise_post_category[] = $franchise_term->name; |
5192 | 5192 | } |
5193 | 5193 | |
5194 | - if ( $franchise_term->taxonomy == $taxonomy_tags ) { |
|
5194 | + if ($franchise_term->taxonomy == $taxonomy_tags) { |
|
5195 | 5195 | $franchise_post_tags[] = $franchise_term->name; |
5196 | 5196 | } |
5197 | 5197 | } |
5198 | 5198 | |
5199 | 5199 | if (in_array($taxonomy_category, $locked_fields)) { |
5200 | - $post_category = !empty( $franchise_post_category ) ? implode( ',', $franchise_post_category ) : ''; |
|
5200 | + $post_category = !empty($franchise_post_category) ? implode(',', $franchise_post_category) : ''; |
|
5201 | 5201 | } |
5202 | 5202 | if (in_array('post_tags', $locked_fields)) { |
5203 | - $post_tags = !empty( $franchise_post_tags ) ? implode( ',', $franchise_post_tags ) : ''; |
|
5203 | + $post_tags = !empty($franchise_post_tags) ? implode(',', $franchise_post_tags) : ''; |
|
5204 | 5204 | } |
5205 | 5205 | } |
5206 | 5206 | } |
@@ -5209,18 +5209,18 @@ discard block |
||
5209 | 5209 | } |
5210 | 5210 | } |
5211 | 5211 | |
5212 | - $post_images = geodir_get_images( $post_id ); |
|
5212 | + $post_images = geodir_get_images($post_id); |
|
5213 | 5213 | $current_images = array(); |
5214 | - if ( !empty( $post_images ) ) { |
|
5215 | - foreach ( $post_images as $post_image ) { |
|
5216 | - $post_image = (array)$post_image; |
|
5217 | - $image = !empty( $post_image ) && isset( $post_image['path'] ) && $wp_filesystem->is_file( $post_image['path'] ) && $wp_filesystem->exists( $post_image['path'] ) ? $post_image['src'] : ''; |
|
5218 | - if ( $image ) { |
|
5214 | + if (!empty($post_images)) { |
|
5215 | + foreach ($post_images as $post_image) { |
|
5216 | + $post_image = (array) $post_image; |
|
5217 | + $image = !empty($post_image) && isset($post_image['path']) && $wp_filesystem->is_file($post_image['path']) && $wp_filesystem->exists($post_image['path']) ? $post_image['src'] : ''; |
|
5218 | + if ($image) { |
|
5219 | 5219 | $current_images[] = $image; |
5220 | 5220 | } |
5221 | 5221 | } |
5222 | 5222 | |
5223 | - $images_count = max( $images_count, count( $current_images ) ); |
|
5223 | + $images_count = max($images_count, count($current_images)); |
|
5224 | 5224 | } |
5225 | 5225 | |
5226 | 5226 | $csv_row = array(); |
@@ -5232,7 +5232,7 @@ discard block |
||
5232 | 5232 | $csv_row[] = $default_category; // default_category |
5233 | 5233 | $csv_row[] = $post_tags; // post_tags |
5234 | 5234 | $csv_row[] = $post_type; // post_type |
5235 | - if ( $post_type == 'gd_event' ) { |
|
5235 | + if ($post_type == 'gd_event') { |
|
5236 | 5236 | $event_data = geodir_imex_get_event_data($post, $gd_post_info); |
5237 | 5237 | $csv_row[] = $event_data['event_date']; // event_date |
5238 | 5238 | $csv_row[] = $event_data['event_enddate']; // enddate |
@@ -5253,12 +5253,12 @@ discard block |
||
5253 | 5253 | $csv_row[] = $event_data['recurring_end_date']; // repeat_end |
5254 | 5254 | } |
5255 | 5255 | $csv_row[] = $post_info['post_status']; // post_status |
5256 | - $csv_row[] = (int)$post_info['is_featured'] == 1 ? 1 : ''; // is_featured |
|
5256 | + $csv_row[] = (int) $post_info['is_featured'] == 1 ? 1 : ''; // is_featured |
|
5257 | 5257 | if ($is_claim_active) { |
5258 | - $csv_row[] = !empty($post_info['claimed']) && (int)$post_info['claimed'] == 1 ? 1 : ''; // claimed |
|
5258 | + $csv_row[] = !empty($post_info['claimed']) && (int) $post_info['claimed'] == 1 ? 1 : ''; // claimed |
|
5259 | 5259 | } |
5260 | 5260 | if ($is_payment_plugin) { |
5261 | - $csv_row[] = (int)$post_info['package_id']; // package_id |
|
5261 | + $csv_row[] = (int) $post_info['package_id']; // package_id |
|
5262 | 5262 | $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 |
5263 | 5263 | } |
5264 | 5264 | $csv_row[] = $post_info['post_date']; // post_date |
@@ -5294,14 +5294,14 @@ discard block |
||
5294 | 5294 | $csv_row[] = $post_info['geodir_special_offers']; // geodir_special_offers |
5295 | 5295 | // WPML |
5296 | 5296 | if ($is_wpml) { |
5297 | - $csv_row[] = geodir_get_language_for_element( $post_id, 'post_' . $post_type ); |
|
5298 | - $csv_row[] = geodir_imex_original_post_id( $post_id, 'post_' . $post_type ); |
|
5297 | + $csv_row[] = geodir_get_language_for_element($post_id, 'post_'.$post_type); |
|
5298 | + $csv_row[] = geodir_imex_original_post_id($post_id, 'post_'.$post_type); |
|
5299 | 5299 | } |
5300 | 5300 | // WPML |
5301 | 5301 | |
5302 | - if ( !empty( $custom_fields ) ) { |
|
5303 | - foreach ( $custom_fields as $custom_field ) { |
|
5304 | - $csv_row[] = isset( $post_info[$custom_field->htmlvar_name] ) ? $post_info[$custom_field->htmlvar_name] : ''; |
|
5302 | + if (!empty($custom_fields)) { |
|
5303 | + foreach ($custom_fields as $custom_field) { |
|
5304 | + $csv_row[] = isset($post_info[$custom_field->htmlvar_name]) ? $post_info[$custom_field->htmlvar_name] : ''; |
|
5305 | 5305 | } |
5306 | 5306 | } |
5307 | 5307 | |
@@ -5312,15 +5312,15 @@ discard block |
||
5312 | 5312 | $franchise = ''; |
5313 | 5313 | |
5314 | 5314 | if (geodir_franchise_pkg_is_active($gd_post_info)) { |
5315 | - $gd_is_franchise = (int)get_post_meta( $post_id, 'gd_is_franchise', true ); |
|
5316 | - $locaked_fields = $gd_is_franchise ? get_post_meta( $post_id, 'gd_franchise_lock', true ) : ''; |
|
5315 | + $gd_is_franchise = (int) get_post_meta($post_id, 'gd_is_franchise', true); |
|
5316 | + $locaked_fields = $gd_is_franchise ? get_post_meta($post_id, 'gd_franchise_lock', true) : ''; |
|
5317 | 5317 | $locaked_fields = (is_array($locaked_fields) && !empty($locaked_fields) ? implode(",", $locaked_fields) : ''); |
5318 | - $franchise = !$gd_is_franchise && isset($post_info['franchise']) && (int)$post_info['franchise'] > 0 ? (int)$post_info['franchise'] : 0; // franchise id |
|
5318 | + $franchise = !$gd_is_franchise && isset($post_info['franchise']) && (int) $post_info['franchise'] > 0 ? (int) $post_info['franchise'] : 0; // franchise id |
|
5319 | 5319 | } |
5320 | 5320 | |
5321 | - $csv_row[] = (int)$gd_is_franchise; // gd_is_franchise |
|
5321 | + $csv_row[] = (int) $gd_is_franchise; // gd_is_franchise |
|
5322 | 5322 | $csv_row[] = $locaked_fields; // gd_franchise_lock fields |
5323 | - $csv_row[] = (int)$franchise; // franchise id |
|
5323 | + $csv_row[] = (int) $franchise; // franchise id |
|
5324 | 5324 | } |
5325 | 5325 | |
5326 | 5326 | /** |
@@ -5334,15 +5334,15 @@ discard block |
||
5334 | 5334 | */ |
5335 | 5335 | $csv_row = apply_filters('geodir_export_listing_csv_column_values', $csv_row, $post_info); |
5336 | 5336 | |
5337 | - for ( $c = 0; $c < $images_count; $c++ ) { |
|
5338 | - $csv_row[] = isset( $current_images[$c] ) ? $current_images[$c] : ''; // IMAGE |
|
5337 | + for ($c = 0; $c < $images_count; $c++) { |
|
5338 | + $csv_row[] = isset($current_images[$c]) ? $current_images[$c] : ''; // IMAGE |
|
5339 | 5339 | } |
5340 | 5340 | |
5341 | 5341 | $csv_rows[] = $csv_row; |
5342 | 5342 | |
5343 | 5343 | } |
5344 | 5344 | |
5345 | - for ( $c = 0; $c < $images_count; $c++ ) { |
|
5345 | + for ($c = 0; $c < $images_count; $c++) { |
|
5346 | 5346 | $csv_rows[0][] = 'IMAGE'; |
5347 | 5347 | } |
5348 | 5348 | } |
@@ -5364,30 +5364,30 @@ discard block |
||
5364 | 5364 | * @param int $page_no Page number. Default 0. |
5365 | 5365 | * @return array Array of posts data. |
5366 | 5366 | */ |
5367 | -function geodir_get_export_posts( $post_type, $per_page = 0, $page_no = 0 ) { |
|
5367 | +function geodir_get_export_posts($post_type, $per_page = 0, $page_no = 0) { |
|
5368 | 5368 | global $wpdb, $plugin_prefix; |
5369 | 5369 | |
5370 | - if ( ! post_type_exists( $post_type ) ) |
|
5370 | + if (!post_type_exists($post_type)) |
|
5371 | 5371 | return new stdClass; |
5372 | 5372 | |
5373 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
5373 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
5374 | 5374 | |
5375 | 5375 | $limit = ''; |
5376 | - if ( $per_page > 0 && $page_no > 0 ) { |
|
5377 | - $offset = ( $page_no - 1 ) * $per_page; |
|
5376 | + if ($per_page > 0 && $page_no > 0) { |
|
5377 | + $offset = ($page_no - 1) * $per_page; |
|
5378 | 5378 | |
5379 | - if ( $offset > 0 ) { |
|
5380 | - $limit = " LIMIT " . $offset . "," . $per_page; |
|
5379 | + if ($offset > 0) { |
|
5380 | + $limit = " LIMIT ".$offset.",".$per_page; |
|
5381 | 5381 | } else { |
5382 | - $limit = " LIMIT " . $per_page; |
|
5382 | + $limit = " LIMIT ".$per_page; |
|
5383 | 5383 | } |
5384 | 5384 | } |
5385 | 5385 | |
5386 | 5386 | // Skip listing with statuses trash, auto-draft etc... |
5387 | 5387 | $skip_statuses = geodir_imex_export_skip_statuses(); |
5388 | 5388 | $where_statuses = ''; |
5389 | - if ( !empty( $skip_statuses ) && is_array( $skip_statuses ) ) { |
|
5390 | - $where_statuses = "AND `" . $wpdb->posts . "`.`post_status` NOT IN('" . implode( "','", $skip_statuses ) . "')"; |
|
5389 | + if (!empty($skip_statuses) && is_array($skip_statuses)) { |
|
5390 | + $where_statuses = "AND `".$wpdb->posts."`.`post_status` NOT IN('".implode("','", $skip_statuses)."')"; |
|
5391 | 5391 | } |
5392 | 5392 | |
5393 | 5393 | /** |
@@ -5398,9 +5398,9 @@ discard block |
||
5398 | 5398 | * |
5399 | 5399 | * @param string $where SQL where clause part. |
5400 | 5400 | */ |
5401 | - $where_statuses = apply_filters( 'geodir_get_export_posts', $where_statuses, $post_type ); |
|
5401 | + $where_statuses = apply_filters('geodir_get_export_posts', $where_statuses, $post_type); |
|
5402 | 5402 | |
5403 | - $query = $wpdb->prepare( "SELECT {$wpdb->posts}.ID FROM {$wpdb->posts} INNER JOIN {$table} ON {$table}.post_id = {$wpdb->posts}.ID WHERE {$wpdb->posts}.post_type = %s " . $where_statuses . " ORDER BY {$wpdb->posts}.ID ASC" . $limit, $post_type ); |
|
5403 | + $query = $wpdb->prepare("SELECT {$wpdb->posts}.ID FROM {$wpdb->posts} INNER JOIN {$table} ON {$table}.post_id = {$wpdb->posts}.ID WHERE {$wpdb->posts}.post_type = %s ".$where_statuses." ORDER BY {$wpdb->posts}.ID ASC".$limit, $post_type); |
|
5404 | 5404 | /** |
5405 | 5405 | * Modify returned posts SQL query for the current post type. |
5406 | 5406 | * |
@@ -5410,8 +5410,8 @@ discard block |
||
5410 | 5410 | * @param int $query The SQL query. |
5411 | 5411 | * @param string $post_type Post type. |
5412 | 5412 | */ |
5413 | - $query = apply_filters( 'geodir_imex_export_posts_query', $query, $post_type ); |
|
5414 | - $results = (array)$wpdb->get_results( $wpdb->prepare( $query, $post_type ), ARRAY_A ); |
|
5413 | + $query = apply_filters('geodir_imex_export_posts_query', $query, $post_type); |
|
5414 | + $results = (array) $wpdb->get_results($wpdb->prepare($query, $post_type), ARRAY_A); |
|
5415 | 5415 | |
5416 | 5416 | /** |
5417 | 5417 | * Modify returned post results for the current post type. |
@@ -5422,7 +5422,7 @@ discard block |
||
5422 | 5422 | * @param object $results An object containing all post ids. |
5423 | 5423 | * @param string $post_type Post type. |
5424 | 5424 | */ |
5425 | - return apply_filters( 'geodir_export_posts', $results, $post_type ); |
|
5425 | + return apply_filters('geodir_export_posts', $results, $post_type); |
|
5426 | 5426 | } |
5427 | 5427 | |
5428 | 5428 | /** |
@@ -5440,24 +5440,24 @@ discard block |
||
5440 | 5440 | * @param string $post_type Post type. |
5441 | 5441 | * @return string The SQL query. |
5442 | 5442 | */ |
5443 | -function geodir_imex_get_events_query( $query, $post_type ) { |
|
5444 | - if ( $post_type == 'gd_event' ) { |
|
5443 | +function geodir_imex_get_events_query($query, $post_type) { |
|
5444 | + if ($post_type == 'gd_event') { |
|
5445 | 5445 | global $wpdb, $plugin_prefix; |
5446 | 5446 | |
5447 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
5447 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
5448 | 5448 | $schedule_table = EVENT_SCHEDULE; |
5449 | 5449 | |
5450 | 5450 | // Skip listing with statuses trash, auto-draft etc... |
5451 | 5451 | $skip_statuses = geodir_imex_export_skip_statuses(); |
5452 | 5452 | $where_statuses = ''; |
5453 | - if ( !empty( $skip_statuses ) && is_array( $skip_statuses ) ) { |
|
5454 | - $where_statuses = "AND `" . $wpdb->posts . "`.`post_status` NOT IN('" . implode( "','", $skip_statuses ) . "')"; |
|
5453 | + if (!empty($skip_statuses) && is_array($skip_statuses)) { |
|
5454 | + $where_statuses = "AND `".$wpdb->posts."`.`post_status` NOT IN('".implode("','", $skip_statuses)."')"; |
|
5455 | 5455 | } |
5456 | 5456 | |
5457 | 5457 | /** This action is documented in geodirectory-functions/geodirectory-admin/admin_functions.php */ |
5458 | - $where_statuses = apply_filters( 'geodir_get_export_posts', $where_statuses, $post_type ); |
|
5458 | + $where_statuses = apply_filters('geodir_get_export_posts', $where_statuses, $post_type); |
|
5459 | 5459 | |
5460 | - $query = $wpdb->prepare( "SELECT {$wpdb->posts}.ID, {$schedule_table}.event_date, {$schedule_table}.event_enddate AS enddate, {$schedule_table}.event_starttime AS starttime, {$schedule_table}.event_endtime AS endtime 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 " . $where_statuses . " GROUP BY {$table}.post_id ORDER BY {$wpdb->posts}.ID ASC, {$schedule_table}.schedule_id ASC", $post_type ); |
|
5460 | + $query = $wpdb->prepare("SELECT {$wpdb->posts}.ID, {$schedule_table}.event_date, {$schedule_table}.event_enddate AS enddate, {$schedule_table}.event_starttime AS starttime, {$schedule_table}.event_endtime AS endtime 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 ".$where_statuses." GROUP BY {$table}.post_id ORDER BY {$wpdb->posts}.ID ASC, {$schedule_table}.schedule_id ASC", $post_type); |
|
5461 | 5461 | } |
5462 | 5462 | |
5463 | 5463 | return $query; |
@@ -5481,35 +5481,35 @@ discard block |
||
5481 | 5481 | * @param string $post_type Post type. |
5482 | 5482 | * @return int Total terms count. |
5483 | 5483 | */ |
5484 | -function geodir_get_terms_count( $post_type ) { |
|
5485 | - $args = array( 'hide_empty' => 0 ); |
|
5484 | +function geodir_get_terms_count($post_type) { |
|
5485 | + $args = array('hide_empty' => 0); |
|
5486 | 5486 | |
5487 | - remove_all_filters( 'get_terms' ); |
|
5487 | + remove_all_filters('get_terms'); |
|
5488 | 5488 | |
5489 | - $taxonomy = $post_type . 'category'; |
|
5489 | + $taxonomy = $post_type.'category'; |
|
5490 | 5490 | |
5491 | 5491 | // WPML |
5492 | 5492 | $is_wpml = geodir_is_wpml(); |
5493 | 5493 | $active_lang = 'all'; |
5494 | - if ( $is_wpml ) { |
|
5494 | + if ($is_wpml) { |
|
5495 | 5495 | global $sitepress; |
5496 | 5496 | $active_lang = $sitepress->get_current_language(); |
5497 | 5497 | |
5498 | - if ( $active_lang != 'all' ) { |
|
5499 | - $sitepress->switch_lang( 'all', true ); |
|
5498 | + if ($active_lang != 'all') { |
|
5499 | + $sitepress->switch_lang('all', true); |
|
5500 | 5500 | } |
5501 | 5501 | } |
5502 | 5502 | // WPML |
5503 | 5503 | |
5504 | - $count_terms = wp_count_terms( $taxonomy, $args ); |
|
5504 | + $count_terms = wp_count_terms($taxonomy, $args); |
|
5505 | 5505 | |
5506 | 5506 | // WPML |
5507 | - if ( $is_wpml && $active_lang !== 'all' ) { |
|
5507 | + if ($is_wpml && $active_lang !== 'all') { |
|
5508 | 5508 | global $sitepress; |
5509 | - $sitepress->switch_lang( $active_lang, true ); |
|
5509 | + $sitepress->switch_lang($active_lang, true); |
|
5510 | 5510 | } |
5511 | 5511 | // WPML |
5512 | - $count_terms = !is_wp_error( $count_terms ) ? $count_terms : 0; |
|
5512 | + $count_terms = !is_wp_error($count_terms) ? $count_terms : 0; |
|
5513 | 5513 | |
5514 | 5514 | return $count_terms; |
5515 | 5515 | } |
@@ -5526,23 +5526,23 @@ discard block |
||
5526 | 5526 | * @param int $page_no Page number. Default 0. |
5527 | 5527 | * @return array Array of terms data. |
5528 | 5528 | */ |
5529 | -function geodir_imex_get_terms( $post_type, $per_page = 0, $page_no = 0 ) { |
|
5530 | - $args = array( 'hide_empty' => 0, 'orderby' => 'id' ); |
|
5529 | +function geodir_imex_get_terms($post_type, $per_page = 0, $page_no = 0) { |
|
5530 | + $args = array('hide_empty' => 0, 'orderby' => 'id'); |
|
5531 | 5531 | |
5532 | - remove_all_filters( 'get_terms' ); |
|
5532 | + remove_all_filters('get_terms'); |
|
5533 | 5533 | |
5534 | - $taxonomy = $post_type . 'category'; |
|
5534 | + $taxonomy = $post_type.'category'; |
|
5535 | 5535 | |
5536 | - if ( $per_page > 0 && $page_no > 0 ) { |
|
5537 | - $args['offset'] = ( $page_no - 1 ) * $per_page; |
|
5536 | + if ($per_page > 0 && $page_no > 0) { |
|
5537 | + $args['offset'] = ($page_no - 1) * $per_page; |
|
5538 | 5538 | $args['number'] = $per_page; |
5539 | 5539 | } |
5540 | 5540 | |
5541 | - $terms = get_terms( $taxonomy, $args ); |
|
5541 | + $terms = get_terms($taxonomy, $args); |
|
5542 | 5542 | |
5543 | 5543 | $csv_rows = array(); |
5544 | 5544 | |
5545 | - if ( !empty( $terms ) ) { |
|
5545 | + if (!empty($terms)) { |
|
5546 | 5546 | $csv_row = array(); |
5547 | 5547 | $csv_row[] = 'cat_id'; |
5548 | 5548 | $csv_row[] = 'cat_name'; |
@@ -5564,16 +5564,16 @@ discard block |
||
5564 | 5564 | |
5565 | 5565 | $csv_rows[] = $csv_row; |
5566 | 5566 | |
5567 | - foreach ( $terms as $term ) { |
|
5568 | - $cat_icon = get_tax_meta( $term->term_id, 'ct_cat_icon', false, $post_type ); |
|
5569 | - $cat_icon = !empty( $cat_icon ) && isset( $cat_icon['src'] ) ? $cat_icon['src'] : ''; |
|
5567 | + foreach ($terms as $term) { |
|
5568 | + $cat_icon = get_tax_meta($term->term_id, 'ct_cat_icon', false, $post_type); |
|
5569 | + $cat_icon = !empty($cat_icon) && isset($cat_icon['src']) ? $cat_icon['src'] : ''; |
|
5570 | 5570 | |
5571 | - $cat_image = geodir_get_default_catimage( $term->term_id, $post_type ); |
|
5572 | - $cat_image = !empty( $cat_image ) && isset( $cat_image['src'] ) ? $cat_image['src'] : ''; |
|
5571 | + $cat_image = geodir_get_default_catimage($term->term_id, $post_type); |
|
5572 | + $cat_image = !empty($cat_image) && isset($cat_image['src']) ? $cat_image['src'] : ''; |
|
5573 | 5573 | |
5574 | 5574 | $cat_parent = ''; |
5575 | - if (isset($term->parent) && (int)$term->parent > 0 && term_exists((int)$term->parent, $taxonomy)) { |
|
5576 | - $parent_term = (array)get_term_by( 'id', (int)$term->parent, $taxonomy ); |
|
5575 | + if (isset($term->parent) && (int) $term->parent > 0 && term_exists((int) $term->parent, $taxonomy)) { |
|
5576 | + $parent_term = (array) get_term_by('id', (int) $term->parent, $taxonomy); |
|
5577 | 5577 | $cat_parent = !empty($parent_term) && isset($parent_term['name']) ? $parent_term['name'] : ''; |
5578 | 5578 | } |
5579 | 5579 | |
@@ -5583,15 +5583,15 @@ discard block |
||
5583 | 5583 | $csv_row[] = $term->slug; |
5584 | 5584 | $csv_row[] = $post_type; |
5585 | 5585 | $csv_row[] = $cat_parent; |
5586 | - $csv_row[] = get_tax_meta( $term->term_id, 'ct_cat_schema', false, $post_type ); |
|
5586 | + $csv_row[] = get_tax_meta($term->term_id, 'ct_cat_schema', false, $post_type); |
|
5587 | 5587 | // WPML |
5588 | 5588 | if ($is_wpml) { |
5589 | - $csv_row[] = geodir_get_language_for_element( $term->term_id, 'tax_' . $taxonomy ); |
|
5590 | - $csv_row[] = geodir_imex_original_post_id( $term->term_id, 'tax_' . $taxonomy ); |
|
5589 | + $csv_row[] = geodir_get_language_for_element($term->term_id, 'tax_'.$taxonomy); |
|
5590 | + $csv_row[] = geodir_imex_original_post_id($term->term_id, 'tax_'.$taxonomy); |
|
5591 | 5591 | } |
5592 | 5592 | // WPML |
5593 | 5593 | $csv_row[] = $term->description; |
5594 | - $csv_row[] = get_tax_meta( $term->term_id, 'ct_cat_top_desc', false, $post_type ); |
|
5594 | + $csv_row[] = get_tax_meta($term->term_id, 'ct_cat_top_desc', false, $post_type); |
|
5595 | 5595 | $csv_row[] = $cat_image; |
5596 | 5596 | $csv_row[] = $cat_icon; |
5597 | 5597 | |
@@ -5610,10 +5610,10 @@ discard block |
||
5610 | 5610 | * @param bool $relative True for relative path & False for absolute path. |
5611 | 5611 | * @return string Path to the cache directory. |
5612 | 5612 | */ |
5613 | -function geodir_path_import_export( $relative = true ) { |
|
5613 | +function geodir_path_import_export($relative = true) { |
|
5614 | 5614 | $upload_dir = wp_upload_dir(); |
5615 | 5615 | |
5616 | - return $relative ? $upload_dir['baseurl'] . '/cache' : $upload_dir['basedir'] . '/cache'; |
|
5616 | + return $relative ? $upload_dir['baseurl'].'/cache' : $upload_dir['basedir'].'/cache'; |
|
5617 | 5617 | } |
5618 | 5618 | |
5619 | 5619 | /** |
@@ -5629,8 +5629,8 @@ discard block |
||
5629 | 5629 | * @param bool $clear If true then it overwrite data otherwise add rows at the end of file. |
5630 | 5630 | * @return bool true if success otherwise false. |
5631 | 5631 | */ |
5632 | -function geodir_save_csv_data( $file_path, $csv_data = array(), $clear = true ) { |
|
5633 | - if ( empty( $csv_data ) ) { |
|
5632 | +function geodir_save_csv_data($file_path, $csv_data = array(), $clear = true) { |
|
5633 | + if (empty($csv_data)) { |
|
5634 | 5634 | return false; |
5635 | 5635 | } |
5636 | 5636 | |
@@ -5638,17 +5638,17 @@ discard block |
||
5638 | 5638 | |
5639 | 5639 | $mode = $clear ? 'w+' : 'a+'; |
5640 | 5640 | |
5641 | - if ( function_exists( 'fputcsv' ) ) { |
|
5642 | - $file = fopen( $file_path, $mode ); |
|
5643 | - foreach( $csv_data as $csv_row ) { |
|
5641 | + if (function_exists('fputcsv')) { |
|
5642 | + $file = fopen($file_path, $mode); |
|
5643 | + foreach ($csv_data as $csv_row) { |
|
5644 | 5644 | //$csv_row = array_map( 'utf8_decode', $csv_row ); |
5645 | - $write_successful = fputcsv( $file, $csv_row, ",", $enclosure = '"' ); |
|
5645 | + $write_successful = fputcsv($file, $csv_row, ",", $enclosure = '"'); |
|
5646 | 5646 | } |
5647 | - fclose( $file ); |
|
5647 | + fclose($file); |
|
5648 | 5648 | } else { |
5649 | - foreach( $csv_data as $csv_row ) { |
|
5649 | + foreach ($csv_data as $csv_row) { |
|
5650 | 5650 | //$csv_row = array_map( 'utf8_decode', $csv_row ); |
5651 | - $wp_filesystem->put_contents( $file_path, $csv_row ); |
|
5651 | + $wp_filesystem->put_contents($file_path, $csv_row); |
|
5652 | 5652 | } |
5653 | 5653 | } |
5654 | 5654 | |
@@ -5666,14 +5666,14 @@ discard block |
||
5666 | 5666 | * @param string $file Full path to file. |
5667 | 5667 | * @return int No of file rows. |
5668 | 5668 | */ |
5669 | -function geodir_import_export_line_count( $file ) { |
|
5669 | +function geodir_import_export_line_count($file) { |
|
5670 | 5670 | global $wp_filesystem; |
5671 | 5671 | |
5672 | - if ( $wp_filesystem->is_file( $file ) && $wp_filesystem->exists( $file ) ) { |
|
5673 | - $contents = $wp_filesystem->get_contents_array( $file ); |
|
5672 | + if ($wp_filesystem->is_file($file) && $wp_filesystem->exists($file)) { |
|
5673 | + $contents = $wp_filesystem->get_contents_array($file); |
|
5674 | 5674 | |
5675 | - if ( !empty( $contents ) && is_array( $contents ) ) { |
|
5676 | - return count( $contents ) - 1; |
|
5675 | + if (!empty($contents) && is_array($contents)) { |
|
5676 | + return count($contents) - 1; |
|
5677 | 5677 | } |
5678 | 5678 | } |
5679 | 5679 | |
@@ -5690,11 +5690,11 @@ discard block |
||
5690 | 5690 | * @param string $post_type The post type. |
5691 | 5691 | * @return object Queried object. |
5692 | 5692 | */ |
5693 | -function geodir_imex_get_custom_fields( $post_type ) { |
|
5693 | +function geodir_imex_get_custom_fields($post_type) { |
|
5694 | 5694 | global $wpdb; |
5695 | 5695 | |
5696 | - $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 ) ); |
|
5697 | - $rows = $wpdb->get_results( $sql ); |
|
5696 | + $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)); |
|
5697 | + $rows = $wpdb->get_results($sql); |
|
5698 | 5698 | |
5699 | 5699 | return $rows; |
5700 | 5700 | } |
@@ -5773,14 +5773,14 @@ discard block |
||
5773 | 5773 | global $wpdb, $plugin_prefix; |
5774 | 5774 | |
5775 | 5775 | $post_type = get_post_type($master_post_id); |
5776 | - $post_table = $plugin_prefix . $post_type . '_detail'; |
|
5776 | + $post_table = $plugin_prefix.$post_type.'_detail'; |
|
5777 | 5777 | |
5778 | - $query = $wpdb->prepare("SELECT * FROM " . $post_table . " WHERE post_id = %d", array($master_post_id)); |
|
5779 | - $data = (array)$wpdb->get_row($query); |
|
5778 | + $query = $wpdb->prepare("SELECT * FROM ".$post_table." WHERE post_id = %d", array($master_post_id)); |
|
5779 | + $data = (array) $wpdb->get_row($query); |
|
5780 | 5780 | |
5781 | - if ( !empty( $data ) ) { |
|
5781 | + if (!empty($data)) { |
|
5782 | 5782 | $data['post_id'] = $tr_post_id; |
5783 | - unset($data['default_category'], $data['marker_json'], $data['featured_image'], $data[$post_type . 'category'], $data['overall_rating'], $data['rating_count'], $data['ratings']); |
|
5783 | + unset($data['default_category'], $data['marker_json'], $data['featured_image'], $data[$post_type.'category'], $data['overall_rating'], $data['rating_count'], $data['ratings']); |
|
5784 | 5784 | |
5785 | 5785 | $wpdb->update($post_table, $data, array('post_id' => $tr_post_id)); |
5786 | 5786 | return true; |
@@ -5806,7 +5806,7 @@ discard block |
||
5806 | 5806 | global $sitepress, $wpdb; |
5807 | 5807 | $post_type = get_post_type($master_post_id); |
5808 | 5808 | |
5809 | - remove_filter('get_term', array($sitepress,'get_term_adjust_id')); // AVOID filtering to current language |
|
5809 | + remove_filter('get_term', array($sitepress, 'get_term_adjust_id')); // AVOID filtering to current language |
|
5810 | 5810 | |
5811 | 5811 | $taxonomies = get_object_taxonomies($post_type); |
5812 | 5812 | foreach ($taxonomies as $taxonomy) { |
@@ -5815,9 +5815,9 @@ discard block |
||
5815 | 5815 | |
5816 | 5816 | if ($terms) { |
5817 | 5817 | foreach ($terms as $term) { |
5818 | - $tr_id = apply_filters( 'translate_object_id',$term->term_id, $taxonomy, false, $lang); |
|
5818 | + $tr_id = apply_filters('translate_object_id', $term->term_id, $taxonomy, false, $lang); |
|
5819 | 5819 | |
5820 | - if (!is_null($tr_id)){ |
|
5820 | + if (!is_null($tr_id)) { |
|
5821 | 5821 | // not using get_term - unfiltered get_term |
5822 | 5822 | $translated_term = $wpdb->get_row($wpdb->prepare(" |
5823 | 5823 | 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)); |
@@ -5826,14 +5826,14 @@ discard block |
||
5826 | 5826 | } |
5827 | 5827 | } |
5828 | 5828 | |
5829 | - if (!is_taxonomy_hierarchical($taxonomy)){ |
|
5830 | - $terms_array = array_unique( array_map( 'intval', $terms_array ) ); |
|
5829 | + if (!is_taxonomy_hierarchical($taxonomy)) { |
|
5830 | + $terms_array = array_unique(array_map('intval', $terms_array)); |
|
5831 | 5831 | } |
5832 | 5832 | |
5833 | 5833 | wp_set_post_terms($tr_post_id, $terms_array, $taxonomy); |
5834 | 5834 | |
5835 | - if ($taxonomy == $post_type . 'category') { |
|
5836 | - geodir_set_postcat_structure($tr_post_id, $post_type . 'category'); |
|
5835 | + if ($taxonomy == $post_type.'category') { |
|
5836 | + geodir_set_postcat_structure($tr_post_id, $post_type.'category'); |
|
5837 | 5837 | } |
5838 | 5838 | } |
5839 | 5839 | } |
@@ -5854,15 +5854,15 @@ discard block |
||
5854 | 5854 | function geodir_icl_duplicate_post_images($master_post_id, $tr_post_id, $lang) { |
5855 | 5855 | global $wpdb; |
5856 | 5856 | |
5857 | - $query = $wpdb->prepare("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE mime_type like %s AND post_id = %d", array('%image%', $tr_post_id)); |
|
5857 | + $query = $wpdb->prepare("DELETE FROM ".GEODIR_ATTACHMENT_TABLE." WHERE mime_type like %s AND post_id = %d", array('%image%', $tr_post_id)); |
|
5858 | 5858 | $wpdb->query($query); |
5859 | 5859 | |
5860 | - $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)); |
|
5860 | + $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)); |
|
5861 | 5861 | $post_images = $wpdb->get_results($query); |
5862 | 5862 | |
5863 | - if ( !empty( $post_images ) ) { |
|
5864 | - foreach ( $post_images as $post_image) { |
|
5865 | - $image_data = (array)$post_image; |
|
5863 | + if (!empty($post_images)) { |
|
5864 | + foreach ($post_images as $post_image) { |
|
5865 | + $image_data = (array) $post_image; |
|
5866 | 5866 | unset($image_data['ID']); |
5867 | 5867 | $image_data['post_id'] = $tr_post_id; |
5868 | 5868 | |
@@ -5888,10 +5888,10 @@ discard block |
||
5888 | 5888 | * @return array Event data array. |
5889 | 5889 | */ |
5890 | 5890 | function geodir_imex_get_event_data($post, $gd_post_info) { |
5891 | - $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'] ) ) : ''; |
|
5891 | + $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'])) : ''; |
|
5892 | 5892 | $event_enddate = $event_date; |
5893 | - $starttime = isset( $post['starttime'] ) && $post['starttime'] != '' && $post['starttime'] != '00:00:00' ? date_i18n( 'H:i', strtotime( $post['starttime'] ) ) : ''; |
|
5894 | - $endtime = isset( $post['endtime'] ) && $post['endtime'] != '' && $post['endtime'] != '00:00:00' ? date_i18n( 'H:i', strtotime( $post['endtime'] ) ) : ''; |
|
5893 | + $starttime = isset($post['starttime']) && $post['starttime'] != '' && $post['starttime'] != '00:00:00' ? date_i18n('H:i', strtotime($post['starttime'])) : ''; |
|
5894 | + $endtime = isset($post['endtime']) && $post['endtime'] != '' && $post['endtime'] != '00:00:00' ? date_i18n('H:i', strtotime($post['endtime'])) : ''; |
|
5895 | 5895 | |
5896 | 5896 | $is_recurring_event = ''; |
5897 | 5897 | $event_duration_days = ''; |
@@ -5908,15 +5908,15 @@ discard block |
||
5908 | 5908 | |
5909 | 5909 | $recurring_data = isset($gd_post_info->recurring_dates) ? maybe_unserialize($gd_post_info->recurring_dates) : array(); |
5910 | 5910 | if (!empty($recurring_data)) { |
5911 | - $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; |
|
5912 | - $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; |
|
5913 | - $starttime = isset( $recurring_data['starttime'] ) && $recurring_data['starttime'] != '' && $recurring_data['starttime'] != '00:00:00' ? date_i18n( 'H:i', strtotime( $recurring_data['starttime'] ) ) : $starttime; |
|
5914 | - $endtime = isset( $recurring_data['endtime'] ) && $recurring_data['endtime'] != '' && $recurring_data['endtime'] != '00:00:00' ? date_i18n( 'H:i', strtotime( $recurring_data['endtime'] ) ) : $endtime; |
|
5911 | + $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; |
|
5912 | + $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; |
|
5913 | + $starttime = isset($recurring_data['starttime']) && $recurring_data['starttime'] != '' && $recurring_data['starttime'] != '00:00:00' ? date_i18n('H:i', strtotime($recurring_data['starttime'])) : $starttime; |
|
5914 | + $endtime = isset($recurring_data['endtime']) && $recurring_data['endtime'] != '' && $recurring_data['endtime'] != '00:00:00' ? date_i18n('H:i', strtotime($recurring_data['endtime'])) : $endtime; |
|
5915 | 5915 | $is_whole_day_event = !empty($recurring_data['all_day']) ? 1 : ''; |
5916 | 5916 | $different_times = !empty($recurring_data['different_times']) ? true : false; |
5917 | 5917 | |
5918 | - $recurring_pkg = geodir_event_recurring_pkg( $gd_post_info ); |
|
5919 | - $is_recurring = isset( $gd_post_info->is_recurring ) && (int)$gd_post_info->is_recurring == 0 ? false : true; |
|
5918 | + $recurring_pkg = geodir_event_recurring_pkg($gd_post_info); |
|
5919 | + $is_recurring = isset($gd_post_info->is_recurring) && (int) $gd_post_info->is_recurring == 0 ? false : true; |
|
5920 | 5920 | |
5921 | 5921 | if ($recurring_pkg && $is_recurring) { |
5922 | 5922 | $recurring_dates = $event_date; |
@@ -5926,13 +5926,13 @@ discard block |
||
5926 | 5926 | $recurring_type = !empty($recurring_data['repeat_type']) && in_array($recurring_data['repeat_type'], array('day', 'week', 'month', 'year', 'custom')) ? $recurring_data['repeat_type'] : 'custom'; |
5927 | 5927 | |
5928 | 5928 | if (!empty($recurring_data['event_recurring_dates'])) { |
5929 | - $event_recurring_dates = explode( ',', $recurring_data['event_recurring_dates'] ); |
|
5929 | + $event_recurring_dates = explode(',', $recurring_data['event_recurring_dates']); |
|
5930 | 5930 | |
5931 | 5931 | if (!empty($event_recurring_dates)) { |
5932 | 5932 | $recurring_dates = array(); |
5933 | 5933 | |
5934 | 5934 | foreach ($event_recurring_dates as $date) { |
5935 | - $recurring_dates[] = date_i18n( 'd/m/Y', strtotime( $date ) ); |
|
5935 | + $recurring_dates[] = date_i18n('d/m/Y', strtotime($date)); |
|
5936 | 5936 | } |
5937 | 5937 | |
5938 | 5938 | $recurring_dates = implode(",", $recurring_dates); |
@@ -5948,7 +5948,7 @@ discard block |
||
5948 | 5948 | $times = array(); |
5949 | 5949 | |
5950 | 5950 | foreach ($recurring_data['starttimes'] as $time) { |
5951 | - $times[] = $time != '00:00:00' ? date_i18n( 'H:i', strtotime( $time ) ) : '00:00'; |
|
5951 | + $times[] = $time != '00:00:00' ? date_i18n('H:i', strtotime($time)) : '00:00'; |
|
5952 | 5952 | } |
5953 | 5953 | |
5954 | 5954 | $event_starttimes = implode(",", $times); |
@@ -5958,7 +5958,7 @@ discard block |
||
5958 | 5958 | $times = array(); |
5959 | 5959 | |
5960 | 5960 | foreach ($recurring_data['endtimes'] as $time) { |
5961 | - $times[] = $time != '00:00:00' ? date_i18n( 'H:i', strtotime( $time ) ) : '00:00'; |
|
5961 | + $times[] = $time != '00:00:00' ? date_i18n('H:i', strtotime($time)) : '00:00'; |
|
5962 | 5962 | } |
5963 | 5963 | |
5964 | 5964 | $event_endtimes = implode(",", $times); |
@@ -5970,8 +5970,8 @@ discard block |
||
5970 | 5970 | } |
5971 | 5971 | } |
5972 | 5972 | } else { |
5973 | - $event_duration_days = isset($recurring_data['duration_x']) ? (int)$recurring_data['duration_x'] : 1; |
|
5974 | - $recurring_interval = !empty($recurring_data['repeat_x']) && (int)$recurring_data['repeat_x'] > 0 ? $recurring_data['repeat_x'] : 1; |
|
5973 | + $event_duration_days = isset($recurring_data['duration_x']) ? (int) $recurring_data['duration_x'] : 1; |
|
5974 | + $recurring_interval = !empty($recurring_data['repeat_x']) && (int) $recurring_data['repeat_x'] > 0 ? $recurring_data['repeat_x'] : 1; |
|
5975 | 5975 | |
5976 | 5976 | if (($recurring_type == 'week' || $recurring_type == 'month') && !empty($recurring_data['repeat_days'])) { |
5977 | 5977 | $week_days = array('Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'); |
@@ -5987,11 +5987,11 @@ discard block |
||
5987 | 5987 | } |
5988 | 5988 | |
5989 | 5989 | $recurring_week_nos = $recurring_type == 'month' && !empty($recurring_data['repeat_weeks']) ? implode(",", $recurring_data['repeat_weeks']) : $recurring_week_nos; |
5990 | - if (!empty($recurring_data['repeat_end_type']) && (int)$recurring_data['repeat_end_type'] == 1) { |
|
5991 | - $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'] ) ) : ''; |
|
5990 | + if (!empty($recurring_data['repeat_end_type']) && (int) $recurring_data['repeat_end_type'] == 1) { |
|
5991 | + $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'])) : ''; |
|
5992 | 5992 | $max_recurring_count = empty($recurring_end_date) ? 1 : ''; |
5993 | 5993 | } else { |
5994 | - $max_recurring_count = (!empty($recurring_data['max_repeat']) && (int)$recurring_data['max_repeat'] > 0 ? (int)$recurring_data['max_repeat'] : 1); |
|
5994 | + $max_recurring_count = (!empty($recurring_data['max_repeat']) && (int) $recurring_data['max_repeat'] > 0 ? (int) $recurring_data['max_repeat'] : 1); |
|
5995 | 5995 | } |
5996 | 5996 | } |
5997 | 5997 | } |
@@ -6055,9 +6055,9 @@ discard block |
||
6055 | 6055 | * @return array Event data array. |
6056 | 6056 | */ |
6057 | 6057 | function geodir_imex_process_event_data($gd_post) { |
6058 | - $recurring_pkg = geodir_event_recurring_pkg( (object)$gd_post ); |
|
6058 | + $recurring_pkg = geodir_event_recurring_pkg((object) $gd_post); |
|
6059 | 6059 | |
6060 | - $is_recurring = isset( $gd_post['is_recurring_event'] ) && (int)$gd_post['is_recurring_event'] == 0 ? false : true; |
|
6060 | + $is_recurring = isset($gd_post['is_recurring_event']) && (int) $gd_post['is_recurring_event'] == 0 ? false : true; |
|
6061 | 6061 | $event_date = isset($gd_post['event_date']) && $gd_post['event_date'] != '' ? geodir_imex_get_date_ymd($gd_post['event_date']) : ''; |
6062 | 6062 | $event_enddate = isset($gd_post['event_enddate']) && $gd_post['event_enddate'] != '' ? geodir_imex_get_date_ymd($gd_post['event_enddate']) : $event_date; |
6063 | 6063 | $all_day = isset($gd_post['is_whole_day_event']) && !empty($gd_post['is_whole_day_event']) ? true : false; |
@@ -6104,17 +6104,17 @@ discard block |
||
6104 | 6104 | $event_recurring_dates = implode(",", $event_recurring_dates); |
6105 | 6105 | } |
6106 | 6106 | } else { |
6107 | - $duration_x = !empty( $gd_post['event_duration_days'] ) ? (int)$gd_post['event_duration_days'] : 1; |
|
6108 | - $repeat_x = !empty( $gd_post['recurring_interval'] ) ? (int)$gd_post['recurring_interval'] : 1; |
|
6109 | - $max_repeat = !empty( $gd_post['max_recurring_count'] ) ? (int)$gd_post['max_recurring_count'] : 1; |
|
6110 | - $repeat_end = !empty( $gd_post['recurring_end_date'] ) ? geodir_imex_get_date_ymd($gd_post['recurring_end_date']) : ''; |
|
6107 | + $duration_x = !empty($gd_post['event_duration_days']) ? (int) $gd_post['event_duration_days'] : 1; |
|
6108 | + $repeat_x = !empty($gd_post['recurring_interval']) ? (int) $gd_post['recurring_interval'] : 1; |
|
6109 | + $max_repeat = !empty($gd_post['max_recurring_count']) ? (int) $gd_post['max_recurring_count'] : 1; |
|
6110 | + $repeat_end = !empty($gd_post['recurring_end_date']) ? geodir_imex_get_date_ymd($gd_post['recurring_end_date']) : ''; |
|
6111 | 6111 | |
6112 | 6112 | $repeat_end_type = $repeat_end != '' ? 1 : 0; |
6113 | 6113 | $max_repeat = $repeat_end != '' ? '' : $max_repeat; |
6114 | 6114 | |
6115 | 6115 | $week_days = array_flip(array('sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat')); |
6116 | 6116 | |
6117 | - $a_repeat_days = isset($gd_post['recurring_week_days']) && trim($gd_post['recurring_week_days'])!='' ? explode(',', trim($gd_post['recurring_week_days'])) : array(); |
|
6117 | + $a_repeat_days = isset($gd_post['recurring_week_days']) && trim($gd_post['recurring_week_days']) != '' ? explode(',', trim($gd_post['recurring_week_days'])) : array(); |
|
6118 | 6118 | $repeat_days = array(); |
6119 | 6119 | if (!empty($a_repeat_days)) { |
6120 | 6120 | foreach ($a_repeat_days as $repeat_day) { |
@@ -6132,7 +6132,7 @@ discard block |
||
6132 | 6132 | $repeat_weeks = array(); |
6133 | 6133 | if (!empty($a_repeat_weeks)) { |
6134 | 6134 | foreach ($a_repeat_weeks as $repeat_week) { |
6135 | - $repeat_weeks[] = (int)$repeat_week; |
|
6135 | + $repeat_weeks[] = (int) $repeat_week; |
|
6136 | 6136 | } |
6137 | 6137 | |
6138 | 6138 | $repeat_weeks = array_unique($repeat_weeks); |
@@ -6196,7 +6196,7 @@ discard block |
||
6196 | 6196 | |
6197 | 6197 | $page_found = $wpdb->get_var( |
6198 | 6198 | $wpdb->prepare( |
6199 | - "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s LIMIT 1;", |
|
6199 | + "SELECT ID FROM ".$wpdb->posts." WHERE post_name = %s LIMIT 1;", |
|
6200 | 6200 | array($slug) |
6201 | 6201 | ) |
6202 | 6202 | ); |
@@ -6251,7 +6251,7 @@ discard block |
||
6251 | 6251 | */ |
6252 | 6252 | function geodir_admin_upgrade_notice() { |
6253 | 6253 | $class = "error"; |
6254 | - $message = __("Please update core GeoDirectory or some addons may not function correctly.","geodirectory"); |
|
6254 | + $message = __("Please update core GeoDirectory or some addons may not function correctly.", "geodirectory"); |
|
6255 | 6255 | echo"<div class=\"$class\"> <p>$message</p></div>"; |
6256 | 6256 | } |
6257 | 6257 | |
@@ -6263,7 +6263,7 @@ discard block |
||
6263 | 6263 | * @param (object) $r |
6264 | 6264 | * @return (string) $output |
6265 | 6265 | */ |
6266 | -function geodire_admin_upgrade_notice( $plugin_data, $r ) |
|
6266 | +function geodire_admin_upgrade_notice($plugin_data, $r) |
|
6267 | 6267 | { |
6268 | 6268 | // readme contents |
6269 | 6269 | $args = array( |
@@ -6271,7 +6271,7 @@ discard block |
||
6271 | 6271 | 'redirection' => 5 |
6272 | 6272 | ); |
6273 | 6273 | $url = "http://plugins.svn.wordpress.org/geodirectory/trunk/readme.txt"; |
6274 | - $data = wp_remote_get( $url, $args ); |
|
6274 | + $data = wp_remote_get($url, $args); |
|
6275 | 6275 | |
6276 | 6276 | if (!is_wp_error($data) && $data['response']['code'] == 200) { |
6277 | 6277 | |
@@ -6286,20 +6286,20 @@ discard block |
||
6286 | 6286 | function geodir_in_plugin_update_message($content) { |
6287 | 6287 | // Output Upgrade Notice |
6288 | 6288 | $matches = null; |
6289 | - $regexp = '~==\s*Upgrade Notice\s*==\s*=\s*(.*)\s*=(.*)(=\s*' . preg_quote( GEODIRECTORY_VERSION ) . '\s*=|$)~Uis'; |
|
6289 | + $regexp = '~==\s*Upgrade Notice\s*==\s*=\s*(.*)\s*=(.*)(=\s*'.preg_quote(GEODIRECTORY_VERSION).'\s*=|$)~Uis'; |
|
6290 | 6290 | $upgrade_notice = ''; |
6291 | - if ( preg_match( $regexp, $content, $matches ) ) { |
|
6292 | - if(empty($matches)){return;} |
|
6291 | + if (preg_match($regexp, $content, $matches)) { |
|
6292 | + if (empty($matches)) {return; } |
|
6293 | 6293 | |
6294 | - $version = trim( $matches[1] ); |
|
6295 | - if($version && $version>GEODIRECTORY_VERSION){ |
|
6294 | + $version = trim($matches[1]); |
|
6295 | + if ($version && $version > GEODIRECTORY_VERSION) { |
|
6296 | 6296 | |
6297 | 6297 | |
6298 | - $notices = (array) preg_split('~[\r\n]+~', trim( $matches[2] ) ); |
|
6299 | - if ( version_compare( GEODIRECTORY_VERSION, $version, '<' ) ) { |
|
6298 | + $notices = (array) preg_split('~[\r\n]+~', trim($matches[2])); |
|
6299 | + if (version_compare(GEODIRECTORY_VERSION, $version, '<')) { |
|
6300 | 6300 | $upgrade_notice .= '<div class="geodir_plugin_upgrade_notice">'; |
6301 | - foreach ( $notices as $index => $line ) { |
|
6302 | - $upgrade_notice .= wp_kses_post( preg_replace( '~\[([^\]]*)\]\(([^\)]*)\)~', '<a href="${2}">${1}</a>', $line ) ); |
|
6301 | + foreach ($notices as $index => $line) { |
|
6302 | + $upgrade_notice .= wp_kses_post(preg_replace('~\[([^\]]*)\]\(([^\)]*)\)~', '<a href="${2}">${1}</a>', $line)); |
|
6303 | 6303 | } |
6304 | 6304 | $upgrade_notice .= '</div> '; |
6305 | 6305 | } |
@@ -6323,7 +6323,7 @@ discard block |
||
6323 | 6323 | $default_language = $sitepress->get_default_language(); |
6324 | 6324 | if ($current_language != 'all' && $current_language != $default_language) { |
6325 | 6325 | ?> |
6326 | - <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> |
|
6326 | + <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> |
|
6327 | 6327 | <?php |
6328 | 6328 | } |
6329 | 6329 | } |
@@ -6338,7 +6338,7 @@ discard block |
||
6338 | 6338 | * @param array Listing statuses to be skipped. |
6339 | 6339 | */ |
6340 | 6340 | function geodir_imex_export_skip_statuses() { |
6341 | - $statuses = array( 'trash', 'auto-draft' ); |
|
6341 | + $statuses = array('trash', 'auto-draft'); |
|
6342 | 6342 | |
6343 | 6343 | /** |
6344 | 6344 | * Filter the statuses to skip during GD export listings. |
@@ -6348,7 +6348,7 @@ discard block |
||
6348 | 6348 | * |
6349 | 6349 | * @param array $statuses Listing statuses to be skipped. |
6350 | 6350 | */ |
6351 | - $statuses = apply_filters( 'geodir_imex_export_skip_statuses', $statuses ); |
|
6351 | + $statuses = apply_filters('geodir_imex_export_skip_statuses', $statuses); |
|
6352 | 6352 | |
6353 | 6353 | return $statuses; |
6354 | 6354 | } |
@@ -6388,16 +6388,16 @@ discard block |
||
6388 | 6388 | function geodir_imex_get_filter_where($where = '', $post_type = '') { |
6389 | 6389 | global $wpdb; |
6390 | 6390 | |
6391 | - $filters = !empty( $_REQUEST['gd_imex'] ) && is_array( $_REQUEST['gd_imex'] ) ? $_REQUEST['gd_imex'] : NULL; |
|
6391 | + $filters = !empty($_REQUEST['gd_imex']) && is_array($_REQUEST['gd_imex']) ? $_REQUEST['gd_imex'] : NULL; |
|
6392 | 6392 | |
6393 | - if ( !empty( $filters ) ) { |
|
6394 | - foreach ( $filters as $field => $value ) { |
|
6393 | + if (!empty($filters)) { |
|
6394 | + foreach ($filters as $field => $value) { |
|
6395 | 6395 | switch ($field) { |
6396 | 6396 | case 'start_date': |
6397 | - $where .= " AND `" . $wpdb->posts . "`.`post_date` >= '" . sanitize_text_field( $value ) . " 00:00:00'"; |
|
6397 | + $where .= " AND `".$wpdb->posts."`.`post_date` >= '".sanitize_text_field($value)." 00:00:00'"; |
|
6398 | 6398 | break; |
6399 | 6399 | case 'end_date': |
6400 | - $where .= " AND `" . $wpdb->posts . "`.`post_date` <= '" . sanitize_text_field( $value ) . " 23:59:59'"; |
|
6400 | + $where .= " AND `".$wpdb->posts."`.`post_date` <= '".sanitize_text_field($value)." 23:59:59'"; |
|
6401 | 6401 | break; |
6402 | 6402 | } |
6403 | 6403 | } |
@@ -6409,25 +6409,25 @@ discard block |
||
6409 | 6409 | add_filter('geodir_get_export_posts', 'geodir_imex_get_filter_where', 10, 2); |
6410 | 6410 | |
6411 | 6411 | |
6412 | -function geodir_fix_for_primer_theme(){ |
|
6413 | - if(!defined( 'PRIMER_VERSION' )){return;} |
|
6412 | +function geodir_fix_for_primer_theme() { |
|
6413 | + if (!defined('PRIMER_VERSION')) {return; } |
|
6414 | 6414 | global $pagenow; |
6415 | 6415 | |
6416 | - if ( ( 'post.php' === $pagenow || 'post-new.php' === $pagenow ) && (isset($_REQUEST['post_type']) || isset($_REQUEST['post']) ) ){ |
|
6416 | + if (('post.php' === $pagenow || 'post-new.php' === $pagenow) && (isset($_REQUEST['post_type']) || isset($_REQUEST['post']))) { |
|
6417 | 6417 | |
6418 | - $post_type = isset($_REQUEST['post_type']) ? esc_attr($_REQUEST['post_type']) : get_post_type( $_GET['post'] ); |
|
6418 | + $post_type = isset($_REQUEST['post_type']) ? esc_attr($_REQUEST['post_type']) : get_post_type($_GET['post']); |
|
6419 | 6419 | |
6420 | 6420 | $post_types = geodir_get_posttypes(); |
6421 | - if ($post_type && in_array($post_type, $post_types) ) { |
|
6421 | + if ($post_type && in_array($post_type, $post_types)) { |
|
6422 | 6422 | global $primer_customizer_layouts; |
6423 | - remove_action( 'add_meta_boxes', array( $primer_customizer_layouts, 'add_meta_box' ), 10); |
|
6423 | + remove_action('add_meta_boxes', array($primer_customizer_layouts, 'add_meta_box'), 10); |
|
6424 | 6424 | } |
6425 | 6425 | } |
6426 | 6426 | |
6427 | 6427 | } |
6428 | 6428 | |
6429 | -if(is_admin()){ |
|
6430 | - add_action('add_meta_boxes','geodir_fix_for_primer_theme',0); |
|
6429 | +if (is_admin()) { |
|
6430 | + add_action('add_meta_boxes', 'geodir_fix_for_primer_theme', 0); |
|
6431 | 6431 | } |
6432 | 6432 | |
6433 | 6433 | |
@@ -6560,27 +6560,27 @@ discard block |
||
6560 | 6560 | |
6561 | 6561 | function geodir_ga_activation_url() { |
6562 | 6562 | |
6563 | - return add_query_arg( array( |
|
6563 | + return add_query_arg(array( |
|
6564 | 6564 | 'next' => admin_url("admin.php?page=geodirectory&active_tab=google_analytic_settings"), |
6565 | 6565 | 'scope' => GEODIR_GA_SCOPE, |
6566 | 6566 | 'response_type' => 'code', |
6567 | 6567 | 'redirect_uri' => GEODIR_GA_REDIRECT, |
6568 | 6568 | 'client_id' => GEODIR_GA_CLIENTID, |
6569 | - ), 'https://accounts.google.com/o/oauth2/auth' ); |
|
6569 | + ), 'https://accounts.google.com/o/oauth2/auth'); |
|
6570 | 6570 | |
6571 | 6571 | return $url; |
6572 | 6572 | } |
6573 | 6573 | |
6574 | -function geodir_gd_accounts(){ |
|
6574 | +function geodir_gd_accounts() { |
|
6575 | 6575 | $accounts = array(); |
6576 | - $useAuth = ( get_option( 'geodir_ga_auth_code' ) == '' ? false : true ); |
|
6577 | - if($useAuth){ |
|
6576 | + $useAuth = (get_option('geodir_ga_auth_code') == '' ? false : true); |
|
6577 | + if ($useAuth) { |
|
6578 | 6578 | $accounts = geodir_ga_get_analytics_accounts(); |
6579 | - if(is_array($accounts)){ |
|
6580 | - $accounts = array_merge(array(__('Select Account','geodirectory')),$accounts); |
|
6581 | - }elseif(get_option('geodir_ga_account_id')){ |
|
6579 | + if (is_array($accounts)) { |
|
6580 | + $accounts = array_merge(array(__('Select Account', 'geodirectory')), $accounts); |
|
6581 | + }elseif (get_option('geodir_ga_account_id')) { |
|
6582 | 6582 | $accounts = array(); |
6583 | - $accounts[get_option('geodir_ga_account_id')] = __('Account re-authorization may be required','geodirectory').' ('.get_option('geodir_ga_account_id').')'; |
|
6583 | + $accounts[get_option('geodir_ga_account_id')] = __('Account re-authorization may be required', 'geodirectory').' ('.get_option('geodir_ga_account_id').')'; |
|
6584 | 6584 | } |
6585 | 6585 | } |
6586 | 6586 | return $accounts; |
@@ -6590,32 +6590,32 @@ discard block |
||
6590 | 6590 | { |
6591 | 6591 | $accounts = array(); |
6592 | 6592 | |
6593 | - if(get_option('geodir_ga_auth_token')===false){update_option('geodir_ga_auth_token','');} |
|
6593 | + if (get_option('geodir_ga_auth_token') === false) {update_option('geodir_ga_auth_token', ''); } |
|
6594 | 6594 | |
6595 | 6595 | |
6596 | - if(get_option('geodir_gd_uids') && !isset($_POST['geodir_ga_auth_code'])){ |
|
6596 | + if (get_option('geodir_gd_uids') && !isset($_POST['geodir_ga_auth_code'])) { |
|
6597 | 6597 | return get_option('geodir_gd_uids'); |
6598 | 6598 | } |
6599 | 6599 | |
6600 | 6600 | |
6601 | 6601 | # Create a new Gdata call |
6602 | - if ( trim(get_option('geodir_ga_auth_code')) != '' ) |
|
6602 | + if (trim(get_option('geodir_ga_auth_code')) != '') |
|
6603 | 6603 | $stats = new GDGoogleAnalyticsStats(); |
6604 | 6604 | else |
6605 | 6605 | return false; |
6606 | 6606 | |
6607 | 6607 | # Check if Google sucessfully logged in |
6608 | - if ( ! $stats->checkLogin() ) |
|
6608 | + if (!$stats->checkLogin()) |
|
6609 | 6609 | return false; |
6610 | 6610 | |
6611 | 6611 | # Get a list of accounts |
6612 | 6612 | $accounts = $stats->getAllProfiles(); |
6613 | 6613 | |
6614 | - natcasesort ($accounts); |
|
6614 | + natcasesort($accounts); |
|
6615 | 6615 | |
6616 | 6616 | # Return the account array if there are accounts |
6617 | - if ( count($accounts) > 0 ){ |
|
6618 | - update_option('geodir_gd_uids',$accounts); |
|
6617 | + if (count($accounts) > 0) { |
|
6618 | + update_option('geodir_gd_uids', $accounts); |
|
6619 | 6619 | return $accounts; |
6620 | 6620 | } |
6621 | 6621 | else |
@@ -23,14 +23,14 @@ discard block |
||
23 | 23 | { |
24 | 24 | |
25 | 25 | # Include SimplePie if it doesn't exist |
26 | - if ( !class_exists('SimplePie') ) { |
|
27 | - require_once (ABSPATH . WPINC . '/class-feed.php'); |
|
26 | + if (!class_exists('SimplePie')) { |
|
27 | + require_once (ABSPATH.WPINC.'/class-feed.php'); |
|
28 | 28 | } |
29 | 29 | |
30 | - if ( !class_exists('Google_Client') ) { |
|
30 | + if (!class_exists('Google_Client')) { |
|
31 | 31 | require_once 'google-api-php-client/src/Google_Client.php'; |
32 | 32 | } |
33 | - if ( !class_exists('Google_AnalyticsService') ) { |
|
33 | + if (!class_exists('Google_AnalyticsService')) { |
|
34 | 34 | require_once 'google-api-php-client/src/contrib/Google_AnalyticsService.php'; |
35 | 35 | } |
36 | 36 | |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | } |
52 | 52 | catch (Google_ServiceException $e) |
53 | 53 | { |
54 | - print '(cas:48) There was an Analytics API service error ' . $e->getCode() . ':' . $e->getMessage(); |
|
54 | + print '(cas:48) There was an Analytics API service error '.$e->getCode().':'.$e->getMessage(); |
|
55 | 55 | return false; |
56 | 56 | } |
57 | 57 | } |
@@ -66,13 +66,13 @@ discard block |
||
66 | 66 | { |
67 | 67 | $this->client->setAccessToken($ga_google_authtoken); |
68 | 68 | } |
69 | - catch( Google_AuthException $e ) |
|
69 | + catch (Google_AuthException $e) |
|
70 | 70 | { |
71 | 71 | print '(cas:72) GeoDirectory was unable to authenticate you with |
72 | 72 | Google using the Auth Token you pasted into the input box on the previous step. <br><br> |
73 | 73 | This could mean either you pasted the token wrong, or the time/date on your server is wrong, |
74 | 74 | or an SSL issue preventing Google from Authenticating. <br><br> |
75 | - <br><br><strong>Tech Info </strong> ' . $e->getCode() . ':' . $e->getMessage(); |
|
75 | + <br><br><strong>Tech Info </strong> ' . $e->getCode().':'.$e->getMessage(); |
|
76 | 76 | |
77 | 77 | return false; |
78 | 78 | } |
@@ -87,18 +87,18 @@ discard block |
||
87 | 87 | { |
88 | 88 | $accessToken = $this->client->authenticate($authCode); |
89 | 89 | } |
90 | - catch( Exception $e ) |
|
90 | + catch (Exception $e) |
|
91 | 91 | { |
92 | 92 | print '(cas:72) GeoDirectory was unable to authenticate you with |
93 | 93 | Google using the Auth Token you pasted into the input box on the previous step. <br><br> |
94 | 94 | This could mean either you pasted the token wrong, or the time/date on your server is wrong, |
95 | 95 | or an SSL issue preventing Google from Authenticating. <br><br> |
96 | - <br><br><strong>Tech Info </strong> ' . $e->getCode() . ':' . $e->getMessage(); |
|
96 | + <br><br><strong>Tech Info </strong> ' . $e->getCode().':'.$e->getMessage(); |
|
97 | 97 | |
98 | 98 | return false; |
99 | 99 | } |
100 | 100 | |
101 | - if($accessToken) |
|
101 | + if ($accessToken) |
|
102 | 102 | { |
103 | 103 | $this->client->setAccessToken($accessToken); |
104 | 104 | update_option('geodir_ga_auth_token', $accessToken); |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | } |
110 | 110 | } |
111 | 111 | |
112 | - $this->token = $this->client->getAccessToken(); |
|
112 | + $this->token = $this->client->getAccessToken(); |
|
113 | 113 | return true; |
114 | 114 | } |
115 | 115 | |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | function getSingleProfile() |
123 | 123 | { |
124 | 124 | $webproperty_id = get_option('geodir_ga_account_id'); |
125 | - list($pre, $account_id, $post) = explode('-',$webproperty_id); |
|
125 | + list($pre, $account_id, $post) = explode('-', $webproperty_id); |
|
126 | 126 | |
127 | 127 | if (empty($webproperty_id)) return false; |
128 | 128 | |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | } |
132 | 132 | catch (Google_ServiceException $e) |
133 | 133 | { |
134 | - print 'There was an Analytics API service error ' . $e->getCode() . ': ' . $e->getMessage(); |
|
134 | + print 'There was an Analytics API service error '.$e->getCode().': '.$e->getMessage(); |
|
135 | 135 | return false; |
136 | 136 | } |
137 | 137 | |
@@ -152,15 +152,15 @@ discard block |
||
152 | 152 | } |
153 | 153 | catch (Google_ServiceException $e) |
154 | 154 | { |
155 | - print 'There was an Analytics API service error ' . $e->getCode() . ': ' . $e->getMessage(); |
|
155 | + print 'There was an Analytics API service error '.$e->getCode().': '.$e->getMessage(); |
|
156 | 156 | } |
157 | 157 | |
158 | 158 | |
159 | - if( !empty( $profiles->items ) ) |
|
159 | + if (!empty($profiles->items)) |
|
160 | 160 | { |
161 | - foreach( $profiles->items as $profile ) |
|
161 | + foreach ($profiles->items as $profile) |
|
162 | 162 | { |
163 | - $profile_array[ $profile->id ] = str_replace('http://','',$profile->name ); |
|
163 | + $profile_array[$profile->id] = str_replace('http://', '', $profile->name); |
|
164 | 164 | } |
165 | 165 | } |
166 | 166 | |
@@ -249,20 +249,20 @@ discard block |
||
249 | 249 | } |
250 | 250 | |
251 | 251 | // Just incase, the ga: is still used in the account id, strip it out to prevent it breaking |
252 | - $filtered_id = str_replace( 'ga:', '', $this->accountId ); |
|
252 | + $filtered_id = str_replace('ga:', '', $this->accountId); |
|
253 | 253 | |
254 | - if(!$filtered_id){ |
|
254 | + if (!$filtered_id) { |
|
255 | 255 | echo 'Error - Account ID is blank'; |
256 | 256 | return false; |
257 | 257 | } |
258 | 258 | |
259 | - if($realtime){ |
|
259 | + if ($realtime) { |
|
260 | 260 | return $analytics->data_realtime->get( |
261 | 261 | 'ga:'.$filtered_id, |
262 | 262 | $metric, |
263 | 263 | $params |
264 | 264 | ); |
265 | - }else{ |
|
265 | + } else { |
|
266 | 266 | return $analytics->data_ga->get( |
267 | 267 | 'ga:'.$filtered_id, |
268 | 268 | $startDate, |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | **/ |
287 | 287 | function verifyStartDate($date) |
288 | 288 | { |
289 | - if ( strtotime($date) > strtotime('2005-01-01') ) |
|
289 | + if (strtotime($date) > strtotime('2005-01-01')) |
|
290 | 290 | return $date; |
291 | 291 | else |
292 | 292 | return '2005-01-01'; |
@@ -1266,25 +1266,25 @@ discard block |
||
1266 | 1266 | public function getChildLink() { |
1267 | 1267 | return $this->childLink; |
1268 | 1268 | } |
1269 | - public function setCreated( $created) { |
|
1269 | + public function setCreated($created) { |
|
1270 | 1270 | $this->created = $created; |
1271 | 1271 | } |
1272 | 1272 | public function getCreated() { |
1273 | 1273 | return $this->created; |
1274 | 1274 | } |
1275 | - public function setId( $id) { |
|
1275 | + public function setId($id) { |
|
1276 | 1276 | $this->id = $id; |
1277 | 1277 | } |
1278 | 1278 | public function getId() { |
1279 | 1279 | return $this->id; |
1280 | 1280 | } |
1281 | - public function setKind( $kind) { |
|
1281 | + public function setKind($kind) { |
|
1282 | 1282 | $this->kind = $kind; |
1283 | 1283 | } |
1284 | 1284 | public function getKind() { |
1285 | 1285 | return $this->kind; |
1286 | 1286 | } |
1287 | - public function setName( $name) { |
|
1287 | + public function setName($name) { |
|
1288 | 1288 | $this->name = $name; |
1289 | 1289 | } |
1290 | 1290 | public function getName() { |
@@ -1296,13 +1296,13 @@ discard block |
||
1296 | 1296 | public function getPermissions() { |
1297 | 1297 | return $this->permissions; |
1298 | 1298 | } |
1299 | - public function setSelfLink( $selfLink) { |
|
1299 | + public function setSelfLink($selfLink) { |
|
1300 | 1300 | $this->selfLink = $selfLink; |
1301 | 1301 | } |
1302 | 1302 | public function getSelfLink() { |
1303 | 1303 | return $this->selfLink; |
1304 | 1304 | } |
1305 | - public function setUpdated( $updated) { |
|
1305 | + public function setUpdated($updated) { |
|
1306 | 1306 | $this->updated = $updated; |
1307 | 1307 | } |
1308 | 1308 | public function getUpdated() { |
@@ -1313,13 +1313,13 @@ discard block |
||
1313 | 1313 | class Google_AccountChildLink extends Google_Model { |
1314 | 1314 | public $href; |
1315 | 1315 | public $type; |
1316 | - public function setHref( $href) { |
|
1316 | + public function setHref($href) { |
|
1317 | 1317 | $this->href = $href; |
1318 | 1318 | } |
1319 | 1319 | public function getHref() { |
1320 | 1320 | return $this->href; |
1321 | 1321 | } |
1322 | - public function setType( $type) { |
|
1322 | + public function setType($type) { |
|
1323 | 1323 | $this->type = $type; |
1324 | 1324 | } |
1325 | 1325 | public function getType() { |
@@ -1343,25 +1343,25 @@ discard block |
||
1343 | 1343 | public $id; |
1344 | 1344 | public $kind; |
1345 | 1345 | public $name; |
1346 | - public function setHref( $href) { |
|
1346 | + public function setHref($href) { |
|
1347 | 1347 | $this->href = $href; |
1348 | 1348 | } |
1349 | 1349 | public function getHref() { |
1350 | 1350 | return $this->href; |
1351 | 1351 | } |
1352 | - public function setId( $id) { |
|
1352 | + public function setId($id) { |
|
1353 | 1353 | $this->id = $id; |
1354 | 1354 | } |
1355 | 1355 | public function getId() { |
1356 | 1356 | return $this->id; |
1357 | 1357 | } |
1358 | - public function setKind( $kind) { |
|
1358 | + public function setKind($kind) { |
|
1359 | 1359 | $this->kind = $kind; |
1360 | 1360 | } |
1361 | 1361 | public function getKind() { |
1362 | 1362 | return $this->kind; |
1363 | 1363 | } |
1364 | - public function setName( $name) { |
|
1364 | + public function setName($name) { |
|
1365 | 1365 | $this->name = $name; |
1366 | 1366 | } |
1367 | 1367 | public function getName() { |
@@ -1387,43 +1387,43 @@ discard block |
||
1387 | 1387 | public function getItems() { |
1388 | 1388 | return $this->items; |
1389 | 1389 | } |
1390 | - public function setItemsPerPage( $itemsPerPage) { |
|
1390 | + public function setItemsPerPage($itemsPerPage) { |
|
1391 | 1391 | $this->itemsPerPage = $itemsPerPage; |
1392 | 1392 | } |
1393 | 1393 | public function getItemsPerPage() { |
1394 | 1394 | return $this->itemsPerPage; |
1395 | 1395 | } |
1396 | - public function setKind( $kind) { |
|
1396 | + public function setKind($kind) { |
|
1397 | 1397 | $this->kind = $kind; |
1398 | 1398 | } |
1399 | 1399 | public function getKind() { |
1400 | 1400 | return $this->kind; |
1401 | 1401 | } |
1402 | - public function setNextLink( $nextLink) { |
|
1402 | + public function setNextLink($nextLink) { |
|
1403 | 1403 | $this->nextLink = $nextLink; |
1404 | 1404 | } |
1405 | 1405 | public function getNextLink() { |
1406 | 1406 | return $this->nextLink; |
1407 | 1407 | } |
1408 | - public function setPreviousLink( $previousLink) { |
|
1408 | + public function setPreviousLink($previousLink) { |
|
1409 | 1409 | $this->previousLink = $previousLink; |
1410 | 1410 | } |
1411 | 1411 | public function getPreviousLink() { |
1412 | 1412 | return $this->previousLink; |
1413 | 1413 | } |
1414 | - public function setStartIndex( $startIndex) { |
|
1414 | + public function setStartIndex($startIndex) { |
|
1415 | 1415 | $this->startIndex = $startIndex; |
1416 | 1416 | } |
1417 | 1417 | public function getStartIndex() { |
1418 | 1418 | return $this->startIndex; |
1419 | 1419 | } |
1420 | - public function setTotalResults( $totalResults) { |
|
1420 | + public function setTotalResults($totalResults) { |
|
1421 | 1421 | $this->totalResults = $totalResults; |
1422 | 1422 | } |
1423 | 1423 | public function getTotalResults() { |
1424 | 1424 | return $this->totalResults; |
1425 | 1425 | } |
1426 | - public function setUsername( $username) { |
|
1426 | + public function setUsername($username) { |
|
1427 | 1427 | $this->username = $username; |
1428 | 1428 | } |
1429 | 1429 | public function getUsername() { |
@@ -1446,19 +1446,19 @@ discard block |
||
1446 | 1446 | public $attributes; |
1447 | 1447 | public $id; |
1448 | 1448 | public $kind; |
1449 | - public function setAttributes( $attributes) { |
|
1449 | + public function setAttributes($attributes) { |
|
1450 | 1450 | $this->attributes = $attributes; |
1451 | 1451 | } |
1452 | 1452 | public function getAttributes() { |
1453 | 1453 | return $this->attributes; |
1454 | 1454 | } |
1455 | - public function setId( $id) { |
|
1455 | + public function setId($id) { |
|
1456 | 1456 | $this->id = $id; |
1457 | 1457 | } |
1458 | 1458 | public function getId() { |
1459 | 1459 | return $this->id; |
1460 | 1460 | } |
1461 | - public function setKind( $kind) { |
|
1461 | + public function setKind($kind) { |
|
1462 | 1462 | $this->kind = $kind; |
1463 | 1463 | } |
1464 | 1464 | public function getKind() { |
@@ -1481,7 +1481,7 @@ discard block |
||
1481 | 1481 | public function getAttributeNames() { |
1482 | 1482 | return $this->attributeNames; |
1483 | 1483 | } |
1484 | - public function setEtag( $etag) { |
|
1484 | + public function setEtag($etag) { |
|
1485 | 1485 | $this->etag = $etag; |
1486 | 1486 | } |
1487 | 1487 | public function getEtag() { |
@@ -1494,13 +1494,13 @@ discard block |
||
1494 | 1494 | public function getItems() { |
1495 | 1495 | return $this->items; |
1496 | 1496 | } |
1497 | - public function setKind( $kind) { |
|
1497 | + public function setKind($kind) { |
|
1498 | 1498 | $this->kind = $kind; |
1499 | 1499 | } |
1500 | 1500 | public function getKind() { |
1501 | 1501 | return $this->kind; |
1502 | 1502 | } |
1503 | - public function setTotalResults( $totalResults) { |
|
1503 | + public function setTotalResults($totalResults) { |
|
1504 | 1504 | $this->totalResults = $totalResults; |
1505 | 1505 | } |
1506 | 1506 | public function getTotalResults() { |
@@ -1526,7 +1526,7 @@ discard block |
||
1526 | 1526 | public $type; |
1527 | 1527 | public $updated; |
1528 | 1528 | public $webPropertyId; |
1529 | - public function setAccountId( $accountId) { |
|
1529 | + public function setAccountId($accountId) { |
|
1530 | 1530 | $this->accountId = $accountId; |
1531 | 1531 | } |
1532 | 1532 | public function getAccountId() { |
@@ -1538,31 +1538,31 @@ discard block |
||
1538 | 1538 | public function getChildLink() { |
1539 | 1539 | return $this->childLink; |
1540 | 1540 | } |
1541 | - public function setCreated( $created) { |
|
1541 | + public function setCreated($created) { |
|
1542 | 1542 | $this->created = $created; |
1543 | 1543 | } |
1544 | 1544 | public function getCreated() { |
1545 | 1545 | return $this->created; |
1546 | 1546 | } |
1547 | - public function setDescription( $description) { |
|
1547 | + public function setDescription($description) { |
|
1548 | 1548 | $this->description = $description; |
1549 | 1549 | } |
1550 | 1550 | public function getDescription() { |
1551 | 1551 | return $this->description; |
1552 | 1552 | } |
1553 | - public function setId( $id) { |
|
1553 | + public function setId($id) { |
|
1554 | 1554 | $this->id = $id; |
1555 | 1555 | } |
1556 | 1556 | public function getId() { |
1557 | 1557 | return $this->id; |
1558 | 1558 | } |
1559 | - public function setKind( $kind) { |
|
1559 | + public function setKind($kind) { |
|
1560 | 1560 | $this->kind = $kind; |
1561 | 1561 | } |
1562 | 1562 | public function getKind() { |
1563 | 1563 | return $this->kind; |
1564 | 1564 | } |
1565 | - public function setName( $name) { |
|
1565 | + public function setName($name) { |
|
1566 | 1566 | $this->name = $name; |
1567 | 1567 | } |
1568 | 1568 | public function getName() { |
@@ -1581,25 +1581,25 @@ discard block |
||
1581 | 1581 | public function getProfilesLinked() { |
1582 | 1582 | return $this->profilesLinked; |
1583 | 1583 | } |
1584 | - public function setSelfLink( $selfLink) { |
|
1584 | + public function setSelfLink($selfLink) { |
|
1585 | 1585 | $this->selfLink = $selfLink; |
1586 | 1586 | } |
1587 | 1587 | public function getSelfLink() { |
1588 | 1588 | return $this->selfLink; |
1589 | 1589 | } |
1590 | - public function setType( $type) { |
|
1590 | + public function setType($type) { |
|
1591 | 1591 | $this->type = $type; |
1592 | 1592 | } |
1593 | 1593 | public function getType() { |
1594 | 1594 | return $this->type; |
1595 | 1595 | } |
1596 | - public function setUpdated( $updated) { |
|
1596 | + public function setUpdated($updated) { |
|
1597 | 1597 | $this->updated = $updated; |
1598 | 1598 | } |
1599 | 1599 | public function getUpdated() { |
1600 | 1600 | return $this->updated; |
1601 | 1601 | } |
1602 | - public function setWebPropertyId( $webPropertyId) { |
|
1602 | + public function setWebPropertyId($webPropertyId) { |
|
1603 | 1603 | $this->webPropertyId = $webPropertyId; |
1604 | 1604 | } |
1605 | 1605 | public function getWebPropertyId() { |
@@ -1610,13 +1610,13 @@ discard block |
||
1610 | 1610 | class Google_CustomDataSourceChildLink extends Google_Model { |
1611 | 1611 | public $href; |
1612 | 1612 | public $type; |
1613 | - public function setHref( $href) { |
|
1613 | + public function setHref($href) { |
|
1614 | 1614 | $this->href = $href; |
1615 | 1615 | } |
1616 | 1616 | public function getHref() { |
1617 | 1617 | return $this->href; |
1618 | 1618 | } |
1619 | - public function setType( $type) { |
|
1619 | + public function setType($type) { |
|
1620 | 1620 | $this->type = $type; |
1621 | 1621 | } |
1622 | 1622 | public function getType() { |
@@ -1627,13 +1627,13 @@ discard block |
||
1627 | 1627 | class Google_CustomDataSourceParentLink extends Google_Model { |
1628 | 1628 | public $href; |
1629 | 1629 | public $type; |
1630 | - public function setHref( $href) { |
|
1630 | + public function setHref($href) { |
|
1631 | 1631 | $this->href = $href; |
1632 | 1632 | } |
1633 | 1633 | public function getHref() { |
1634 | 1634 | return $this->href; |
1635 | 1635 | } |
1636 | - public function setType( $type) { |
|
1636 | + public function setType($type) { |
|
1637 | 1637 | $this->type = $type; |
1638 | 1638 | } |
1639 | 1639 | public function getType() { |
@@ -1659,43 +1659,43 @@ discard block |
||
1659 | 1659 | public function getItems() { |
1660 | 1660 | return $this->items; |
1661 | 1661 | } |
1662 | - public function setItemsPerPage( $itemsPerPage) { |
|
1662 | + public function setItemsPerPage($itemsPerPage) { |
|
1663 | 1663 | $this->itemsPerPage = $itemsPerPage; |
1664 | 1664 | } |
1665 | 1665 | public function getItemsPerPage() { |
1666 | 1666 | return $this->itemsPerPage; |
1667 | 1667 | } |
1668 | - public function setKind( $kind) { |
|
1668 | + public function setKind($kind) { |
|
1669 | 1669 | $this->kind = $kind; |
1670 | 1670 | } |
1671 | 1671 | public function getKind() { |
1672 | 1672 | return $this->kind; |
1673 | 1673 | } |
1674 | - public function setNextLink( $nextLink) { |
|
1674 | + public function setNextLink($nextLink) { |
|
1675 | 1675 | $this->nextLink = $nextLink; |
1676 | 1676 | } |
1677 | 1677 | public function getNextLink() { |
1678 | 1678 | return $this->nextLink; |
1679 | 1679 | } |
1680 | - public function setPreviousLink( $previousLink) { |
|
1680 | + public function setPreviousLink($previousLink) { |
|
1681 | 1681 | $this->previousLink = $previousLink; |
1682 | 1682 | } |
1683 | 1683 | public function getPreviousLink() { |
1684 | 1684 | return $this->previousLink; |
1685 | 1685 | } |
1686 | - public function setStartIndex( $startIndex) { |
|
1686 | + public function setStartIndex($startIndex) { |
|
1687 | 1687 | $this->startIndex = $startIndex; |
1688 | 1688 | } |
1689 | 1689 | public function getStartIndex() { |
1690 | 1690 | return $this->startIndex; |
1691 | 1691 | } |
1692 | - public function setTotalResults( $totalResults) { |
|
1692 | + public function setTotalResults($totalResults) { |
|
1693 | 1693 | $this->totalResults = $totalResults; |
1694 | 1694 | } |
1695 | 1695 | public function getTotalResults() { |
1696 | 1696 | return $this->totalResults; |
1697 | 1697 | } |
1698 | - public function setUsername( $username) { |
|
1698 | + public function setUsername($username) { |
|
1699 | 1699 | $this->username = $username; |
1700 | 1700 | } |
1701 | 1701 | public function getUsername() { |
@@ -1719,43 +1719,43 @@ discard block |
||
1719 | 1719 | public $recentChanges; |
1720 | 1720 | public $selfLink; |
1721 | 1721 | public $webPropertyId; |
1722 | - public function setAccountId( $accountId) { |
|
1722 | + public function setAccountId($accountId) { |
|
1723 | 1723 | $this->accountId = $accountId; |
1724 | 1724 | } |
1725 | 1725 | public function getAccountId() { |
1726 | 1726 | return $this->accountId; |
1727 | 1727 | } |
1728 | - public function setAppendCount( $appendCount) { |
|
1728 | + public function setAppendCount($appendCount) { |
|
1729 | 1729 | $this->appendCount = $appendCount; |
1730 | 1730 | } |
1731 | 1731 | public function getAppendCount() { |
1732 | 1732 | return $this->appendCount; |
1733 | 1733 | } |
1734 | - public function setCreatedTime( $createdTime) { |
|
1734 | + public function setCreatedTime($createdTime) { |
|
1735 | 1735 | $this->createdTime = $createdTime; |
1736 | 1736 | } |
1737 | 1737 | public function getCreatedTime() { |
1738 | 1738 | return $this->createdTime; |
1739 | 1739 | } |
1740 | - public function setCustomDataSourceId( $customDataSourceId) { |
|
1740 | + public function setCustomDataSourceId($customDataSourceId) { |
|
1741 | 1741 | $this->customDataSourceId = $customDataSourceId; |
1742 | 1742 | } |
1743 | 1743 | public function getCustomDataSourceId() { |
1744 | 1744 | return $this->customDataSourceId; |
1745 | 1745 | } |
1746 | - public function setDate( $date) { |
|
1746 | + public function setDate($date) { |
|
1747 | 1747 | $this->date = $date; |
1748 | 1748 | } |
1749 | 1749 | public function getDate() { |
1750 | 1750 | return $this->date; |
1751 | 1751 | } |
1752 | - public function setKind( $kind) { |
|
1752 | + public function setKind($kind) { |
|
1753 | 1753 | $this->kind = $kind; |
1754 | 1754 | } |
1755 | 1755 | public function getKind() { |
1756 | 1756 | return $this->kind; |
1757 | 1757 | } |
1758 | - public function setModifiedTime( $modifiedTime) { |
|
1758 | + public function setModifiedTime($modifiedTime) { |
|
1759 | 1759 | $this->modifiedTime = $modifiedTime; |
1760 | 1760 | } |
1761 | 1761 | public function getModifiedTime() { |
@@ -1774,13 +1774,13 @@ discard block |
||
1774 | 1774 | public function getRecentChanges() { |
1775 | 1775 | return $this->recentChanges; |
1776 | 1776 | } |
1777 | - public function setSelfLink( $selfLink) { |
|
1777 | + public function setSelfLink($selfLink) { |
|
1778 | 1778 | $this->selfLink = $selfLink; |
1779 | 1779 | } |
1780 | 1780 | public function getSelfLink() { |
1781 | 1781 | return $this->selfLink; |
1782 | 1782 | } |
1783 | - public function setWebPropertyId( $webPropertyId) { |
|
1783 | + public function setWebPropertyId($webPropertyId) { |
|
1784 | 1784 | $this->webPropertyId = $webPropertyId; |
1785 | 1785 | } |
1786 | 1786 | public function getWebPropertyId() { |
@@ -1796,43 +1796,43 @@ discard block |
||
1796 | 1796 | public $kind; |
1797 | 1797 | public $nextAppendLink; |
1798 | 1798 | public $webPropertyId; |
1799 | - public function setAccountId( $accountId) { |
|
1799 | + public function setAccountId($accountId) { |
|
1800 | 1800 | $this->accountId = $accountId; |
1801 | 1801 | } |
1802 | 1802 | public function getAccountId() { |
1803 | 1803 | return $this->accountId; |
1804 | 1804 | } |
1805 | - public function setAppendNumber( $appendNumber) { |
|
1805 | + public function setAppendNumber($appendNumber) { |
|
1806 | 1806 | $this->appendNumber = $appendNumber; |
1807 | 1807 | } |
1808 | 1808 | public function getAppendNumber() { |
1809 | 1809 | return $this->appendNumber; |
1810 | 1810 | } |
1811 | - public function setCustomDataSourceId( $customDataSourceId) { |
|
1811 | + public function setCustomDataSourceId($customDataSourceId) { |
|
1812 | 1812 | $this->customDataSourceId = $customDataSourceId; |
1813 | 1813 | } |
1814 | 1814 | public function getCustomDataSourceId() { |
1815 | 1815 | return $this->customDataSourceId; |
1816 | 1816 | } |
1817 | - public function setDate( $date) { |
|
1817 | + public function setDate($date) { |
|
1818 | 1818 | $this->date = $date; |
1819 | 1819 | } |
1820 | 1820 | public function getDate() { |
1821 | 1821 | return $this->date; |
1822 | 1822 | } |
1823 | - public function setKind( $kind) { |
|
1823 | + public function setKind($kind) { |
|
1824 | 1824 | $this->kind = $kind; |
1825 | 1825 | } |
1826 | 1826 | public function getKind() { |
1827 | 1827 | return $this->kind; |
1828 | 1828 | } |
1829 | - public function setNextAppendLink( $nextAppendLink) { |
|
1829 | + public function setNextAppendLink($nextAppendLink) { |
|
1830 | 1830 | $this->nextAppendLink = $nextAppendLink; |
1831 | 1831 | } |
1832 | 1832 | public function getNextAppendLink() { |
1833 | 1833 | return $this->nextAppendLink; |
1834 | 1834 | } |
1835 | - public function setWebPropertyId( $webPropertyId) { |
|
1835 | + public function setWebPropertyId($webPropertyId) { |
|
1836 | 1836 | $this->webPropertyId = $webPropertyId; |
1837 | 1837 | } |
1838 | 1838 | public function getWebPropertyId() { |
@@ -1843,13 +1843,13 @@ discard block |
||
1843 | 1843 | class Google_DailyUploadParentLink extends Google_Model { |
1844 | 1844 | public $href; |
1845 | 1845 | public $type; |
1846 | - public function setHref( $href) { |
|
1846 | + public function setHref($href) { |
|
1847 | 1847 | $this->href = $href; |
1848 | 1848 | } |
1849 | 1849 | public function getHref() { |
1850 | 1850 | return $this->href; |
1851 | 1851 | } |
1852 | - public function setType( $type) { |
|
1852 | + public function setType($type) { |
|
1853 | 1853 | $this->type = $type; |
1854 | 1854 | } |
1855 | 1855 | public function getType() { |
@@ -1860,13 +1860,13 @@ discard block |
||
1860 | 1860 | class Google_DailyUploadRecentChanges extends Google_Model { |
1861 | 1861 | public $change; |
1862 | 1862 | public $time; |
1863 | - public function setChange( $change) { |
|
1863 | + public function setChange($change) { |
|
1864 | 1864 | $this->change = $change; |
1865 | 1865 | } |
1866 | 1866 | public function getChange() { |
1867 | 1867 | return $this->change; |
1868 | 1868 | } |
1869 | - public function setTime( $time) { |
|
1869 | + public function setTime($time) { |
|
1870 | 1870 | $this->time = $time; |
1871 | 1871 | } |
1872 | 1872 | public function getTime() { |
@@ -1892,43 +1892,43 @@ discard block |
||
1892 | 1892 | public function getItems() { |
1893 | 1893 | return $this->items; |
1894 | 1894 | } |
1895 | - public function setItemsPerPage( $itemsPerPage) { |
|
1895 | + public function setItemsPerPage($itemsPerPage) { |
|
1896 | 1896 | $this->itemsPerPage = $itemsPerPage; |
1897 | 1897 | } |
1898 | 1898 | public function getItemsPerPage() { |
1899 | 1899 | return $this->itemsPerPage; |
1900 | 1900 | } |
1901 | - public function setKind( $kind) { |
|
1901 | + public function setKind($kind) { |
|
1902 | 1902 | $this->kind = $kind; |
1903 | 1903 | } |
1904 | 1904 | public function getKind() { |
1905 | 1905 | return $this->kind; |
1906 | 1906 | } |
1907 | - public function setNextLink( $nextLink) { |
|
1907 | + public function setNextLink($nextLink) { |
|
1908 | 1908 | $this->nextLink = $nextLink; |
1909 | 1909 | } |
1910 | 1910 | public function getNextLink() { |
1911 | 1911 | return $this->nextLink; |
1912 | 1912 | } |
1913 | - public function setPreviousLink( $previousLink) { |
|
1913 | + public function setPreviousLink($previousLink) { |
|
1914 | 1914 | $this->previousLink = $previousLink; |
1915 | 1915 | } |
1916 | 1916 | public function getPreviousLink() { |
1917 | 1917 | return $this->previousLink; |
1918 | 1918 | } |
1919 | - public function setStartIndex( $startIndex) { |
|
1919 | + public function setStartIndex($startIndex) { |
|
1920 | 1920 | $this->startIndex = $startIndex; |
1921 | 1921 | } |
1922 | 1922 | public function getStartIndex() { |
1923 | 1923 | return $this->startIndex; |
1924 | 1924 | } |
1925 | - public function setTotalResults( $totalResults) { |
|
1925 | + public function setTotalResults($totalResults) { |
|
1926 | 1926 | $this->totalResults = $totalResults; |
1927 | 1927 | } |
1928 | 1928 | public function getTotalResults() { |
1929 | 1929 | return $this->totalResults; |
1930 | 1930 | } |
1931 | - public function setUsername( $username) { |
|
1931 | + public function setUsername($username) { |
|
1932 | 1932 | $this->username = $username; |
1933 | 1933 | } |
1934 | 1934 | public function getUsername() { |
@@ -1955,13 +1955,13 @@ discard block |
||
1955 | 1955 | public function getEntity() { |
1956 | 1956 | return $this->entity; |
1957 | 1957 | } |
1958 | - public function setId( $id) { |
|
1958 | + public function setId($id) { |
|
1959 | 1959 | $this->id = $id; |
1960 | 1960 | } |
1961 | 1961 | public function getId() { |
1962 | 1962 | return $this->id; |
1963 | 1963 | } |
1964 | - public function setKind( $kind) { |
|
1964 | + public function setKind($kind) { |
|
1965 | 1965 | $this->kind = $kind; |
1966 | 1966 | } |
1967 | 1967 | public function getKind() { |
@@ -1973,7 +1973,7 @@ discard block |
||
1973 | 1973 | public function getPermissions() { |
1974 | 1974 | return $this->permissions; |
1975 | 1975 | } |
1976 | - public function setSelfLink( $selfLink) { |
|
1976 | + public function setSelfLink($selfLink) { |
|
1977 | 1977 | $this->selfLink = $selfLink; |
1978 | 1978 | } |
1979 | 1979 | public function getSelfLink() { |
@@ -2053,37 +2053,37 @@ discard block |
||
2053 | 2053 | public function getItems() { |
2054 | 2054 | return $this->items; |
2055 | 2055 | } |
2056 | - public function setItemsPerPage( $itemsPerPage) { |
|
2056 | + public function setItemsPerPage($itemsPerPage) { |
|
2057 | 2057 | $this->itemsPerPage = $itemsPerPage; |
2058 | 2058 | } |
2059 | 2059 | public function getItemsPerPage() { |
2060 | 2060 | return $this->itemsPerPage; |
2061 | 2061 | } |
2062 | - public function setKind( $kind) { |
|
2062 | + public function setKind($kind) { |
|
2063 | 2063 | $this->kind = $kind; |
2064 | 2064 | } |
2065 | 2065 | public function getKind() { |
2066 | 2066 | return $this->kind; |
2067 | 2067 | } |
2068 | - public function setNextLink( $nextLink) { |
|
2068 | + public function setNextLink($nextLink) { |
|
2069 | 2069 | $this->nextLink = $nextLink; |
2070 | 2070 | } |
2071 | 2071 | public function getNextLink() { |
2072 | 2072 | return $this->nextLink; |
2073 | 2073 | } |
2074 | - public function setPreviousLink( $previousLink) { |
|
2074 | + public function setPreviousLink($previousLink) { |
|
2075 | 2075 | $this->previousLink = $previousLink; |
2076 | 2076 | } |
2077 | 2077 | public function getPreviousLink() { |
2078 | 2078 | return $this->previousLink; |
2079 | 2079 | } |
2080 | - public function setStartIndex( $startIndex) { |
|
2080 | + public function setStartIndex($startIndex) { |
|
2081 | 2081 | $this->startIndex = $startIndex; |
2082 | 2082 | } |
2083 | 2083 | public function getStartIndex() { |
2084 | 2084 | return $this->startIndex; |
2085 | 2085 | } |
2086 | - public function setTotalResults( $totalResults) { |
|
2086 | + public function setTotalResults($totalResults) { |
|
2087 | 2087 | $this->totalResults = $totalResults; |
2088 | 2088 | } |
2089 | 2089 | public function getTotalResults() { |
@@ -2123,73 +2123,73 @@ discard block |
||
2123 | 2123 | public $webPropertyId; |
2124 | 2124 | public $winnerConfidenceLevel; |
2125 | 2125 | public $winnerFound; |
2126 | - public function setAccountId( $accountId) { |
|
2126 | + public function setAccountId($accountId) { |
|
2127 | 2127 | $this->accountId = $accountId; |
2128 | 2128 | } |
2129 | 2129 | public function getAccountId() { |
2130 | 2130 | return $this->accountId; |
2131 | 2131 | } |
2132 | - public function setCreated( $created) { |
|
2132 | + public function setCreated($created) { |
|
2133 | 2133 | $this->created = $created; |
2134 | 2134 | } |
2135 | 2135 | public function getCreated() { |
2136 | 2136 | return $this->created; |
2137 | 2137 | } |
2138 | - public function setDescription( $description) { |
|
2138 | + public function setDescription($description) { |
|
2139 | 2139 | $this->description = $description; |
2140 | 2140 | } |
2141 | 2141 | public function getDescription() { |
2142 | 2142 | return $this->description; |
2143 | 2143 | } |
2144 | - public function setEditableInGaUi( $editableInGaUi) { |
|
2144 | + public function setEditableInGaUi($editableInGaUi) { |
|
2145 | 2145 | $this->editableInGaUi = $editableInGaUi; |
2146 | 2146 | } |
2147 | 2147 | public function getEditableInGaUi() { |
2148 | 2148 | return $this->editableInGaUi; |
2149 | 2149 | } |
2150 | - public function setEndTime( $endTime) { |
|
2150 | + public function setEndTime($endTime) { |
|
2151 | 2151 | $this->endTime = $endTime; |
2152 | 2152 | } |
2153 | 2153 | public function getEndTime() { |
2154 | 2154 | return $this->endTime; |
2155 | 2155 | } |
2156 | - public function setId( $id) { |
|
2156 | + public function setId($id) { |
|
2157 | 2157 | $this->id = $id; |
2158 | 2158 | } |
2159 | 2159 | public function getId() { |
2160 | 2160 | return $this->id; |
2161 | 2161 | } |
2162 | - public function setInternalWebPropertyId( $internalWebPropertyId) { |
|
2162 | + public function setInternalWebPropertyId($internalWebPropertyId) { |
|
2163 | 2163 | $this->internalWebPropertyId = $internalWebPropertyId; |
2164 | 2164 | } |
2165 | 2165 | public function getInternalWebPropertyId() { |
2166 | 2166 | return $this->internalWebPropertyId; |
2167 | 2167 | } |
2168 | - public function setKind( $kind) { |
|
2168 | + public function setKind($kind) { |
|
2169 | 2169 | $this->kind = $kind; |
2170 | 2170 | } |
2171 | 2171 | public function getKind() { |
2172 | 2172 | return $this->kind; |
2173 | 2173 | } |
2174 | - public function setMinimumExperimentLengthInDays( $minimumExperimentLengthInDays) { |
|
2174 | + public function setMinimumExperimentLengthInDays($minimumExperimentLengthInDays) { |
|
2175 | 2175 | $this->minimumExperimentLengthInDays = $minimumExperimentLengthInDays; |
2176 | 2176 | } |
2177 | 2177 | public function getMinimumExperimentLengthInDays() { |
2178 | 2178 | return $this->minimumExperimentLengthInDays; |
2179 | 2179 | } |
2180 | - public function setName( $name) { |
|
2180 | + public function setName($name) { |
|
2181 | 2181 | $this->name = $name; |
2182 | 2182 | } |
2183 | 2183 | public function getName() { |
2184 | 2184 | return $this->name; |
2185 | 2185 | } |
2186 | - public function setObjectiveMetric( $objectiveMetric) { |
|
2186 | + public function setObjectiveMetric($objectiveMetric) { |
|
2187 | 2187 | $this->objectiveMetric = $objectiveMetric; |
2188 | 2188 | } |
2189 | 2189 | public function getObjectiveMetric() { |
2190 | 2190 | return $this->objectiveMetric; |
2191 | 2191 | } |
2192 | - public function setOptimizationType( $optimizationType) { |
|
2192 | + public function setOptimizationType($optimizationType) { |
|
2193 | 2193 | $this->optimizationType = $optimizationType; |
2194 | 2194 | } |
2195 | 2195 | public function getOptimizationType() { |
@@ -2201,61 +2201,61 @@ discard block |
||
2201 | 2201 | public function getParentLink() { |
2202 | 2202 | return $this->parentLink; |
2203 | 2203 | } |
2204 | - public function setProfileId( $profileId) { |
|
2204 | + public function setProfileId($profileId) { |
|
2205 | 2205 | $this->profileId = $profileId; |
2206 | 2206 | } |
2207 | 2207 | public function getProfileId() { |
2208 | 2208 | return $this->profileId; |
2209 | 2209 | } |
2210 | - public function setReasonExperimentEnded( $reasonExperimentEnded) { |
|
2210 | + public function setReasonExperimentEnded($reasonExperimentEnded) { |
|
2211 | 2211 | $this->reasonExperimentEnded = $reasonExperimentEnded; |
2212 | 2212 | } |
2213 | 2213 | public function getReasonExperimentEnded() { |
2214 | 2214 | return $this->reasonExperimentEnded; |
2215 | 2215 | } |
2216 | - public function setRewriteVariationUrlsAsOriginal( $rewriteVariationUrlsAsOriginal) { |
|
2216 | + public function setRewriteVariationUrlsAsOriginal($rewriteVariationUrlsAsOriginal) { |
|
2217 | 2217 | $this->rewriteVariationUrlsAsOriginal = $rewriteVariationUrlsAsOriginal; |
2218 | 2218 | } |
2219 | 2219 | public function getRewriteVariationUrlsAsOriginal() { |
2220 | 2220 | return $this->rewriteVariationUrlsAsOriginal; |
2221 | 2221 | } |
2222 | - public function setSelfLink( $selfLink) { |
|
2222 | + public function setSelfLink($selfLink) { |
|
2223 | 2223 | $this->selfLink = $selfLink; |
2224 | 2224 | } |
2225 | 2225 | public function getSelfLink() { |
2226 | 2226 | return $this->selfLink; |
2227 | 2227 | } |
2228 | - public function setServingFramework( $servingFramework) { |
|
2228 | + public function setServingFramework($servingFramework) { |
|
2229 | 2229 | $this->servingFramework = $servingFramework; |
2230 | 2230 | } |
2231 | 2231 | public function getServingFramework() { |
2232 | 2232 | return $this->servingFramework; |
2233 | 2233 | } |
2234 | - public function setSnippet( $snippet) { |
|
2234 | + public function setSnippet($snippet) { |
|
2235 | 2235 | $this->snippet = $snippet; |
2236 | 2236 | } |
2237 | 2237 | public function getSnippet() { |
2238 | 2238 | return $this->snippet; |
2239 | 2239 | } |
2240 | - public function setStartTime( $startTime) { |
|
2240 | + public function setStartTime($startTime) { |
|
2241 | 2241 | $this->startTime = $startTime; |
2242 | 2242 | } |
2243 | 2243 | public function getStartTime() { |
2244 | 2244 | return $this->startTime; |
2245 | 2245 | } |
2246 | - public function setStatus( $status) { |
|
2246 | + public function setStatus($status) { |
|
2247 | 2247 | $this->status = $status; |
2248 | 2248 | } |
2249 | 2249 | public function getStatus() { |
2250 | 2250 | return $this->status; |
2251 | 2251 | } |
2252 | - public function setTrafficCoverage( $trafficCoverage) { |
|
2252 | + public function setTrafficCoverage($trafficCoverage) { |
|
2253 | 2253 | $this->trafficCoverage = $trafficCoverage; |
2254 | 2254 | } |
2255 | 2255 | public function getTrafficCoverage() { |
2256 | 2256 | return $this->trafficCoverage; |
2257 | 2257 | } |
2258 | - public function setUpdated( $updated) { |
|
2258 | + public function setUpdated($updated) { |
|
2259 | 2259 | $this->updated = $updated; |
2260 | 2260 | } |
2261 | 2261 | public function getUpdated() { |
@@ -2268,19 +2268,19 @@ discard block |
||
2268 | 2268 | public function getVariations() { |
2269 | 2269 | return $this->variations; |
2270 | 2270 | } |
2271 | - public function setWebPropertyId( $webPropertyId) { |
|
2271 | + public function setWebPropertyId($webPropertyId) { |
|
2272 | 2272 | $this->webPropertyId = $webPropertyId; |
2273 | 2273 | } |
2274 | 2274 | public function getWebPropertyId() { |
2275 | 2275 | return $this->webPropertyId; |
2276 | 2276 | } |
2277 | - public function setWinnerConfidenceLevel( $winnerConfidenceLevel) { |
|
2277 | + public function setWinnerConfidenceLevel($winnerConfidenceLevel) { |
|
2278 | 2278 | $this->winnerConfidenceLevel = $winnerConfidenceLevel; |
2279 | 2279 | } |
2280 | 2280 | public function getWinnerConfidenceLevel() { |
2281 | 2281 | return $this->winnerConfidenceLevel; |
2282 | 2282 | } |
2283 | - public function setWinnerFound( $winnerFound) { |
|
2283 | + public function setWinnerFound($winnerFound) { |
|
2284 | 2284 | $this->winnerFound = $winnerFound; |
2285 | 2285 | } |
2286 | 2286 | public function getWinnerFound() { |
@@ -2291,13 +2291,13 @@ discard block |
||
2291 | 2291 | class Google_ExperimentParentLink extends Google_Model { |
2292 | 2292 | public $href; |
2293 | 2293 | public $type; |
2294 | - public function setHref( $href) { |
|
2294 | + public function setHref($href) { |
|
2295 | 2295 | $this->href = $href; |
2296 | 2296 | } |
2297 | 2297 | public function getHref() { |
2298 | 2298 | return $this->href; |
2299 | 2299 | } |
2300 | - public function setType( $type) { |
|
2300 | + public function setType($type) { |
|
2301 | 2301 | $this->type = $type; |
2302 | 2302 | } |
2303 | 2303 | public function getType() { |
@@ -2311,31 +2311,31 @@ discard block |
||
2311 | 2311 | public $url; |
2312 | 2312 | public $weight; |
2313 | 2313 | public $won; |
2314 | - public function setName( $name) { |
|
2314 | + public function setName($name) { |
|
2315 | 2315 | $this->name = $name; |
2316 | 2316 | } |
2317 | 2317 | public function getName() { |
2318 | 2318 | return $this->name; |
2319 | 2319 | } |
2320 | - public function setStatus( $status) { |
|
2320 | + public function setStatus($status) { |
|
2321 | 2321 | $this->status = $status; |
2322 | 2322 | } |
2323 | 2323 | public function getStatus() { |
2324 | 2324 | return $this->status; |
2325 | 2325 | } |
2326 | - public function setUrl( $url) { |
|
2326 | + public function setUrl($url) { |
|
2327 | 2327 | $this->url = $url; |
2328 | 2328 | } |
2329 | 2329 | public function getUrl() { |
2330 | 2330 | return $this->url; |
2331 | 2331 | } |
2332 | - public function setWeight( $weight) { |
|
2332 | + public function setWeight($weight) { |
|
2333 | 2333 | $this->weight = $weight; |
2334 | 2334 | } |
2335 | 2335 | public function getWeight() { |
2336 | 2336 | return $this->weight; |
2337 | 2337 | } |
2338 | - public function setWon( $won) { |
|
2338 | + public function setWon($won) { |
|
2339 | 2339 | $this->won = $won; |
2340 | 2340 | } |
2341 | 2341 | public function getWon() { |
@@ -2361,43 +2361,43 @@ discard block |
||
2361 | 2361 | public function getItems() { |
2362 | 2362 | return $this->items; |
2363 | 2363 | } |
2364 | - public function setItemsPerPage( $itemsPerPage) { |
|
2364 | + public function setItemsPerPage($itemsPerPage) { |
|
2365 | 2365 | $this->itemsPerPage = $itemsPerPage; |
2366 | 2366 | } |
2367 | 2367 | public function getItemsPerPage() { |
2368 | 2368 | return $this->itemsPerPage; |
2369 | 2369 | } |
2370 | - public function setKind( $kind) { |
|
2370 | + public function setKind($kind) { |
|
2371 | 2371 | $this->kind = $kind; |
2372 | 2372 | } |
2373 | 2373 | public function getKind() { |
2374 | 2374 | return $this->kind; |
2375 | 2375 | } |
2376 | - public function setNextLink( $nextLink) { |
|
2376 | + public function setNextLink($nextLink) { |
|
2377 | 2377 | $this->nextLink = $nextLink; |
2378 | 2378 | } |
2379 | 2379 | public function getNextLink() { |
2380 | 2380 | return $this->nextLink; |
2381 | 2381 | } |
2382 | - public function setPreviousLink( $previousLink) { |
|
2382 | + public function setPreviousLink($previousLink) { |
|
2383 | 2383 | $this->previousLink = $previousLink; |
2384 | 2384 | } |
2385 | 2385 | public function getPreviousLink() { |
2386 | 2386 | return $this->previousLink; |
2387 | 2387 | } |
2388 | - public function setStartIndex( $startIndex) { |
|
2388 | + public function setStartIndex($startIndex) { |
|
2389 | 2389 | $this->startIndex = $startIndex; |
2390 | 2390 | } |
2391 | 2391 | public function getStartIndex() { |
2392 | 2392 | return $this->startIndex; |
2393 | 2393 | } |
2394 | - public function setTotalResults( $totalResults) { |
|
2394 | + public function setTotalResults($totalResults) { |
|
2395 | 2395 | $this->totalResults = $totalResults; |
2396 | 2396 | } |
2397 | 2397 | public function getTotalResults() { |
2398 | 2398 | return $this->totalResults; |
2399 | 2399 | } |
2400 | - public function setUsername( $username) { |
|
2400 | + public function setUsername($username) { |
|
2401 | 2401 | $this->username = $username; |
2402 | 2402 | } |
2403 | 2403 | public function getUsername() { |
@@ -2432,37 +2432,37 @@ discard block |
||
2432 | 2432 | public function getColumnHeaders() { |
2433 | 2433 | return $this->columnHeaders; |
2434 | 2434 | } |
2435 | - public function setContainsSampledData( $containsSampledData) { |
|
2435 | + public function setContainsSampledData($containsSampledData) { |
|
2436 | 2436 | $this->containsSampledData = $containsSampledData; |
2437 | 2437 | } |
2438 | 2438 | public function getContainsSampledData() { |
2439 | 2439 | return $this->containsSampledData; |
2440 | 2440 | } |
2441 | - public function setId( $id) { |
|
2441 | + public function setId($id) { |
|
2442 | 2442 | $this->id = $id; |
2443 | 2443 | } |
2444 | 2444 | public function getId() { |
2445 | 2445 | return $this->id; |
2446 | 2446 | } |
2447 | - public function setItemsPerPage( $itemsPerPage) { |
|
2447 | + public function setItemsPerPage($itemsPerPage) { |
|
2448 | 2448 | $this->itemsPerPage = $itemsPerPage; |
2449 | 2449 | } |
2450 | 2450 | public function getItemsPerPage() { |
2451 | 2451 | return $this->itemsPerPage; |
2452 | 2452 | } |
2453 | - public function setKind( $kind) { |
|
2453 | + public function setKind($kind) { |
|
2454 | 2454 | $this->kind = $kind; |
2455 | 2455 | } |
2456 | 2456 | public function getKind() { |
2457 | 2457 | return $this->kind; |
2458 | 2458 | } |
2459 | - public function setNextLink( $nextLink) { |
|
2459 | + public function setNextLink($nextLink) { |
|
2460 | 2460 | $this->nextLink = $nextLink; |
2461 | 2461 | } |
2462 | 2462 | public function getNextLink() { |
2463 | 2463 | return $this->nextLink; |
2464 | 2464 | } |
2465 | - public function setPreviousLink( $previousLink) { |
|
2465 | + public function setPreviousLink($previousLink) { |
|
2466 | 2466 | $this->previousLink = $previousLink; |
2467 | 2467 | } |
2468 | 2468 | public function getPreviousLink() { |
@@ -2487,19 +2487,19 @@ discard block |
||
2487 | 2487 | public function getRows() { |
2488 | 2488 | return $this->rows; |
2489 | 2489 | } |
2490 | - public function setSelfLink( $selfLink) { |
|
2490 | + public function setSelfLink($selfLink) { |
|
2491 | 2491 | $this->selfLink = $selfLink; |
2492 | 2492 | } |
2493 | 2493 | public function getSelfLink() { |
2494 | 2494 | return $this->selfLink; |
2495 | 2495 | } |
2496 | - public function setTotalResults( $totalResults) { |
|
2496 | + public function setTotalResults($totalResults) { |
|
2497 | 2497 | $this->totalResults = $totalResults; |
2498 | 2498 | } |
2499 | 2499 | public function getTotalResults() { |
2500 | 2500 | return $this->totalResults; |
2501 | 2501 | } |
2502 | - public function setTotalsForAllResults( $totalsForAllResults) { |
|
2502 | + public function setTotalsForAllResults($totalsForAllResults) { |
|
2503 | 2503 | $this->totalsForAllResults = $totalsForAllResults; |
2504 | 2504 | } |
2505 | 2505 | public function getTotalsForAllResults() { |
@@ -2511,19 +2511,19 @@ discard block |
||
2511 | 2511 | public $columnType; |
2512 | 2512 | public $dataType; |
2513 | 2513 | public $name; |
2514 | - public function setColumnType( $columnType) { |
|
2514 | + public function setColumnType($columnType) { |
|
2515 | 2515 | $this->columnType = $columnType; |
2516 | 2516 | } |
2517 | 2517 | public function getColumnType() { |
2518 | 2518 | return $this->columnType; |
2519 | 2519 | } |
2520 | - public function setDataType( $dataType) { |
|
2520 | + public function setDataType($dataType) { |
|
2521 | 2521 | $this->dataType = $dataType; |
2522 | 2522 | } |
2523 | 2523 | public function getDataType() { |
2524 | 2524 | return $this->dataType; |
2525 | 2525 | } |
2526 | - public function setName( $name) { |
|
2526 | + public function setName($name) { |
|
2527 | 2527 | $this->name = $name; |
2528 | 2528 | } |
2529 | 2529 | public function getName() { |
@@ -2538,37 +2538,37 @@ discard block |
||
2538 | 2538 | public $profileName; |
2539 | 2539 | public $tableId; |
2540 | 2540 | public $webPropertyId; |
2541 | - public function setAccountId( $accountId) { |
|
2541 | + public function setAccountId($accountId) { |
|
2542 | 2542 | $this->accountId = $accountId; |
2543 | 2543 | } |
2544 | 2544 | public function getAccountId() { |
2545 | 2545 | return $this->accountId; |
2546 | 2546 | } |
2547 | - public function setInternalWebPropertyId( $internalWebPropertyId) { |
|
2547 | + public function setInternalWebPropertyId($internalWebPropertyId) { |
|
2548 | 2548 | $this->internalWebPropertyId = $internalWebPropertyId; |
2549 | 2549 | } |
2550 | 2550 | public function getInternalWebPropertyId() { |
2551 | 2551 | return $this->internalWebPropertyId; |
2552 | 2552 | } |
2553 | - public function setProfileId( $profileId) { |
|
2553 | + public function setProfileId($profileId) { |
|
2554 | 2554 | $this->profileId = $profileId; |
2555 | 2555 | } |
2556 | 2556 | public function getProfileId() { |
2557 | 2557 | return $this->profileId; |
2558 | 2558 | } |
2559 | - public function setProfileName( $profileName) { |
|
2559 | + public function setProfileName($profileName) { |
|
2560 | 2560 | $this->profileName = $profileName; |
2561 | 2561 | } |
2562 | 2562 | public function getProfileName() { |
2563 | 2563 | return $this->profileName; |
2564 | 2564 | } |
2565 | - public function setTableId( $tableId) { |
|
2565 | + public function setTableId($tableId) { |
|
2566 | 2566 | $this->tableId = $tableId; |
2567 | 2567 | } |
2568 | 2568 | public function getTableId() { |
2569 | 2569 | return $this->tableId; |
2570 | 2570 | } |
2571 | - public function setWebPropertyId( $webPropertyId) { |
|
2571 | + public function setWebPropertyId($webPropertyId) { |
|
2572 | 2572 | $this->webPropertyId = $webPropertyId; |
2573 | 2573 | } |
2574 | 2574 | public function getWebPropertyId() { |
@@ -2587,31 +2587,31 @@ discard block |
||
2587 | 2587 | public $sort; |
2588 | 2588 | public $start_date; |
2589 | 2589 | public $start_index; |
2590 | - public function setDimensions( $dimensions) { |
|
2590 | + public function setDimensions($dimensions) { |
|
2591 | 2591 | $this->dimensions = $dimensions; |
2592 | 2592 | } |
2593 | 2593 | public function getDimensions() { |
2594 | 2594 | return $this->dimensions; |
2595 | 2595 | } |
2596 | - public function setEnd_date( $end_date) { |
|
2596 | + public function setEnd_date($end_date) { |
|
2597 | 2597 | $this->end_date = $end_date; |
2598 | 2598 | } |
2599 | 2599 | public function getEnd_date() { |
2600 | 2600 | return $this->end_date; |
2601 | 2601 | } |
2602 | - public function setFilters( $filters) { |
|
2602 | + public function setFilters($filters) { |
|
2603 | 2603 | $this->filters = $filters; |
2604 | 2604 | } |
2605 | 2605 | public function getFilters() { |
2606 | 2606 | return $this->filters; |
2607 | 2607 | } |
2608 | - public function setIds( $ids) { |
|
2608 | + public function setIds($ids) { |
|
2609 | 2609 | $this->ids = $ids; |
2610 | 2610 | } |
2611 | 2611 | public function getIds() { |
2612 | 2612 | return $this->ids; |
2613 | 2613 | } |
2614 | - public function setMax_results( $max_results) { |
|
2614 | + public function setMax_results($max_results) { |
|
2615 | 2615 | $this->max_results = $max_results; |
2616 | 2616 | } |
2617 | 2617 | public function getMax_results() { |
@@ -2624,7 +2624,7 @@ discard block |
||
2624 | 2624 | public function getMetrics() { |
2625 | 2625 | return $this->metrics; |
2626 | 2626 | } |
2627 | - public function setSegment( $segment) { |
|
2627 | + public function setSegment($segment) { |
|
2628 | 2628 | $this->segment = $segment; |
2629 | 2629 | } |
2630 | 2630 | public function getSegment() { |
@@ -2637,13 +2637,13 @@ discard block |
||
2637 | 2637 | public function getSort() { |
2638 | 2638 | return $this->sort; |
2639 | 2639 | } |
2640 | - public function setStart_date( $start_date) { |
|
2640 | + public function setStart_date($start_date) { |
|
2641 | 2641 | $this->start_date = $start_date; |
2642 | 2642 | } |
2643 | 2643 | public function getStart_date() { |
2644 | 2644 | return $this->start_date; |
2645 | 2645 | } |
2646 | - public function setStart_index( $start_index) { |
|
2646 | + public function setStart_index($start_index) { |
|
2647 | 2647 | $this->start_index = $start_index; |
2648 | 2648 | } |
2649 | 2649 | public function getStart_index() { |
@@ -2680,19 +2680,19 @@ discard block |
||
2680 | 2680 | protected $__visitTimeOnSiteDetailsDataType = ''; |
2681 | 2681 | public $visitTimeOnSiteDetails; |
2682 | 2682 | public $webPropertyId; |
2683 | - public function setAccountId( $accountId) { |
|
2683 | + public function setAccountId($accountId) { |
|
2684 | 2684 | $this->accountId = $accountId; |
2685 | 2685 | } |
2686 | 2686 | public function getAccountId() { |
2687 | 2687 | return $this->accountId; |
2688 | 2688 | } |
2689 | - public function setActive( $active) { |
|
2689 | + public function setActive($active) { |
|
2690 | 2690 | $this->active = $active; |
2691 | 2691 | } |
2692 | 2692 | public function getActive() { |
2693 | 2693 | return $this->active; |
2694 | 2694 | } |
2695 | - public function setCreated( $created) { |
|
2695 | + public function setCreated($created) { |
|
2696 | 2696 | $this->created = $created; |
2697 | 2697 | } |
2698 | 2698 | public function getCreated() { |
@@ -2704,25 +2704,25 @@ discard block |
||
2704 | 2704 | public function getEventDetails() { |
2705 | 2705 | return $this->eventDetails; |
2706 | 2706 | } |
2707 | - public function setId( $id) { |
|
2707 | + public function setId($id) { |
|
2708 | 2708 | $this->id = $id; |
2709 | 2709 | } |
2710 | 2710 | public function getId() { |
2711 | 2711 | return $this->id; |
2712 | 2712 | } |
2713 | - public function setInternalWebPropertyId( $internalWebPropertyId) { |
|
2713 | + public function setInternalWebPropertyId($internalWebPropertyId) { |
|
2714 | 2714 | $this->internalWebPropertyId = $internalWebPropertyId; |
2715 | 2715 | } |
2716 | 2716 | public function getInternalWebPropertyId() { |
2717 | 2717 | return $this->internalWebPropertyId; |
2718 | 2718 | } |
2719 | - public function setKind( $kind) { |
|
2719 | + public function setKind($kind) { |
|
2720 | 2720 | $this->kind = $kind; |
2721 | 2721 | } |
2722 | 2722 | public function getKind() { |
2723 | 2723 | return $this->kind; |
2724 | 2724 | } |
2725 | - public function setName( $name) { |
|
2725 | + public function setName($name) { |
|
2726 | 2726 | $this->name = $name; |
2727 | 2727 | } |
2728 | 2728 | public function getName() { |
@@ -2734,25 +2734,25 @@ discard block |
||
2734 | 2734 | public function getParentLink() { |
2735 | 2735 | return $this->parentLink; |
2736 | 2736 | } |
2737 | - public function setProfileId( $profileId) { |
|
2737 | + public function setProfileId($profileId) { |
|
2738 | 2738 | $this->profileId = $profileId; |
2739 | 2739 | } |
2740 | 2740 | public function getProfileId() { |
2741 | 2741 | return $this->profileId; |
2742 | 2742 | } |
2743 | - public function setSelfLink( $selfLink) { |
|
2743 | + public function setSelfLink($selfLink) { |
|
2744 | 2744 | $this->selfLink = $selfLink; |
2745 | 2745 | } |
2746 | 2746 | public function getSelfLink() { |
2747 | 2747 | return $this->selfLink; |
2748 | 2748 | } |
2749 | - public function setType( $type) { |
|
2749 | + public function setType($type) { |
|
2750 | 2750 | $this->type = $type; |
2751 | 2751 | } |
2752 | 2752 | public function getType() { |
2753 | 2753 | return $this->type; |
2754 | 2754 | } |
2755 | - public function setUpdated( $updated) { |
|
2755 | + public function setUpdated($updated) { |
|
2756 | 2756 | $this->updated = $updated; |
2757 | 2757 | } |
2758 | 2758 | public function getUpdated() { |
@@ -2764,7 +2764,7 @@ discard block |
||
2764 | 2764 | public function getUrlDestinationDetails() { |
2765 | 2765 | return $this->urlDestinationDetails; |
2766 | 2766 | } |
2767 | - public function setValue( $value) { |
|
2767 | + public function setValue($value) { |
|
2768 | 2768 | $this->value = $value; |
2769 | 2769 | } |
2770 | 2770 | public function getValue() { |
@@ -2782,7 +2782,7 @@ discard block |
||
2782 | 2782 | public function getVisitTimeOnSiteDetails() { |
2783 | 2783 | return $this->visitTimeOnSiteDetails; |
2784 | 2784 | } |
2785 | - public function setWebPropertyId( $webPropertyId) { |
|
2785 | + public function setWebPropertyId($webPropertyId) { |
|
2786 | 2786 | $this->webPropertyId = $webPropertyId; |
2787 | 2787 | } |
2788 | 2788 | public function getWebPropertyId() { |
@@ -2802,7 +2802,7 @@ discard block |
||
2802 | 2802 | public function getEventConditions() { |
2803 | 2803 | return $this->eventConditions; |
2804 | 2804 | } |
2805 | - public function setUseEventValue( $useEventValue) { |
|
2805 | + public function setUseEventValue($useEventValue) { |
|
2806 | 2806 | $this->useEventValue = $useEventValue; |
2807 | 2807 | } |
2808 | 2808 | public function getUseEventValue() { |
@@ -2816,31 +2816,31 @@ discard block |
||
2816 | 2816 | public $expression; |
2817 | 2817 | public $matchType; |
2818 | 2818 | public $type; |
2819 | - public function setComparisonType( $comparisonType) { |
|
2819 | + public function setComparisonType($comparisonType) { |
|
2820 | 2820 | $this->comparisonType = $comparisonType; |
2821 | 2821 | } |
2822 | 2822 | public function getComparisonType() { |
2823 | 2823 | return $this->comparisonType; |
2824 | 2824 | } |
2825 | - public function setComparisonValue( $comparisonValue) { |
|
2825 | + public function setComparisonValue($comparisonValue) { |
|
2826 | 2826 | $this->comparisonValue = $comparisonValue; |
2827 | 2827 | } |
2828 | 2828 | public function getComparisonValue() { |
2829 | 2829 | return $this->comparisonValue; |
2830 | 2830 | } |
2831 | - public function setExpression( $expression) { |
|
2831 | + public function setExpression($expression) { |
|
2832 | 2832 | $this->expression = $expression; |
2833 | 2833 | } |
2834 | 2834 | public function getExpression() { |
2835 | 2835 | return $this->expression; |
2836 | 2836 | } |
2837 | - public function setMatchType( $matchType) { |
|
2837 | + public function setMatchType($matchType) { |
|
2838 | 2838 | $this->matchType = $matchType; |
2839 | 2839 | } |
2840 | 2840 | public function getMatchType() { |
2841 | 2841 | return $this->matchType; |
2842 | 2842 | } |
2843 | - public function setType( $type) { |
|
2843 | + public function setType($type) { |
|
2844 | 2844 | $this->type = $type; |
2845 | 2845 | } |
2846 | 2846 | public function getType() { |
@@ -2851,13 +2851,13 @@ discard block |
||
2851 | 2851 | class Google_GoalParentLink extends Google_Model { |
2852 | 2852 | public $href; |
2853 | 2853 | public $type; |
2854 | - public function setHref( $href) { |
|
2854 | + public function setHref($href) { |
|
2855 | 2855 | $this->href = $href; |
2856 | 2856 | } |
2857 | 2857 | public function getHref() { |
2858 | 2858 | return $this->href; |
2859 | 2859 | } |
2860 | - public function setType( $type) { |
|
2860 | + public function setType($type) { |
|
2861 | 2861 | $this->type = $type; |
2862 | 2862 | } |
2863 | 2863 | public function getType() { |
@@ -2873,19 +2873,19 @@ discard block |
||
2873 | 2873 | protected $__stepsDataType = 'array'; |
2874 | 2874 | public $steps; |
2875 | 2875 | public $url; |
2876 | - public function setCaseSensitive( $caseSensitive) { |
|
2876 | + public function setCaseSensitive($caseSensitive) { |
|
2877 | 2877 | $this->caseSensitive = $caseSensitive; |
2878 | 2878 | } |
2879 | 2879 | public function getCaseSensitive() { |
2880 | 2880 | return $this->caseSensitive; |
2881 | 2881 | } |
2882 | - public function setFirstStepRequired( $firstStepRequired) { |
|
2882 | + public function setFirstStepRequired($firstStepRequired) { |
|
2883 | 2883 | $this->firstStepRequired = $firstStepRequired; |
2884 | 2884 | } |
2885 | 2885 | public function getFirstStepRequired() { |
2886 | 2886 | return $this->firstStepRequired; |
2887 | 2887 | } |
2888 | - public function setMatchType( $matchType) { |
|
2888 | + public function setMatchType($matchType) { |
|
2889 | 2889 | $this->matchType = $matchType; |
2890 | 2890 | } |
2891 | 2891 | public function getMatchType() { |
@@ -2898,7 +2898,7 @@ discard block |
||
2898 | 2898 | public function getSteps() { |
2899 | 2899 | return $this->steps; |
2900 | 2900 | } |
2901 | - public function setUrl( $url) { |
|
2901 | + public function setUrl($url) { |
|
2902 | 2902 | $this->url = $url; |
2903 | 2903 | } |
2904 | 2904 | public function getUrl() { |
@@ -2910,19 +2910,19 @@ discard block |
||
2910 | 2910 | public $name; |
2911 | 2911 | public $number; |
2912 | 2912 | public $url; |
2913 | - public function setName( $name) { |
|
2913 | + public function setName($name) { |
|
2914 | 2914 | $this->name = $name; |
2915 | 2915 | } |
2916 | 2916 | public function getName() { |
2917 | 2917 | return $this->name; |
2918 | 2918 | } |
2919 | - public function setNumber( $number) { |
|
2919 | + public function setNumber($number) { |
|
2920 | 2920 | $this->number = $number; |
2921 | 2921 | } |
2922 | 2922 | public function getNumber() { |
2923 | 2923 | return $this->number; |
2924 | 2924 | } |
2925 | - public function setUrl( $url) { |
|
2925 | + public function setUrl($url) { |
|
2926 | 2926 | $this->url = $url; |
2927 | 2927 | } |
2928 | 2928 | public function getUrl() { |
@@ -2933,13 +2933,13 @@ discard block |
||
2933 | 2933 | class Google_GoalVisitNumPagesDetails extends Google_Model { |
2934 | 2934 | public $comparisonType; |
2935 | 2935 | public $comparisonValue; |
2936 | - public function setComparisonType( $comparisonType) { |
|
2936 | + public function setComparisonType($comparisonType) { |
|
2937 | 2937 | $this->comparisonType = $comparisonType; |
2938 | 2938 | } |
2939 | 2939 | public function getComparisonType() { |
2940 | 2940 | return $this->comparisonType; |
2941 | 2941 | } |
2942 | - public function setComparisonValue( $comparisonValue) { |
|
2942 | + public function setComparisonValue($comparisonValue) { |
|
2943 | 2943 | $this->comparisonValue = $comparisonValue; |
2944 | 2944 | } |
2945 | 2945 | public function getComparisonValue() { |
@@ -2950,13 +2950,13 @@ discard block |
||
2950 | 2950 | class Google_GoalVisitTimeOnSiteDetails extends Google_Model { |
2951 | 2951 | public $comparisonType; |
2952 | 2952 | public $comparisonValue; |
2953 | - public function setComparisonType( $comparisonType) { |
|
2953 | + public function setComparisonType($comparisonType) { |
|
2954 | 2954 | $this->comparisonType = $comparisonType; |
2955 | 2955 | } |
2956 | 2956 | public function getComparisonType() { |
2957 | 2957 | return $this->comparisonType; |
2958 | 2958 | } |
2959 | - public function setComparisonValue( $comparisonValue) { |
|
2959 | + public function setComparisonValue($comparisonValue) { |
|
2960 | 2960 | $this->comparisonValue = $comparisonValue; |
2961 | 2961 | } |
2962 | 2962 | public function getComparisonValue() { |
@@ -2982,43 +2982,43 @@ discard block |
||
2982 | 2982 | public function getItems() { |
2983 | 2983 | return $this->items; |
2984 | 2984 | } |
2985 | - public function setItemsPerPage( $itemsPerPage) { |
|
2985 | + public function setItemsPerPage($itemsPerPage) { |
|
2986 | 2986 | $this->itemsPerPage = $itemsPerPage; |
2987 | 2987 | } |
2988 | 2988 | public function getItemsPerPage() { |
2989 | 2989 | return $this->itemsPerPage; |
2990 | 2990 | } |
2991 | - public function setKind( $kind) { |
|
2991 | + public function setKind($kind) { |
|
2992 | 2992 | $this->kind = $kind; |
2993 | 2993 | } |
2994 | 2994 | public function getKind() { |
2995 | 2995 | return $this->kind; |
2996 | 2996 | } |
2997 | - public function setNextLink( $nextLink) { |
|
2997 | + public function setNextLink($nextLink) { |
|
2998 | 2998 | $this->nextLink = $nextLink; |
2999 | 2999 | } |
3000 | 3000 | public function getNextLink() { |
3001 | 3001 | return $this->nextLink; |
3002 | 3002 | } |
3003 | - public function setPreviousLink( $previousLink) { |
|
3003 | + public function setPreviousLink($previousLink) { |
|
3004 | 3004 | $this->previousLink = $previousLink; |
3005 | 3005 | } |
3006 | 3006 | public function getPreviousLink() { |
3007 | 3007 | return $this->previousLink; |
3008 | 3008 | } |
3009 | - public function setStartIndex( $startIndex) { |
|
3009 | + public function setStartIndex($startIndex) { |
|
3010 | 3010 | $this->startIndex = $startIndex; |
3011 | 3011 | } |
3012 | 3012 | public function getStartIndex() { |
3013 | 3013 | return $this->startIndex; |
3014 | 3014 | } |
3015 | - public function setTotalResults( $totalResults) { |
|
3015 | + public function setTotalResults($totalResults) { |
|
3016 | 3016 | $this->totalResults = $totalResults; |
3017 | 3017 | } |
3018 | 3018 | public function getTotalResults() { |
3019 | 3019 | return $this->totalResults; |
3020 | 3020 | } |
3021 | - public function setUsername( $username) { |
|
3021 | + public function setUsername($username) { |
|
3022 | 3022 | $this->username = $username; |
3023 | 3023 | } |
3024 | 3024 | public function getUsername() { |
@@ -3055,37 +3055,37 @@ discard block |
||
3055 | 3055 | public function getColumnHeaders() { |
3056 | 3056 | return $this->columnHeaders; |
3057 | 3057 | } |
3058 | - public function setContainsSampledData( $containsSampledData) { |
|
3058 | + public function setContainsSampledData($containsSampledData) { |
|
3059 | 3059 | $this->containsSampledData = $containsSampledData; |
3060 | 3060 | } |
3061 | 3061 | public function getContainsSampledData() { |
3062 | 3062 | return $this->containsSampledData; |
3063 | 3063 | } |
3064 | - public function setId( $id) { |
|
3064 | + public function setId($id) { |
|
3065 | 3065 | $this->id = $id; |
3066 | 3066 | } |
3067 | 3067 | public function getId() { |
3068 | 3068 | return $this->id; |
3069 | 3069 | } |
3070 | - public function setItemsPerPage( $itemsPerPage) { |
|
3070 | + public function setItemsPerPage($itemsPerPage) { |
|
3071 | 3071 | $this->itemsPerPage = $itemsPerPage; |
3072 | 3072 | } |
3073 | 3073 | public function getItemsPerPage() { |
3074 | 3074 | return $this->itemsPerPage; |
3075 | 3075 | } |
3076 | - public function setKind( $kind) { |
|
3076 | + public function setKind($kind) { |
|
3077 | 3077 | $this->kind = $kind; |
3078 | 3078 | } |
3079 | 3079 | public function getKind() { |
3080 | 3080 | return $this->kind; |
3081 | 3081 | } |
3082 | - public function setNextLink( $nextLink) { |
|
3082 | + public function setNextLink($nextLink) { |
|
3083 | 3083 | $this->nextLink = $nextLink; |
3084 | 3084 | } |
3085 | 3085 | public function getNextLink() { |
3086 | 3086 | return $this->nextLink; |
3087 | 3087 | } |
3088 | - public function setPreviousLink( $previousLink) { |
|
3088 | + public function setPreviousLink($previousLink) { |
|
3089 | 3089 | $this->previousLink = $previousLink; |
3090 | 3090 | } |
3091 | 3091 | public function getPreviousLink() { |
@@ -3110,19 +3110,19 @@ discard block |
||
3110 | 3110 | public function getRows() { |
3111 | 3111 | return $this->rows; |
3112 | 3112 | } |
3113 | - public function setSelfLink( $selfLink) { |
|
3113 | + public function setSelfLink($selfLink) { |
|
3114 | 3114 | $this->selfLink = $selfLink; |
3115 | 3115 | } |
3116 | 3116 | public function getSelfLink() { |
3117 | 3117 | return $this->selfLink; |
3118 | 3118 | } |
3119 | - public function setTotalResults( $totalResults) { |
|
3119 | + public function setTotalResults($totalResults) { |
|
3120 | 3120 | $this->totalResults = $totalResults; |
3121 | 3121 | } |
3122 | 3122 | public function getTotalResults() { |
3123 | 3123 | return $this->totalResults; |
3124 | 3124 | } |
3125 | - public function setTotalsForAllResults( $totalsForAllResults) { |
|
3125 | + public function setTotalsForAllResults($totalsForAllResults) { |
|
3126 | 3126 | $this->totalsForAllResults = $totalsForAllResults; |
3127 | 3127 | } |
3128 | 3128 | public function getTotalsForAllResults() { |
@@ -3134,19 +3134,19 @@ discard block |
||
3134 | 3134 | public $columnType; |
3135 | 3135 | public $dataType; |
3136 | 3136 | public $name; |
3137 | - public function setColumnType( $columnType) { |
|
3137 | + public function setColumnType($columnType) { |
|
3138 | 3138 | $this->columnType = $columnType; |
3139 | 3139 | } |
3140 | 3140 | public function getColumnType() { |
3141 | 3141 | return $this->columnType; |
3142 | 3142 | } |
3143 | - public function setDataType( $dataType) { |
|
3143 | + public function setDataType($dataType) { |
|
3144 | 3144 | $this->dataType = $dataType; |
3145 | 3145 | } |
3146 | 3146 | public function getDataType() { |
3147 | 3147 | return $this->dataType; |
3148 | 3148 | } |
3149 | - public function setName( $name) { |
|
3149 | + public function setName($name) { |
|
3150 | 3150 | $this->name = $name; |
3151 | 3151 | } |
3152 | 3152 | public function getName() { |
@@ -3161,37 +3161,37 @@ discard block |
||
3161 | 3161 | public $profileName; |
3162 | 3162 | public $tableId; |
3163 | 3163 | public $webPropertyId; |
3164 | - public function setAccountId( $accountId) { |
|
3164 | + public function setAccountId($accountId) { |
|
3165 | 3165 | $this->accountId = $accountId; |
3166 | 3166 | } |
3167 | 3167 | public function getAccountId() { |
3168 | 3168 | return $this->accountId; |
3169 | 3169 | } |
3170 | - public function setInternalWebPropertyId( $internalWebPropertyId) { |
|
3170 | + public function setInternalWebPropertyId($internalWebPropertyId) { |
|
3171 | 3171 | $this->internalWebPropertyId = $internalWebPropertyId; |
3172 | 3172 | } |
3173 | 3173 | public function getInternalWebPropertyId() { |
3174 | 3174 | return $this->internalWebPropertyId; |
3175 | 3175 | } |
3176 | - public function setProfileId( $profileId) { |
|
3176 | + public function setProfileId($profileId) { |
|
3177 | 3177 | $this->profileId = $profileId; |
3178 | 3178 | } |
3179 | 3179 | public function getProfileId() { |
3180 | 3180 | return $this->profileId; |
3181 | 3181 | } |
3182 | - public function setProfileName( $profileName) { |
|
3182 | + public function setProfileName($profileName) { |
|
3183 | 3183 | $this->profileName = $profileName; |
3184 | 3184 | } |
3185 | 3185 | public function getProfileName() { |
3186 | 3186 | return $this->profileName; |
3187 | 3187 | } |
3188 | - public function setTableId( $tableId) { |
|
3188 | + public function setTableId($tableId) { |
|
3189 | 3189 | $this->tableId = $tableId; |
3190 | 3190 | } |
3191 | 3191 | public function getTableId() { |
3192 | 3192 | return $this->tableId; |
3193 | 3193 | } |
3194 | - public function setWebPropertyId( $webPropertyId) { |
|
3194 | + public function setWebPropertyId($webPropertyId) { |
|
3195 | 3195 | $this->webPropertyId = $webPropertyId; |
3196 | 3196 | } |
3197 | 3197 | public function getWebPropertyId() { |
@@ -3210,31 +3210,31 @@ discard block |
||
3210 | 3210 | public $sort; |
3211 | 3211 | public $start_date; |
3212 | 3212 | public $start_index; |
3213 | - public function setDimensions( $dimensions) { |
|
3213 | + public function setDimensions($dimensions) { |
|
3214 | 3214 | $this->dimensions = $dimensions; |
3215 | 3215 | } |
3216 | 3216 | public function getDimensions() { |
3217 | 3217 | return $this->dimensions; |
3218 | 3218 | } |
3219 | - public function setEnd_date( $end_date) { |
|
3219 | + public function setEnd_date($end_date) { |
|
3220 | 3220 | $this->end_date = $end_date; |
3221 | 3221 | } |
3222 | 3222 | public function getEnd_date() { |
3223 | 3223 | return $this->end_date; |
3224 | 3224 | } |
3225 | - public function setFilters( $filters) { |
|
3225 | + public function setFilters($filters) { |
|
3226 | 3226 | $this->filters = $filters; |
3227 | 3227 | } |
3228 | 3228 | public function getFilters() { |
3229 | 3229 | return $this->filters; |
3230 | 3230 | } |
3231 | - public function setIds( $ids) { |
|
3231 | + public function setIds($ids) { |
|
3232 | 3232 | $this->ids = $ids; |
3233 | 3233 | } |
3234 | 3234 | public function getIds() { |
3235 | 3235 | return $this->ids; |
3236 | 3236 | } |
3237 | - public function setMax_results( $max_results) { |
|
3237 | + public function setMax_results($max_results) { |
|
3238 | 3238 | $this->max_results = $max_results; |
3239 | 3239 | } |
3240 | 3240 | public function getMax_results() { |
@@ -3247,7 +3247,7 @@ discard block |
||
3247 | 3247 | public function getMetrics() { |
3248 | 3248 | return $this->metrics; |
3249 | 3249 | } |
3250 | - public function setSegment( $segment) { |
|
3250 | + public function setSegment($segment) { |
|
3251 | 3251 | $this->segment = $segment; |
3252 | 3252 | } |
3253 | 3253 | public function getSegment() { |
@@ -3260,13 +3260,13 @@ discard block |
||
3260 | 3260 | public function getSort() { |
3261 | 3261 | return $this->sort; |
3262 | 3262 | } |
3263 | - public function setStart_date( $start_date) { |
|
3263 | + public function setStart_date($start_date) { |
|
3264 | 3264 | $this->start_date = $start_date; |
3265 | 3265 | } |
3266 | 3266 | public function getStart_date() { |
3267 | 3267 | return $this->start_date; |
3268 | 3268 | } |
3269 | - public function setStart_index( $start_index) { |
|
3269 | + public function setStart_index($start_index) { |
|
3270 | 3270 | $this->start_index = $start_index; |
3271 | 3271 | } |
3272 | 3272 | public function getStart_index() { |
@@ -3286,7 +3286,7 @@ discard block |
||
3286 | 3286 | public function getConversionPathValue() { |
3287 | 3287 | return $this->conversionPathValue; |
3288 | 3288 | } |
3289 | - public function setPrimitiveValue( $primitiveValue) { |
|
3289 | + public function setPrimitiveValue($primitiveValue) { |
|
3290 | 3290 | $this->primitiveValue = $primitiveValue; |
3291 | 3291 | } |
3292 | 3292 | public function getPrimitiveValue() { |
@@ -3297,13 +3297,13 @@ discard block |
||
3297 | 3297 | class Google_McfDataRowsConversionPathValue extends Google_Model { |
3298 | 3298 | public $interactionType; |
3299 | 3299 | public $nodeValue; |
3300 | - public function setInteractionType( $interactionType) { |
|
3300 | + public function setInteractionType($interactionType) { |
|
3301 | 3301 | $this->interactionType = $interactionType; |
3302 | 3302 | } |
3303 | 3303 | public function getInteractionType() { |
3304 | 3304 | return $this->interactionType; |
3305 | 3305 | } |
3306 | - public function setNodeValue( $nodeValue) { |
|
3306 | + public function setNodeValue($nodeValue) { |
|
3307 | 3307 | $this->nodeValue = $nodeValue; |
3308 | 3308 | } |
3309 | 3309 | public function getNodeValue() { |
@@ -3339,7 +3339,7 @@ discard block |
||
3339 | 3339 | public $updated; |
3340 | 3340 | public $webPropertyId; |
3341 | 3341 | public $websiteUrl; |
3342 | - public function setAccountId( $accountId) { |
|
3342 | + public function setAccountId($accountId) { |
|
3343 | 3343 | $this->accountId = $accountId; |
3344 | 3344 | } |
3345 | 3345 | public function getAccountId() { |
@@ -3351,55 +3351,55 @@ discard block |
||
3351 | 3351 | public function getChildLink() { |
3352 | 3352 | return $this->childLink; |
3353 | 3353 | } |
3354 | - public function setCreated( $created) { |
|
3354 | + public function setCreated($created) { |
|
3355 | 3355 | $this->created = $created; |
3356 | 3356 | } |
3357 | 3357 | public function getCreated() { |
3358 | 3358 | return $this->created; |
3359 | 3359 | } |
3360 | - public function setCurrency( $currency) { |
|
3360 | + public function setCurrency($currency) { |
|
3361 | 3361 | $this->currency = $currency; |
3362 | 3362 | } |
3363 | 3363 | public function getCurrency() { |
3364 | 3364 | return $this->currency; |
3365 | 3365 | } |
3366 | - public function setDefaultPage( $defaultPage) { |
|
3366 | + public function setDefaultPage($defaultPage) { |
|
3367 | 3367 | $this->defaultPage = $defaultPage; |
3368 | 3368 | } |
3369 | 3369 | public function getDefaultPage() { |
3370 | 3370 | return $this->defaultPage; |
3371 | 3371 | } |
3372 | - public function setECommerceTracking( $eCommerceTracking) { |
|
3372 | + public function setECommerceTracking($eCommerceTracking) { |
|
3373 | 3373 | $this->eCommerceTracking = $eCommerceTracking; |
3374 | 3374 | } |
3375 | 3375 | public function getECommerceTracking() { |
3376 | 3376 | return $this->eCommerceTracking; |
3377 | 3377 | } |
3378 | - public function setExcludeQueryParameters( $excludeQueryParameters) { |
|
3378 | + public function setExcludeQueryParameters($excludeQueryParameters) { |
|
3379 | 3379 | $this->excludeQueryParameters = $excludeQueryParameters; |
3380 | 3380 | } |
3381 | 3381 | public function getExcludeQueryParameters() { |
3382 | 3382 | return $this->excludeQueryParameters; |
3383 | 3383 | } |
3384 | - public function setId( $id) { |
|
3384 | + public function setId($id) { |
|
3385 | 3385 | $this->id = $id; |
3386 | 3386 | } |
3387 | 3387 | public function getId() { |
3388 | 3388 | return $this->id; |
3389 | 3389 | } |
3390 | - public function setInternalWebPropertyId( $internalWebPropertyId) { |
|
3390 | + public function setInternalWebPropertyId($internalWebPropertyId) { |
|
3391 | 3391 | $this->internalWebPropertyId = $internalWebPropertyId; |
3392 | 3392 | } |
3393 | 3393 | public function getInternalWebPropertyId() { |
3394 | 3394 | return $this->internalWebPropertyId; |
3395 | 3395 | } |
3396 | - public function setKind( $kind) { |
|
3396 | + public function setKind($kind) { |
|
3397 | 3397 | $this->kind = $kind; |
3398 | 3398 | } |
3399 | 3399 | public function getKind() { |
3400 | 3400 | return $this->kind; |
3401 | 3401 | } |
3402 | - public function setName( $name) { |
|
3402 | + public function setName($name) { |
|
3403 | 3403 | $this->name = $name; |
3404 | 3404 | } |
3405 | 3405 | public function getName() { |
@@ -3417,49 +3417,49 @@ discard block |
||
3417 | 3417 | public function getPermissions() { |
3418 | 3418 | return $this->permissions; |
3419 | 3419 | } |
3420 | - public function setSelfLink( $selfLink) { |
|
3420 | + public function setSelfLink($selfLink) { |
|
3421 | 3421 | $this->selfLink = $selfLink; |
3422 | 3422 | } |
3423 | 3423 | public function getSelfLink() { |
3424 | 3424 | return $this->selfLink; |
3425 | 3425 | } |
3426 | - public function setSiteSearchCategoryParameters( $siteSearchCategoryParameters) { |
|
3426 | + public function setSiteSearchCategoryParameters($siteSearchCategoryParameters) { |
|
3427 | 3427 | $this->siteSearchCategoryParameters = $siteSearchCategoryParameters; |
3428 | 3428 | } |
3429 | 3429 | public function getSiteSearchCategoryParameters() { |
3430 | 3430 | return $this->siteSearchCategoryParameters; |
3431 | 3431 | } |
3432 | - public function setSiteSearchQueryParameters( $siteSearchQueryParameters) { |
|
3432 | + public function setSiteSearchQueryParameters($siteSearchQueryParameters) { |
|
3433 | 3433 | $this->siteSearchQueryParameters = $siteSearchQueryParameters; |
3434 | 3434 | } |
3435 | 3435 | public function getSiteSearchQueryParameters() { |
3436 | 3436 | return $this->siteSearchQueryParameters; |
3437 | 3437 | } |
3438 | - public function setTimezone( $timezone) { |
|
3438 | + public function setTimezone($timezone) { |
|
3439 | 3439 | $this->timezone = $timezone; |
3440 | 3440 | } |
3441 | 3441 | public function getTimezone() { |
3442 | 3442 | return $this->timezone; |
3443 | 3443 | } |
3444 | - public function setType( $type) { |
|
3444 | + public function setType($type) { |
|
3445 | 3445 | $this->type = $type; |
3446 | 3446 | } |
3447 | 3447 | public function getType() { |
3448 | 3448 | return $this->type; |
3449 | 3449 | } |
3450 | - public function setUpdated( $updated) { |
|
3450 | + public function setUpdated($updated) { |
|
3451 | 3451 | $this->updated = $updated; |
3452 | 3452 | } |
3453 | 3453 | public function getUpdated() { |
3454 | 3454 | return $this->updated; |
3455 | 3455 | } |
3456 | - public function setWebPropertyId( $webPropertyId) { |
|
3456 | + public function setWebPropertyId($webPropertyId) { |
|
3457 | 3457 | $this->webPropertyId = $webPropertyId; |
3458 | 3458 | } |
3459 | 3459 | public function getWebPropertyId() { |
3460 | 3460 | return $this->webPropertyId; |
3461 | 3461 | } |
3462 | - public function setWebsiteUrl( $websiteUrl) { |
|
3462 | + public function setWebsiteUrl($websiteUrl) { |
|
3463 | 3463 | $this->websiteUrl = $websiteUrl; |
3464 | 3464 | } |
3465 | 3465 | public function getWebsiteUrl() { |
@@ -3470,13 +3470,13 @@ discard block |
||
3470 | 3470 | class Google_ProfileChildLink extends Google_Model { |
3471 | 3471 | public $href; |
3472 | 3472 | public $type; |
3473 | - public function setHref( $href) { |
|
3473 | + public function setHref($href) { |
|
3474 | 3474 | $this->href = $href; |
3475 | 3475 | } |
3476 | 3476 | public function getHref() { |
3477 | 3477 | return $this->href; |
3478 | 3478 | } |
3479 | - public function setType( $type) { |
|
3479 | + public function setType($type) { |
|
3480 | 3480 | $this->type = $type; |
3481 | 3481 | } |
3482 | 3482 | public function getType() { |
@@ -3487,13 +3487,13 @@ discard block |
||
3487 | 3487 | class Google_ProfileParentLink extends Google_Model { |
3488 | 3488 | public $href; |
3489 | 3489 | public $type; |
3490 | - public function setHref( $href) { |
|
3490 | + public function setHref($href) { |
|
3491 | 3491 | $this->href = $href; |
3492 | 3492 | } |
3493 | 3493 | public function getHref() { |
3494 | 3494 | return $this->href; |
3495 | 3495 | } |
3496 | - public function setType( $type) { |
|
3496 | + public function setType($type) { |
|
3497 | 3497 | $this->type = $type; |
3498 | 3498 | } |
3499 | 3499 | public function getType() { |
@@ -3520,43 +3520,43 @@ discard block |
||
3520 | 3520 | public $kind; |
3521 | 3521 | public $name; |
3522 | 3522 | public $webPropertyId; |
3523 | - public function setAccountId( $accountId) { |
|
3523 | + public function setAccountId($accountId) { |
|
3524 | 3524 | $this->accountId = $accountId; |
3525 | 3525 | } |
3526 | 3526 | public function getAccountId() { |
3527 | 3527 | return $this->accountId; |
3528 | 3528 | } |
3529 | - public function setHref( $href) { |
|
3529 | + public function setHref($href) { |
|
3530 | 3530 | $this->href = $href; |
3531 | 3531 | } |
3532 | 3532 | public function getHref() { |
3533 | 3533 | return $this->href; |
3534 | 3534 | } |
3535 | - public function setId( $id) { |
|
3535 | + public function setId($id) { |
|
3536 | 3536 | $this->id = $id; |
3537 | 3537 | } |
3538 | 3538 | public function getId() { |
3539 | 3539 | return $this->id; |
3540 | 3540 | } |
3541 | - public function setInternalWebPropertyId( $internalWebPropertyId) { |
|
3541 | + public function setInternalWebPropertyId($internalWebPropertyId) { |
|
3542 | 3542 | $this->internalWebPropertyId = $internalWebPropertyId; |
3543 | 3543 | } |
3544 | 3544 | public function getInternalWebPropertyId() { |
3545 | 3545 | return $this->internalWebPropertyId; |
3546 | 3546 | } |
3547 | - public function setKind( $kind) { |
|
3547 | + public function setKind($kind) { |
|
3548 | 3548 | $this->kind = $kind; |
3549 | 3549 | } |
3550 | 3550 | public function getKind() { |
3551 | 3551 | return $this->kind; |
3552 | 3552 | } |
3553 | - public function setName( $name) { |
|
3553 | + public function setName($name) { |
|
3554 | 3554 | $this->name = $name; |
3555 | 3555 | } |
3556 | 3556 | public function getName() { |
3557 | 3557 | return $this->name; |
3558 | 3558 | } |
3559 | - public function setWebPropertyId( $webPropertyId) { |
|
3559 | + public function setWebPropertyId($webPropertyId) { |
|
3560 | 3560 | $this->webPropertyId = $webPropertyId; |
3561 | 3561 | } |
3562 | 3562 | public function getWebPropertyId() { |
@@ -3582,43 +3582,43 @@ discard block |
||
3582 | 3582 | public function getItems() { |
3583 | 3583 | return $this->items; |
3584 | 3584 | } |
3585 | - public function setItemsPerPage( $itemsPerPage) { |
|
3585 | + public function setItemsPerPage($itemsPerPage) { |
|
3586 | 3586 | $this->itemsPerPage = $itemsPerPage; |
3587 | 3587 | } |
3588 | 3588 | public function getItemsPerPage() { |
3589 | 3589 | return $this->itemsPerPage; |
3590 | 3590 | } |
3591 | - public function setKind( $kind) { |
|
3591 | + public function setKind($kind) { |
|
3592 | 3592 | $this->kind = $kind; |
3593 | 3593 | } |
3594 | 3594 | public function getKind() { |
3595 | 3595 | return $this->kind; |
3596 | 3596 | } |
3597 | - public function setNextLink( $nextLink) { |
|
3597 | + public function setNextLink($nextLink) { |
|
3598 | 3598 | $this->nextLink = $nextLink; |
3599 | 3599 | } |
3600 | 3600 | public function getNextLink() { |
3601 | 3601 | return $this->nextLink; |
3602 | 3602 | } |
3603 | - public function setPreviousLink( $previousLink) { |
|
3603 | + public function setPreviousLink($previousLink) { |
|
3604 | 3604 | $this->previousLink = $previousLink; |
3605 | 3605 | } |
3606 | 3606 | public function getPreviousLink() { |
3607 | 3607 | return $this->previousLink; |
3608 | 3608 | } |
3609 | - public function setStartIndex( $startIndex) { |
|
3609 | + public function setStartIndex($startIndex) { |
|
3610 | 3610 | $this->startIndex = $startIndex; |
3611 | 3611 | } |
3612 | 3612 | public function getStartIndex() { |
3613 | 3613 | return $this->startIndex; |
3614 | 3614 | } |
3615 | - public function setTotalResults( $totalResults) { |
|
3615 | + public function setTotalResults($totalResults) { |
|
3616 | 3616 | $this->totalResults = $totalResults; |
3617 | 3617 | } |
3618 | 3618 | public function getTotalResults() { |
3619 | 3619 | return $this->totalResults; |
3620 | 3620 | } |
3621 | - public function setUsername( $username) { |
|
3621 | + public function setUsername($username) { |
|
3622 | 3622 | $this->username = $username; |
3623 | 3623 | } |
3624 | 3624 | public function getUsername() { |
@@ -3649,13 +3649,13 @@ discard block |
||
3649 | 3649 | public function getColumnHeaders() { |
3650 | 3650 | return $this->columnHeaders; |
3651 | 3651 | } |
3652 | - public function setId( $id) { |
|
3652 | + public function setId($id) { |
|
3653 | 3653 | $this->id = $id; |
3654 | 3654 | } |
3655 | 3655 | public function getId() { |
3656 | 3656 | return $this->id; |
3657 | 3657 | } |
3658 | - public function setKind( $kind) { |
|
3658 | + public function setKind($kind) { |
|
3659 | 3659 | $this->kind = $kind; |
3660 | 3660 | } |
3661 | 3661 | public function getKind() { |
@@ -3680,19 +3680,19 @@ discard block |
||
3680 | 3680 | public function getRows() { |
3681 | 3681 | return $this->rows; |
3682 | 3682 | } |
3683 | - public function setSelfLink( $selfLink) { |
|
3683 | + public function setSelfLink($selfLink) { |
|
3684 | 3684 | $this->selfLink = $selfLink; |
3685 | 3685 | } |
3686 | 3686 | public function getSelfLink() { |
3687 | 3687 | return $this->selfLink; |
3688 | 3688 | } |
3689 | - public function setTotalResults( $totalResults) { |
|
3689 | + public function setTotalResults($totalResults) { |
|
3690 | 3690 | $this->totalResults = $totalResults; |
3691 | 3691 | } |
3692 | 3692 | public function getTotalResults() { |
3693 | 3693 | return $this->totalResults; |
3694 | 3694 | } |
3695 | - public function setTotalsForAllResults( $totalsForAllResults) { |
|
3695 | + public function setTotalsForAllResults($totalsForAllResults) { |
|
3696 | 3696 | $this->totalsForAllResults = $totalsForAllResults; |
3697 | 3697 | } |
3698 | 3698 | public function getTotalsForAllResults() { |
@@ -3704,19 +3704,19 @@ discard block |
||
3704 | 3704 | public $columnType; |
3705 | 3705 | public $dataType; |
3706 | 3706 | public $name; |
3707 | - public function setColumnType( $columnType) { |
|
3707 | + public function setColumnType($columnType) { |
|
3708 | 3708 | $this->columnType = $columnType; |
3709 | 3709 | } |
3710 | 3710 | public function getColumnType() { |
3711 | 3711 | return $this->columnType; |
3712 | 3712 | } |
3713 | - public function setDataType( $dataType) { |
|
3713 | + public function setDataType($dataType) { |
|
3714 | 3714 | $this->dataType = $dataType; |
3715 | 3715 | } |
3716 | 3716 | public function getDataType() { |
3717 | 3717 | return $this->dataType; |
3718 | 3718 | } |
3719 | - public function setName( $name) { |
|
3719 | + public function setName($name) { |
|
3720 | 3720 | $this->name = $name; |
3721 | 3721 | } |
3722 | 3722 | public function getName() { |
@@ -3731,37 +3731,37 @@ discard block |
||
3731 | 3731 | public $profileName; |
3732 | 3732 | public $tableId; |
3733 | 3733 | public $webPropertyId; |
3734 | - public function setAccountId( $accountId) { |
|
3734 | + public function setAccountId($accountId) { |
|
3735 | 3735 | $this->accountId = $accountId; |
3736 | 3736 | } |
3737 | 3737 | public function getAccountId() { |
3738 | 3738 | return $this->accountId; |
3739 | 3739 | } |
3740 | - public function setInternalWebPropertyId( $internalWebPropertyId) { |
|
3740 | + public function setInternalWebPropertyId($internalWebPropertyId) { |
|
3741 | 3741 | $this->internalWebPropertyId = $internalWebPropertyId; |
3742 | 3742 | } |
3743 | 3743 | public function getInternalWebPropertyId() { |
3744 | 3744 | return $this->internalWebPropertyId; |
3745 | 3745 | } |
3746 | - public function setProfileId( $profileId) { |
|
3746 | + public function setProfileId($profileId) { |
|
3747 | 3747 | $this->profileId = $profileId; |
3748 | 3748 | } |
3749 | 3749 | public function getProfileId() { |
3750 | 3750 | return $this->profileId; |
3751 | 3751 | } |
3752 | - public function setProfileName( $profileName) { |
|
3752 | + public function setProfileName($profileName) { |
|
3753 | 3753 | $this->profileName = $profileName; |
3754 | 3754 | } |
3755 | 3755 | public function getProfileName() { |
3756 | 3756 | return $this->profileName; |
3757 | 3757 | } |
3758 | - public function setTableId( $tableId) { |
|
3758 | + public function setTableId($tableId) { |
|
3759 | 3759 | $this->tableId = $tableId; |
3760 | 3760 | } |
3761 | 3761 | public function getTableId() { |
3762 | 3762 | return $this->tableId; |
3763 | 3763 | } |
3764 | - public function setWebPropertyId( $webPropertyId) { |
|
3764 | + public function setWebPropertyId($webPropertyId) { |
|
3765 | 3765 | $this->webPropertyId = $webPropertyId; |
3766 | 3766 | } |
3767 | 3767 | public function getWebPropertyId() { |
@@ -3776,25 +3776,25 @@ discard block |
||
3776 | 3776 | public $max_results; |
3777 | 3777 | public $metrics; |
3778 | 3778 | public $sort; |
3779 | - public function setDimensions( $dimensions) { |
|
3779 | + public function setDimensions($dimensions) { |
|
3780 | 3780 | $this->dimensions = $dimensions; |
3781 | 3781 | } |
3782 | 3782 | public function getDimensions() { |
3783 | 3783 | return $this->dimensions; |
3784 | 3784 | } |
3785 | - public function setFilters( $filters) { |
|
3785 | + public function setFilters($filters) { |
|
3786 | 3786 | $this->filters = $filters; |
3787 | 3787 | } |
3788 | 3788 | public function getFilters() { |
3789 | 3789 | return $this->filters; |
3790 | 3790 | } |
3791 | - public function setIds( $ids) { |
|
3791 | + public function setIds($ids) { |
|
3792 | 3792 | $this->ids = $ids; |
3793 | 3793 | } |
3794 | 3794 | public function getIds() { |
3795 | 3795 | return $this->ids; |
3796 | 3796 | } |
3797 | - public function setMax_results( $max_results) { |
|
3797 | + public function setMax_results($max_results) { |
|
3798 | 3798 | $this->max_results = $max_results; |
3799 | 3799 | } |
3800 | 3800 | public function getMax_results() { |
@@ -3825,49 +3825,49 @@ discard block |
||
3825 | 3825 | public $segmentId; |
3826 | 3826 | public $selfLink; |
3827 | 3827 | public $updated; |
3828 | - public function setCreated( $created) { |
|
3828 | + public function setCreated($created) { |
|
3829 | 3829 | $this->created = $created; |
3830 | 3830 | } |
3831 | 3831 | public function getCreated() { |
3832 | 3832 | return $this->created; |
3833 | 3833 | } |
3834 | - public function setDefinition( $definition) { |
|
3834 | + public function setDefinition($definition) { |
|
3835 | 3835 | $this->definition = $definition; |
3836 | 3836 | } |
3837 | 3837 | public function getDefinition() { |
3838 | 3838 | return $this->definition; |
3839 | 3839 | } |
3840 | - public function setId( $id) { |
|
3840 | + public function setId($id) { |
|
3841 | 3841 | $this->id = $id; |
3842 | 3842 | } |
3843 | 3843 | public function getId() { |
3844 | 3844 | return $this->id; |
3845 | 3845 | } |
3846 | - public function setKind( $kind) { |
|
3846 | + public function setKind($kind) { |
|
3847 | 3847 | $this->kind = $kind; |
3848 | 3848 | } |
3849 | 3849 | public function getKind() { |
3850 | 3850 | return $this->kind; |
3851 | 3851 | } |
3852 | - public function setName( $name) { |
|
3852 | + public function setName($name) { |
|
3853 | 3853 | $this->name = $name; |
3854 | 3854 | } |
3855 | 3855 | public function getName() { |
3856 | 3856 | return $this->name; |
3857 | 3857 | } |
3858 | - public function setSegmentId( $segmentId) { |
|
3858 | + public function setSegmentId($segmentId) { |
|
3859 | 3859 | $this->segmentId = $segmentId; |
3860 | 3860 | } |
3861 | 3861 | public function getSegmentId() { |
3862 | 3862 | return $this->segmentId; |
3863 | 3863 | } |
3864 | - public function setSelfLink( $selfLink) { |
|
3864 | + public function setSelfLink($selfLink) { |
|
3865 | 3865 | $this->selfLink = $selfLink; |
3866 | 3866 | } |
3867 | 3867 | public function getSelfLink() { |
3868 | 3868 | return $this->selfLink; |
3869 | 3869 | } |
3870 | - public function setUpdated( $updated) { |
|
3870 | + public function setUpdated($updated) { |
|
3871 | 3871 | $this->updated = $updated; |
3872 | 3872 | } |
3873 | 3873 | public function getUpdated() { |
@@ -3893,43 +3893,43 @@ discard block |
||
3893 | 3893 | public function getItems() { |
3894 | 3894 | return $this->items; |
3895 | 3895 | } |
3896 | - public function setItemsPerPage( $itemsPerPage) { |
|
3896 | + public function setItemsPerPage($itemsPerPage) { |
|
3897 | 3897 | $this->itemsPerPage = $itemsPerPage; |
3898 | 3898 | } |
3899 | 3899 | public function getItemsPerPage() { |
3900 | 3900 | return $this->itemsPerPage; |
3901 | 3901 | } |
3902 | - public function setKind( $kind) { |
|
3902 | + public function setKind($kind) { |
|
3903 | 3903 | $this->kind = $kind; |
3904 | 3904 | } |
3905 | 3905 | public function getKind() { |
3906 | 3906 | return $this->kind; |
3907 | 3907 | } |
3908 | - public function setNextLink( $nextLink) { |
|
3908 | + public function setNextLink($nextLink) { |
|
3909 | 3909 | $this->nextLink = $nextLink; |
3910 | 3910 | } |
3911 | 3911 | public function getNextLink() { |
3912 | 3912 | return $this->nextLink; |
3913 | 3913 | } |
3914 | - public function setPreviousLink( $previousLink) { |
|
3914 | + public function setPreviousLink($previousLink) { |
|
3915 | 3915 | $this->previousLink = $previousLink; |
3916 | 3916 | } |
3917 | 3917 | public function getPreviousLink() { |
3918 | 3918 | return $this->previousLink; |
3919 | 3919 | } |
3920 | - public function setStartIndex( $startIndex) { |
|
3920 | + public function setStartIndex($startIndex) { |
|
3921 | 3921 | $this->startIndex = $startIndex; |
3922 | 3922 | } |
3923 | 3923 | public function getStartIndex() { |
3924 | 3924 | return $this->startIndex; |
3925 | 3925 | } |
3926 | - public function setTotalResults( $totalResults) { |
|
3926 | + public function setTotalResults($totalResults) { |
|
3927 | 3927 | $this->totalResults = $totalResults; |
3928 | 3928 | } |
3929 | 3929 | public function getTotalResults() { |
3930 | 3930 | return $this->totalResults; |
3931 | 3931 | } |
3932 | - public function setUsername( $username) { |
|
3932 | + public function setUsername($username) { |
|
3933 | 3933 | $this->username = $username; |
3934 | 3934 | } |
3935 | 3935 | public function getUsername() { |
@@ -3944,13 +3944,13 @@ discard block |
||
3944 | 3944 | public $id; |
3945 | 3945 | public $kind; |
3946 | 3946 | public $status; |
3947 | - public function setAccountId( $accountId) { |
|
3947 | + public function setAccountId($accountId) { |
|
3948 | 3948 | $this->accountId = $accountId; |
3949 | 3949 | } |
3950 | 3950 | public function getAccountId() { |
3951 | 3951 | return $this->accountId; |
3952 | 3952 | } |
3953 | - public function setCustomDataSourceId( $customDataSourceId) { |
|
3953 | + public function setCustomDataSourceId($customDataSourceId) { |
|
3954 | 3954 | $this->customDataSourceId = $customDataSourceId; |
3955 | 3955 | } |
3956 | 3956 | public function getCustomDataSourceId() { |
@@ -3963,19 +3963,19 @@ discard block |
||
3963 | 3963 | public function getErrors() { |
3964 | 3964 | return $this->errors; |
3965 | 3965 | } |
3966 | - public function setId( $id) { |
|
3966 | + public function setId($id) { |
|
3967 | 3967 | $this->id = $id; |
3968 | 3968 | } |
3969 | 3969 | public function getId() { |
3970 | 3970 | return $this->id; |
3971 | 3971 | } |
3972 | - public function setKind( $kind) { |
|
3972 | + public function setKind($kind) { |
|
3973 | 3973 | $this->kind = $kind; |
3974 | 3974 | } |
3975 | 3975 | public function getKind() { |
3976 | 3976 | return $this->kind; |
3977 | 3977 | } |
3978 | - public function setStatus( $status) { |
|
3978 | + public function setStatus($status) { |
|
3979 | 3979 | $this->status = $status; |
3980 | 3980 | } |
3981 | 3981 | public function getStatus() { |
@@ -4000,37 +4000,37 @@ discard block |
||
4000 | 4000 | public function getItems() { |
4001 | 4001 | return $this->items; |
4002 | 4002 | } |
4003 | - public function setItemsPerPage( $itemsPerPage) { |
|
4003 | + public function setItemsPerPage($itemsPerPage) { |
|
4004 | 4004 | $this->itemsPerPage = $itemsPerPage; |
4005 | 4005 | } |
4006 | 4006 | public function getItemsPerPage() { |
4007 | 4007 | return $this->itemsPerPage; |
4008 | 4008 | } |
4009 | - public function setKind( $kind) { |
|
4009 | + public function setKind($kind) { |
|
4010 | 4010 | $this->kind = $kind; |
4011 | 4011 | } |
4012 | 4012 | public function getKind() { |
4013 | 4013 | return $this->kind; |
4014 | 4014 | } |
4015 | - public function setNextLink( $nextLink) { |
|
4015 | + public function setNextLink($nextLink) { |
|
4016 | 4016 | $this->nextLink = $nextLink; |
4017 | 4017 | } |
4018 | 4018 | public function getNextLink() { |
4019 | 4019 | return $this->nextLink; |
4020 | 4020 | } |
4021 | - public function setPreviousLink( $previousLink) { |
|
4021 | + public function setPreviousLink($previousLink) { |
|
4022 | 4022 | $this->previousLink = $previousLink; |
4023 | 4023 | } |
4024 | 4024 | public function getPreviousLink() { |
4025 | 4025 | return $this->previousLink; |
4026 | 4026 | } |
4027 | - public function setStartIndex( $startIndex) { |
|
4027 | + public function setStartIndex($startIndex) { |
|
4028 | 4028 | $this->startIndex = $startIndex; |
4029 | 4029 | } |
4030 | 4030 | public function getStartIndex() { |
4031 | 4031 | return $this->startIndex; |
4032 | 4032 | } |
4033 | - public function setTotalResults( $totalResults) { |
|
4033 | + public function setTotalResults($totalResults) { |
|
4034 | 4034 | $this->totalResults = $totalResults; |
4035 | 4035 | } |
4036 | 4036 | public function getTotalResults() { |
@@ -4042,19 +4042,19 @@ discard block |
||
4042 | 4042 | public $email; |
4043 | 4043 | public $id; |
4044 | 4044 | public $kind; |
4045 | - public function setEmail( $email) { |
|
4045 | + public function setEmail($email) { |
|
4046 | 4046 | $this->email = $email; |
4047 | 4047 | } |
4048 | 4048 | public function getEmail() { |
4049 | 4049 | return $this->email; |
4050 | 4050 | } |
4051 | - public function setId( $id) { |
|
4051 | + public function setId($id) { |
|
4052 | 4052 | $this->id = $id; |
4053 | 4053 | } |
4054 | 4054 | public function getId() { |
4055 | 4055 | return $this->id; |
4056 | 4056 | } |
4057 | - public function setKind( $kind) { |
|
4057 | + public function setKind($kind) { |
|
4058 | 4058 | $this->kind = $kind; |
4059 | 4059 | } |
4060 | 4060 | public function getKind() { |
@@ -4069,37 +4069,37 @@ discard block |
||
4069 | 4069 | public $internalWebPropertyId; |
4070 | 4070 | public $kind; |
4071 | 4071 | public $name; |
4072 | - public function setAccountId( $accountId) { |
|
4072 | + public function setAccountId($accountId) { |
|
4073 | 4073 | $this->accountId = $accountId; |
4074 | 4074 | } |
4075 | 4075 | public function getAccountId() { |
4076 | 4076 | return $this->accountId; |
4077 | 4077 | } |
4078 | - public function setHref( $href) { |
|
4078 | + public function setHref($href) { |
|
4079 | 4079 | $this->href = $href; |
4080 | 4080 | } |
4081 | 4081 | public function getHref() { |
4082 | 4082 | return $this->href; |
4083 | 4083 | } |
4084 | - public function setId( $id) { |
|
4084 | + public function setId($id) { |
|
4085 | 4085 | $this->id = $id; |
4086 | 4086 | } |
4087 | 4087 | public function getId() { |
4088 | 4088 | return $this->id; |
4089 | 4089 | } |
4090 | - public function setInternalWebPropertyId( $internalWebPropertyId) { |
|
4090 | + public function setInternalWebPropertyId($internalWebPropertyId) { |
|
4091 | 4091 | $this->internalWebPropertyId = $internalWebPropertyId; |
4092 | 4092 | } |
4093 | 4093 | public function getInternalWebPropertyId() { |
4094 | 4094 | return $this->internalWebPropertyId; |
4095 | 4095 | } |
4096 | - public function setKind( $kind) { |
|
4096 | + public function setKind($kind) { |
|
4097 | 4097 | $this->kind = $kind; |
4098 | 4098 | } |
4099 | 4099 | public function getKind() { |
4100 | 4100 | return $this->kind; |
4101 | 4101 | } |
4102 | - public function setName( $name) { |
|
4102 | + public function setName($name) { |
|
4103 | 4103 | $this->name = $name; |
4104 | 4104 | } |
4105 | 4105 | public function getName() { |
@@ -4125,43 +4125,43 @@ discard block |
||
4125 | 4125 | public function getItems() { |
4126 | 4126 | return $this->items; |
4127 | 4127 | } |
4128 | - public function setItemsPerPage( $itemsPerPage) { |
|
4128 | + public function setItemsPerPage($itemsPerPage) { |
|
4129 | 4129 | $this->itemsPerPage = $itemsPerPage; |
4130 | 4130 | } |
4131 | 4131 | public function getItemsPerPage() { |
4132 | 4132 | return $this->itemsPerPage; |
4133 | 4133 | } |
4134 | - public function setKind( $kind) { |
|
4134 | + public function setKind($kind) { |
|
4135 | 4135 | $this->kind = $kind; |
4136 | 4136 | } |
4137 | 4137 | public function getKind() { |
4138 | 4138 | return $this->kind; |
4139 | 4139 | } |
4140 | - public function setNextLink( $nextLink) { |
|
4140 | + public function setNextLink($nextLink) { |
|
4141 | 4141 | $this->nextLink = $nextLink; |
4142 | 4142 | } |
4143 | 4143 | public function getNextLink() { |
4144 | 4144 | return $this->nextLink; |
4145 | 4145 | } |
4146 | - public function setPreviousLink( $previousLink) { |
|
4146 | + public function setPreviousLink($previousLink) { |
|
4147 | 4147 | $this->previousLink = $previousLink; |
4148 | 4148 | } |
4149 | 4149 | public function getPreviousLink() { |
4150 | 4150 | return $this->previousLink; |
4151 | 4151 | } |
4152 | - public function setStartIndex( $startIndex) { |
|
4152 | + public function setStartIndex($startIndex) { |
|
4153 | 4153 | $this->startIndex = $startIndex; |
4154 | 4154 | } |
4155 | 4155 | public function getStartIndex() { |
4156 | 4156 | return $this->startIndex; |
4157 | 4157 | } |
4158 | - public function setTotalResults( $totalResults) { |
|
4158 | + public function setTotalResults($totalResults) { |
|
4159 | 4159 | $this->totalResults = $totalResults; |
4160 | 4160 | } |
4161 | 4161 | public function getTotalResults() { |
4162 | 4162 | return $this->totalResults; |
4163 | 4163 | } |
4164 | - public function setUsername( $username) { |
|
4164 | + public function setUsername($username) { |
|
4165 | 4165 | $this->username = $username; |
4166 | 4166 | } |
4167 | 4167 | public function getUsername() { |
@@ -4192,7 +4192,7 @@ discard block |
||
4192 | 4192 | public $selfLink; |
4193 | 4193 | public $updated; |
4194 | 4194 | public $websiteUrl; |
4195 | - public function setAccountId( $accountId) { |
|
4195 | + public function setAccountId($accountId) { |
|
4196 | 4196 | $this->accountId = $accountId; |
4197 | 4197 | } |
4198 | 4198 | public function getAccountId() { |
@@ -4204,49 +4204,49 @@ discard block |
||
4204 | 4204 | public function getChildLink() { |
4205 | 4205 | return $this->childLink; |
4206 | 4206 | } |
4207 | - public function setCreated( $created) { |
|
4207 | + public function setCreated($created) { |
|
4208 | 4208 | $this->created = $created; |
4209 | 4209 | } |
4210 | 4210 | public function getCreated() { |
4211 | 4211 | return $this->created; |
4212 | 4212 | } |
4213 | - public function setDefaultProfileId( $defaultProfileId) { |
|
4213 | + public function setDefaultProfileId($defaultProfileId) { |
|
4214 | 4214 | $this->defaultProfileId = $defaultProfileId; |
4215 | 4215 | } |
4216 | 4216 | public function getDefaultProfileId() { |
4217 | 4217 | return $this->defaultProfileId; |
4218 | 4218 | } |
4219 | - public function setId( $id) { |
|
4219 | + public function setId($id) { |
|
4220 | 4220 | $this->id = $id; |
4221 | 4221 | } |
4222 | 4222 | public function getId() { |
4223 | 4223 | return $this->id; |
4224 | 4224 | } |
4225 | - public function setIndustryVertical( $industryVertical) { |
|
4225 | + public function setIndustryVertical($industryVertical) { |
|
4226 | 4226 | $this->industryVertical = $industryVertical; |
4227 | 4227 | } |
4228 | 4228 | public function getIndustryVertical() { |
4229 | 4229 | return $this->industryVertical; |
4230 | 4230 | } |
4231 | - public function setInternalWebPropertyId( $internalWebPropertyId) { |
|
4231 | + public function setInternalWebPropertyId($internalWebPropertyId) { |
|
4232 | 4232 | $this->internalWebPropertyId = $internalWebPropertyId; |
4233 | 4233 | } |
4234 | 4234 | public function getInternalWebPropertyId() { |
4235 | 4235 | return $this->internalWebPropertyId; |
4236 | 4236 | } |
4237 | - public function setKind( $kind) { |
|
4237 | + public function setKind($kind) { |
|
4238 | 4238 | $this->kind = $kind; |
4239 | 4239 | } |
4240 | 4240 | public function getKind() { |
4241 | 4241 | return $this->kind; |
4242 | 4242 | } |
4243 | - public function setLevel( $level) { |
|
4243 | + public function setLevel($level) { |
|
4244 | 4244 | $this->level = $level; |
4245 | 4245 | } |
4246 | 4246 | public function getLevel() { |
4247 | 4247 | return $this->level; |
4248 | 4248 | } |
4249 | - public function setName( $name) { |
|
4249 | + public function setName($name) { |
|
4250 | 4250 | $this->name = $name; |
4251 | 4251 | } |
4252 | 4252 | public function getName() { |
@@ -4264,25 +4264,25 @@ discard block |
||
4264 | 4264 | public function getPermissions() { |
4265 | 4265 | return $this->permissions; |
4266 | 4266 | } |
4267 | - public function setProfileCount( $profileCount) { |
|
4267 | + public function setProfileCount($profileCount) { |
|
4268 | 4268 | $this->profileCount = $profileCount; |
4269 | 4269 | } |
4270 | 4270 | public function getProfileCount() { |
4271 | 4271 | return $this->profileCount; |
4272 | 4272 | } |
4273 | - public function setSelfLink( $selfLink) { |
|
4273 | + public function setSelfLink($selfLink) { |
|
4274 | 4274 | $this->selfLink = $selfLink; |
4275 | 4275 | } |
4276 | 4276 | public function getSelfLink() { |
4277 | 4277 | return $this->selfLink; |
4278 | 4278 | } |
4279 | - public function setUpdated( $updated) { |
|
4279 | + public function setUpdated($updated) { |
|
4280 | 4280 | $this->updated = $updated; |
4281 | 4281 | } |
4282 | 4282 | public function getUpdated() { |
4283 | 4283 | return $this->updated; |
4284 | 4284 | } |
4285 | - public function setWebsiteUrl( $websiteUrl) { |
|
4285 | + public function setWebsiteUrl($websiteUrl) { |
|
4286 | 4286 | $this->websiteUrl = $websiteUrl; |
4287 | 4287 | } |
4288 | 4288 | public function getWebsiteUrl() { |
@@ -4293,13 +4293,13 @@ discard block |
||
4293 | 4293 | class Google_WebpropertyChildLink extends Google_Model { |
4294 | 4294 | public $href; |
4295 | 4295 | public $type; |
4296 | - public function setHref( $href) { |
|
4296 | + public function setHref($href) { |
|
4297 | 4297 | $this->href = $href; |
4298 | 4298 | } |
4299 | 4299 | public function getHref() { |
4300 | 4300 | return $this->href; |
4301 | 4301 | } |
4302 | - public function setType( $type) { |
|
4302 | + public function setType($type) { |
|
4303 | 4303 | $this->type = $type; |
4304 | 4304 | } |
4305 | 4305 | public function getType() { |
@@ -4310,13 +4310,13 @@ discard block |
||
4310 | 4310 | class Google_WebpropertyParentLink extends Google_Model { |
4311 | 4311 | public $href; |
4312 | 4312 | public $type; |
4313 | - public function setHref( $href) { |
|
4313 | + public function setHref($href) { |
|
4314 | 4314 | $this->href = $href; |
4315 | 4315 | } |
4316 | 4316 | public function getHref() { |
4317 | 4317 | return $this->href; |
4318 | 4318 | } |
4319 | - public function setType( $type) { |
|
4319 | + public function setType($type) { |
|
4320 | 4320 | $this->type = $type; |
4321 | 4321 | } |
4322 | 4322 | public function getType() { |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | * Source: http://github.com/KevBurnsJr/php-uri-template-parser |
29 | 29 | */ |
30 | 30 | |
31 | -if( ! class_exists( 'URI_Template_Parser' ) ) { |
|
31 | +if (!class_exists('URI_Template_Parser')) { |
|
32 | 32 | class URI_Template_Parser { |
33 | 33 | |
34 | 34 | public static $operators = array('+', ';', '?', '/', '.'); |
@@ -51,8 +51,8 @@ discard block |
||
51 | 51 | |
52 | 52 | public function expand($data) { |
53 | 53 | // Modification to make this a bit more performant (since gettype is very slow) |
54 | - if (! is_array($data)) { |
|
55 | - $data = (array)$data; |
|
54 | + if (!is_array($data)) { |
|
55 | + $data = (array) $data; |
|
56 | 56 | } |
57 | 57 | /* |
58 | 58 | // Original code, which uses a slow gettype() statement, kept in place for if the assumption that is_array always works here is incorrect |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | } |
144 | 144 | $part .= $val; |
145 | 145 | } |
146 | - if (! $exp->one_var_defined) $part = ''; |
|
146 | + if (!$exp->one_var_defined) $part = ''; |
|
147 | 147 | $this->expansion = str_replace($exp->expression, $part, $this->expansion); |
148 | 148 | } |
149 | 149 | |
@@ -154,8 +154,8 @@ discard block |
||
154 | 154 | $val = ''; |
155 | 155 | if (is_array($var->data)) { |
156 | 156 | $i = 0; |
157 | - if ($exp->operator == '?' && ! $var->modifier) { |
|
158 | - $val .= $var->name . '='; |
|
157 | + if ($exp->operator == '?' && !$var->modifier) { |
|
158 | + $val .= $var->name.'='; |
|
159 | 159 | } |
160 | 160 | foreach ($var->data as $k => $v) { |
161 | 161 | $del = $var->modifier ? $exp->delimiter : ','; |
@@ -165,35 +165,35 @@ discard block |
||
165 | 165 | // Array |
166 | 166 | if ($k !== $i) { |
167 | 167 | if ($var->modifier == '+') { |
168 | - $val .= $var->name . '.'; |
|
168 | + $val .= $var->name.'.'; |
|
169 | 169 | } |
170 | 170 | if ($exp->operator == '?' && $var->modifier || $exp->operator == ';' && $var->modifier == '*' || $exp->operator == ';' && $var->modifier == '+') { |
171 | - $val .= $ek . '='; |
|
171 | + $val .= $ek.'='; |
|
172 | 172 | } else { |
173 | - $val .= $ek . $del; |
|
173 | + $val .= $ek.$del; |
|
174 | 174 | } |
175 | 175 | |
176 | 176 | // List |
177 | 177 | } else { |
178 | 178 | if ($var->modifier == '+') { |
179 | 179 | if ($exp->operator == ';' && $var->modifier == '*' || $exp->operator == ';' && $var->modifier == '+' || $exp->operator == '?' && $var->modifier == '+') { |
180 | - $val .= $var->name . '='; |
|
180 | + $val .= $var->name.'='; |
|
181 | 181 | } else { |
182 | - $val .= $var->name . '.'; |
|
182 | + $val .= $var->name.'.'; |
|
183 | 183 | } |
184 | 184 | } |
185 | 185 | } |
186 | - $val .= $ev . $del; |
|
187 | - $i ++; |
|
186 | + $val .= $ev.$del; |
|
187 | + $i++; |
|
188 | 188 | } |
189 | 189 | $val = trim($val, $del); |
190 | 190 | |
191 | 191 | // Strings, numbers, etc. |
192 | 192 | } else { |
193 | 193 | if ($exp->operator == '?') { |
194 | - $val = $var->name . (isset($var->data) ? '=' : ''); |
|
194 | + $val = $var->name.(isset($var->data) ? '=' : ''); |
|
195 | 195 | } else if ($exp->operator == ';') { |
196 | - $val = $var->name . ($var->data ? '=' : ''); |
|
196 | + $val = $var->name.($var->data ? '=' : ''); |
|
197 | 197 | } |
198 | 198 | $val .= rawurlencode($var->data); |
199 | 199 | if ($exp->operator == '+') { |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | |
29 | 29 | public function __construct() { |
30 | 30 | global $apiConfig; |
31 | - if (! function_exists('memcache_connect')) { |
|
31 | + if (!function_exists('memcache_connect')) { |
|
32 | 32 | throw new Google_CacheException("Memcache functions not available"); |
33 | 33 | } |
34 | 34 | $this->host = $apiConfig['ioMemCacheCache_host']; |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | |
41 | 41 | private function isLocked($key) { |
42 | 42 | $this->check(); |
43 | - if ((@memcache_get($this->connection, $key . '.lock')) === false) { |
|
43 | + if ((@memcache_get($this->connection, $key.'.lock')) === false) { |
|
44 | 44 | return false; |
45 | 45 | } |
46 | 46 | return true; |
@@ -50,13 +50,13 @@ discard block |
||
50 | 50 | $this->check(); |
51 | 51 | // the interesting thing is that this could fail if the lock was created in the meantime.. |
52 | 52 | // but we'll ignore that out of convenience |
53 | - @memcache_add($this->connection, $key . '.lock', '', 0, 5); |
|
53 | + @memcache_add($this->connection, $key.'.lock', '', 0, 5); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | private function removeLock($key) { |
57 | 57 | $this->check(); |
58 | 58 | // suppress all warnings, if some other process removed it that's ok too |
59 | - @memcache_delete($this->connection, $key . '.lock'); |
|
59 | + @memcache_delete($this->connection, $key.'.lock'); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | private function waitForLock($key) { |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | do { |
68 | 68 | // 250 ms is a long time to sleep, but it does stop the server from burning all resources on polling locks.. |
69 | 69 | usleep(250); |
70 | - $cnt ++; |
|
70 | + $cnt++; |
|
71 | 71 | } while ($cnt <= $tries && $this->isLocked($key)); |
72 | 72 | if ($this->isLocked($key)) { |
73 | 73 | // 5 seconds passed, assume the owning process died off and remove it |
@@ -78,13 +78,13 @@ discard block |
||
78 | 78 | // I prefer lazy initialization since the cache isn't used every request |
79 | 79 | // so this potentially saves a lot of overhead |
80 | 80 | private function connect() { |
81 | - if (! $this->connection = @memcache_pconnect($this->host, $this->port)) { |
|
81 | + if (!$this->connection = @memcache_pconnect($this->host, $this->port)) { |
|
82 | 82 | throw new Google_CacheException("Couldn't connect to memcache server"); |
83 | 83 | } |
84 | 84 | } |
85 | 85 | |
86 | 86 | private function check() { |
87 | - if (! $this->connection) { |
|
87 | + if (!$this->connection) { |
|
88 | 88 | $this->connect(); |
89 | 89 | } |
90 | 90 | } |