@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | |
283 | 283 | //php |
284 | 284 | if (!empty($tc['geodir_theme_compat_code'])) { |
285 | - include_once('geodirectory-functions/compatibility/' . $tc['geodir_theme_compat_code'] . '.php'); |
|
285 | + include_once('geodirectory-functions/compatibility/'.$tc['geodir_theme_compat_code'].'.php'); |
|
286 | 286 | } |
287 | 287 | |
288 | 288 | //geodir_full_page_class |
@@ -452,13 +452,13 @@ discard block |
||
452 | 452 | function geodir_action_wrapper_content_open($type = '', $id = '', $class = '') |
453 | 453 | { |
454 | 454 | if ($type == 'home-page' && $width = get_option('geodir_width_home_contant_section')) { |
455 | - $width_css = 'style="width:' . $width . '%;"'; |
|
455 | + $width_css = 'style="width:'.$width.'%;"'; |
|
456 | 456 | } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_contant_section')) { |
457 | - $width_css = 'style="width:' . $width . '%;"'; |
|
457 | + $width_css = 'style="width:'.$width.'%;"'; |
|
458 | 458 | } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_contant_section')) { |
459 | - $width_css = 'style="width:' . $width . '%;"'; |
|
459 | + $width_css = 'style="width:'.$width.'%;"'; |
|
460 | 460 | } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_contant_section')) { |
461 | - $width_css = 'style="width:' . $width . '%;"'; |
|
461 | + $width_css = 'style="width:'.$width.'%;"'; |
|
462 | 462 | } else { |
463 | 463 | $width_css = ''; |
464 | 464 | } |
@@ -572,13 +572,13 @@ discard block |
||
572 | 572 | function geodir_action_sidebar_right_open($type = '', $id = '', $class = '', $itemtype = '') |
573 | 573 | { |
574 | 574 | if ($type == 'home-page' && $width = get_option('geodir_width_home_right_section')) { |
575 | - $width_css = 'style="width:' . $width . '%;"'; |
|
575 | + $width_css = 'style="width:'.$width.'%;"'; |
|
576 | 576 | } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_right_section')) { |
577 | - $width_css = 'style="width:' . $width . '%;"'; |
|
577 | + $width_css = 'style="width:'.$width.'%;"'; |
|
578 | 578 | } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_right_section')) { |
579 | - $width_css = 'style="width:' . $width . '%;"'; |
|
579 | + $width_css = 'style="width:'.$width.'%;"'; |
|
580 | 580 | } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_right_section')) { |
581 | - $width_css = 'style="width:' . $width . '%;"'; |
|
581 | + $width_css = 'style="width:'.$width.'%;"'; |
|
582 | 582 | } else { |
583 | 583 | $width_css = ''; |
584 | 584 | } |
@@ -676,7 +676,7 @@ discard block |
||
676 | 676 | } |
677 | 677 | } |
678 | 678 | |
679 | - $post = (object)$_REQUEST; |
|
679 | + $post = (object) $_REQUEST; |
|
680 | 680 | |
681 | 681 | |
682 | 682 | if (isset($post->video)) { |
@@ -735,10 +735,10 @@ discard block |
||
735 | 735 | |
736 | 736 | $json = '{'; |
737 | 737 | $json .= '"post_preview": "1",'; |
738 | - $json .= '"t": "' . $json_title . '",'; |
|
739 | - $json .= '"lt": "' . $post_latitude . '",'; |
|
740 | - $json .= '"ln": "' . $post_longitude . '",'; |
|
741 | - $json .= '"i":"' . $term_icon . '"'; |
|
738 | + $json .= '"t": "'.$json_title.'",'; |
|
739 | + $json .= '"lt": "'.$post_latitude.'",'; |
|
740 | + $json .= '"ln": "'.$post_longitude.'",'; |
|
741 | + $json .= '"i":"'.$term_icon.'"'; |
|
742 | 742 | $json .= '}'; |
743 | 743 | |
744 | 744 | $post->marker_json = $json; |
@@ -965,7 +965,7 @@ discard block |
||
965 | 965 | * @param string $class The class to use. Default is 'entry-header'. |
966 | 966 | */ |
967 | 967 | $class_header = apply_filters('geodir_page_title_header_class', 'entry-header'); |
968 | - echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . stripslashes(get_the_title()) . '</h1></header>'; |
|
968 | + echo '<header class="'.$class_header.'"><h1 class="'.$class.'">'.stripslashes(get_the_title()).'</h1></header>'; |
|
969 | 969 | } |
970 | 970 | |
971 | 971 | |
@@ -1019,7 +1019,7 @@ discard block |
||
1019 | 1019 | $height = !empty($sizes) && isset($sizes[1]) ? $sizes[1] : 0; |
1020 | 1020 | |
1021 | 1021 | if ($image && $width && $height) { |
1022 | - $image = (object)array('src' => $image, 'width' => $width, 'height' => $height); |
|
1022 | + $image = (object) array('src' => $image, 'width' => $width, 'height' => $height); |
|
1023 | 1023 | } |
1024 | 1024 | |
1025 | 1025 | if (isset($image->src)) { |
@@ -1031,9 +1031,9 @@ discard block |
||
1031 | 1031 | |
1032 | 1032 | $image_title = isset($image->title) ? $image->title : ''; |
1033 | 1033 | |
1034 | - $main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />'; |
|
1035 | - $main_slides .= '<img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:400px;margin:0 auto;" /></li>'; |
|
1036 | - $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:48px;margin:0 auto;" /></li>'; |
|
1034 | + $main_slides .= '<li><img src="'.geodir_plugin_url()."/geodirectory-assets/images/spacer.gif".'" alt="'.$image_title.'" title="'.$image_title.'" style="max-height:'.$spacer_height.'px;margin:0 auto;" />'; |
|
1035 | + $main_slides .= '<img src="'.$image->src.'" alt="'.$image_title.'" title="'.$image_title.'" style="max-height:400px;margin:0 auto;" /></li>'; |
|
1036 | + $nav_slides .= '<li><img src="'.$image->src.'" alt="'.$image_title.'" title="'.$image_title.'" style="max-height:48px;margin:0 auto;" /></li>'; |
|
1037 | 1037 | $slides++; |
1038 | 1038 | } |
1039 | 1039 | } |
@@ -1052,10 +1052,10 @@ discard block |
||
1052 | 1052 | } else { |
1053 | 1053 | $spacer_height = ((400 - $image->height) / 2); |
1054 | 1054 | } |
1055 | - $caption = '';//(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : ''; |
|
1056 | - $main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />'; |
|
1057 | - $main_slides .= '<img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:400px;margin:0 auto;" />'.$caption.'</li>'; |
|
1058 | - $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:48px;margin:0 auto;" /></li>'; |
|
1055 | + $caption = ''; //(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : ''; |
|
1056 | + $main_slides .= '<li><img src="'.geodir_plugin_url()."/geodirectory-assets/images/spacer.gif".'" alt="'.$image->title.'" title="'.$image->title.'" style="max-height:'.$spacer_height.'px;margin:0 auto;" />'; |
|
1057 | + $main_slides .= '<img src="'.$image->src.'" alt="'.$image->title.'" title="'.$image->title.'" style="max-height:400px;margin:0 auto;" />'.$caption.'</li>'; |
|
1058 | + $nav_slides .= '<li><img src="'.$image->src.'" alt="'.$image->title.'" title="'.$image->title.'" style="max-height:48px;margin:0 auto;" /></li>'; |
|
1059 | 1059 | $slides++; |
1060 | 1060 | } |
1061 | 1061 | }// endfore |
@@ -1090,7 +1090,7 @@ discard block |
||
1090 | 1090 | */ |
1091 | 1091 | function geodir_action_details_taxonomies() |
1092 | 1092 | { |
1093 | - global $preview, $post;?> |
|
1093 | + global $preview, $post; ?> |
|
1094 | 1094 | <p class="geodir_post_taxomomies clearfix"> |
1095 | 1095 | <?php |
1096 | 1096 | $taxonomies = array(); |
@@ -1099,11 +1099,11 @@ discard block |
||
1099 | 1099 | |
1100 | 1100 | if ($preview && !$is_backend_preview) { |
1101 | 1101 | $post_type = $post->listing_type; |
1102 | - $post_taxonomy = $post_type . 'category'; |
|
1102 | + $post_taxonomy = $post_type.'category'; |
|
1103 | 1103 | $post->{$post_taxonomy} = $post->post_category[$post_taxonomy]; |
1104 | 1104 | } else { |
1105 | 1105 | $post_type = $post->post_type; |
1106 | - $post_taxonomy = $post_type . 'category'; |
|
1106 | + $post_taxonomy = $post_type.'category'; |
|
1107 | 1107 | } |
1108 | 1108 | //{ |
1109 | 1109 | $post_type_info = get_post_type_object($post_type); |
@@ -1111,7 +1111,7 @@ discard block |
||
1111 | 1111 | |
1112 | 1112 | if (!empty($post->post_tags)) { |
1113 | 1113 | |
1114 | - if (taxonomy_exists($post_type . '_tags')): |
|
1114 | + if (taxonomy_exists($post_type.'_tags')): |
|
1115 | 1115 | $links = array(); |
1116 | 1116 | $terms = array(); |
1117 | 1117 | // to limit post tags |
@@ -1137,8 +1137,8 @@ discard block |
||
1137 | 1137 | $post_term = trim($post_term); |
1138 | 1138 | |
1139 | 1139 | $priority_location = false; |
1140 | - if ($insert_term = term_exists($post_term, $post_type . '_tags')) { |
|
1141 | - $term = get_term_by('name', $post_term, $post_type . '_tags'); |
|
1140 | + if ($insert_term = term_exists($post_term, $post_type.'_tags')) { |
|
1141 | + $term = get_term_by('name', $post_term, $post_type.'_tags'); |
|
1142 | 1142 | } else { |
1143 | 1143 | $post_country = isset($_REQUEST['post_country']) && $_REQUEST['post_country'] != '' ? sanitize_text_field($_REQUEST['post_country']) : NULL; |
1144 | 1144 | $post_region = isset($_REQUEST['post_region']) && $_REQUEST['post_region'] != '' ? sanitize_text_field($_REQUEST['post_region']) : NULL; |
@@ -1148,10 +1148,10 @@ discard block |
||
1148 | 1148 | $match_city = $post_city && sanitize_title($post_term) == sanitize_title($post_city) ? true : false; |
1149 | 1149 | if ($match_country || $match_region || $match_city) { |
1150 | 1150 | $priority_location = true; |
1151 | - $term = get_term_by('name', $post_term, $post_type . '_tags'); |
|
1151 | + $term = get_term_by('name', $post_term, $post_type.'_tags'); |
|
1152 | 1152 | } else { |
1153 | - $insert_term = wp_insert_term($post_term, $post_type . '_tags'); |
|
1154 | - $term = get_term_by('name', $post_term, $post_type . '_tags'); |
|
1153 | + $insert_term = wp_insert_term($post_term, $post_type.'_tags'); |
|
1154 | + $term = get_term_by('name', $post_term, $post_type.'_tags'); |
|
1155 | 1155 | } |
1156 | 1156 | } |
1157 | 1157 | |
@@ -1168,12 +1168,12 @@ discard block |
||
1168 | 1168 | * @param string $tag_link The tag link html. |
1169 | 1169 | * @param object $term The tag term object. |
1170 | 1170 | */ |
1171 | - $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term); |
|
1171 | + $tag_link = apply_filters('geodir_details_taxonomies_tag_link', $tag_link, $term); |
|
1172 | 1172 | $links[] = $tag_link; |
1173 | 1173 | } else { |
1174 | - $tag_link = "<a href='" . esc_attr(get_term_link($term->term_id, $term->taxonomy)) . "'>$term->name</a>"; |
|
1174 | + $tag_link = "<a href='".esc_attr(get_term_link($term->term_id, $term->taxonomy))."'>$term->name</a>"; |
|
1175 | 1175 | /** This action is documented in geodirectory-template_actions.php */ |
1176 | - $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term); |
|
1176 | + $tag_link = apply_filters('geodir_details_taxonomies_tag_link', $tag_link, $term); |
|
1177 | 1177 | $links[] = $tag_link; |
1178 | 1178 | } |
1179 | 1179 | $terms[] = $term; |
@@ -1183,7 +1183,7 @@ discard block |
||
1183 | 1183 | if (!isset($listing_label)) { |
1184 | 1184 | $listing_label = ''; |
1185 | 1185 | } |
1186 | - $taxonomies[$post_type . '_tags'] = wp_sprintf(__('%s Tags: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms); |
|
1186 | + $taxonomies[$post_type.'_tags'] = wp_sprintf(__('%s Tags: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object) $terms); |
|
1187 | 1187 | endif; |
1188 | 1188 | |
1189 | 1189 | } |
@@ -1211,7 +1211,7 @@ discard block |
||
1211 | 1211 | $term = get_term_by('id', $post_term, $post_taxonomy); |
1212 | 1212 | |
1213 | 1213 | if (is_object($term)) { |
1214 | - $term_link = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>$term->name</a>"; |
|
1214 | + $term_link = "<a href='".esc_attr(get_term_link($term, $post_taxonomy))."'>$term->name</a>"; |
|
1215 | 1215 | /** |
1216 | 1216 | * Filter the category name on the details page. |
1217 | 1217 | * |
@@ -1219,7 +1219,7 @@ discard block |
||
1219 | 1219 | * @param string $term_link The link html to the category. |
1220 | 1220 | * @param object $term The category term object. |
1221 | 1221 | */ |
1222 | - $term_link = apply_filters('geodir_details_taxonomies_cat_link',$term_link,$term); |
|
1222 | + $term_link = apply_filters('geodir_details_taxonomies_cat_link', $term_link, $term); |
|
1223 | 1223 | $links[] = $term_link; |
1224 | 1224 | $terms[] = $term; |
1225 | 1225 | } |
@@ -1237,7 +1237,7 @@ discard block |
||
1237 | 1237 | if (!isset($listing_label)) { |
1238 | 1238 | $listing_label = ''; |
1239 | 1239 | } |
1240 | - $taxonomies[$post_taxonomy] = wp_sprintf(__('%s Category: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms); |
|
1240 | + $taxonomies[$post_taxonomy] = wp_sprintf(__('%s Category: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object) $terms); |
|
1241 | 1241 | |
1242 | 1242 | } |
1243 | 1243 | |
@@ -1250,14 +1250,14 @@ discard block |
||
1250 | 1250 | * @param string $listing_label The post type label. |
1251 | 1251 | * @param string $listing_label The post type label with ucwords function. |
1252 | 1252 | */ |
1253 | - $taxonomies = apply_filters('geodir_details_taxonomies_output',$taxonomies,$post_type,$listing_label,geodir_ucwords($listing_label)); |
|
1253 | + $taxonomies = apply_filters('geodir_details_taxonomies_output', $taxonomies, $post_type, $listing_label, geodir_ucwords($listing_label)); |
|
1254 | 1254 | |
1255 | 1255 | if (isset($taxonomies[$post_taxonomy])) { |
1256 | - echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>'; |
|
1256 | + echo '<span class="geodir-category">'.$taxonomies[$post_taxonomy].'</span>'; |
|
1257 | 1257 | } |
1258 | 1258 | |
1259 | - if (isset($taxonomies[$post_type . '_tags'])) |
|
1260 | - echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>'; |
|
1259 | + if (isset($taxonomies[$post_type.'_tags'])) |
|
1260 | + echo '<span class="geodir-tags">'.$taxonomies[$post_type.'_tags'].'</span>'; |
|
1261 | 1261 | |
1262 | 1262 | ?> |
1263 | 1263 | </p><?php |
@@ -1278,11 +1278,11 @@ discard block |
||
1278 | 1278 | * @param object $post Optional. The post object or blank. |
1279 | 1279 | * @package GeoDirectory |
1280 | 1280 | */ |
1281 | -function geodir_action_details_micordata($post='') |
|
1281 | +function geodir_action_details_micordata($post = '') |
|
1282 | 1282 | { |
1283 | 1283 | |
1284 | 1284 | global $preview; |
1285 | - if(empty($post)){global $post;} |
|
1285 | + if (empty($post)) {global $post; } |
|
1286 | 1286 | if ($preview || !geodir_is_page('detail')) { |
1287 | 1287 | return; |
1288 | 1288 | } |
@@ -1303,7 +1303,7 @@ discard block |
||
1303 | 1303 | "description" => $review->comment_content, |
1304 | 1304 | "reviewRating" => array( |
1305 | 1305 | "@type" => "Rating", |
1306 | - "bestRating" => "5",// @todo this will need to be filtered for review manager if user changes the score. |
|
1306 | + "bestRating" => "5", // @todo this will need to be filtered for review manager if user changes the score. |
|
1307 | 1307 | "ratingValue" => geodir_get_commentoverall($review->comment_ID), |
1308 | 1308 | "worstRating" => "1" |
1309 | 1309 | ) |
@@ -1331,13 +1331,13 @@ discard block |
||
1331 | 1331 | } |
1332 | 1332 | //print_r($post); |
1333 | 1333 | // external links |
1334 | - $external_links = array(); |
|
1334 | + $external_links = array(); |
|
1335 | 1335 | $external_links[] = $post->geodir_website; |
1336 | 1336 | $external_links[] = $post->geodir_twitter; |
1337 | 1337 | $external_links[] = $post->geodir_facebook; |
1338 | 1338 | $external_links = array_filter($external_links); |
1339 | 1339 | |
1340 | - if(!empty($external_links)){ |
|
1340 | + if (!empty($external_links)) { |
|
1341 | 1341 | $external_links = array_values($external_links); |
1342 | 1342 | } |
1343 | 1343 | |
@@ -1347,17 +1347,17 @@ discard block |
||
1347 | 1347 | |
1348 | 1348 | // schema type |
1349 | 1349 | $schema_type = 'LocalBusiness'; |
1350 | - if(isset($post->default_category) && $post->default_category){ |
|
1350 | + if (isset($post->default_category) && $post->default_category) { |
|
1351 | 1351 | $cat_schema = get_tax_meta($post->default_category, 'ct_cat_schema', false, $post->post_type); |
1352 | - if($cat_schema){$schema_type = $cat_schema;} |
|
1353 | - if(!$schema_type && $post->post_type=='gd_event'){$schema_type = 'Event';} |
|
1352 | + if ($cat_schema) {$schema_type = $cat_schema; } |
|
1353 | + if (!$schema_type && $post->post_type == 'gd_event') {$schema_type = 'Event'; } |
|
1354 | 1354 | } |
1355 | 1355 | |
1356 | 1356 | $schema = array(); |
1357 | 1357 | $schema['@context'] = "http://schema.org"; |
1358 | 1358 | $schema['@type'] = $schema_type; |
1359 | 1359 | $schema['name'] = $post->post_name; |
1360 | - $schema['description'] = wp_strip_all_tags( $post->post_content, true ); |
|
1360 | + $schema['description'] = wp_strip_all_tags($post->post_content, true); |
|
1361 | 1361 | $schema['telephone'] = $post->geodir_contact; |
1362 | 1362 | $schema['url'] = $c_url; |
1363 | 1363 | $schema['sameAs'] = $external_links; |
@@ -1371,7 +1371,7 @@ discard block |
||
1371 | 1371 | "postalCode" => $post->post_zip |
1372 | 1372 | ); |
1373 | 1373 | |
1374 | - if($post->post_latitude && $post->post_longitude) { |
|
1374 | + if ($post->post_latitude && $post->post_longitude) { |
|
1375 | 1375 | $schema['geo'] = array( |
1376 | 1376 | "@type" => "GeoCoordinates", |
1377 | 1377 | "latitude" => $post->post_latitude, |
@@ -1379,7 +1379,7 @@ discard block |
||
1379 | 1379 | ); |
1380 | 1380 | } |
1381 | 1381 | |
1382 | - if($post_avgratings) { |
|
1382 | + if ($post_avgratings) { |
|
1383 | 1383 | $schema['aggregateRating'] = array( |
1384 | 1384 | "@type" => "AggregateRating", |
1385 | 1385 | "ratingValue" => $post_avgratings, |
@@ -1398,10 +1398,10 @@ discard block |
||
1398 | 1398 | * @param array $schema The array of schema data to be filtered. |
1399 | 1399 | * @param object $post The post object. |
1400 | 1400 | */ |
1401 | - $schema = apply_filters('geodir_details_schema', $schema,$post); |
|
1401 | + $schema = apply_filters('geodir_details_schema', $schema, $post); |
|
1402 | 1402 | |
1403 | 1403 | |
1404 | - echo '<script type="application/ld+json">' . json_encode($schema) . '</script>'; |
|
1404 | + echo '<script type="application/ld+json">'.json_encode($schema).'</script>'; |
|
1405 | 1405 | |
1406 | 1406 | } |
1407 | 1407 | |
@@ -1422,9 +1422,9 @@ discard block |
||
1422 | 1422 | ?> |
1423 | 1423 | <div class="geodir-pos_navigation clearfix"> |
1424 | 1424 | <div |
1425 | - class="geodir-post_left"><?php previous_post_link('%link', '' . __('Previous', 'geodirectory'), false) ?></div> |
|
1425 | + class="geodir-post_left"><?php previous_post_link('%link', ''.__('Previous', 'geodirectory'), false) ?></div> |
|
1426 | 1426 | <div |
1427 | - class="geodir-post_right"><?php next_post_link('%link', __('Next', 'geodirectory') . '', false) ?></div> |
|
1427 | + class="geodir-post_right"><?php next_post_link('%link', __('Next', 'geodirectory').'', false) ?></div> |
|
1428 | 1428 | </div><?php |
1429 | 1429 | } |
1430 | 1430 | |
@@ -1493,12 +1493,12 @@ discard block |
||
1493 | 1493 | $gd_post_type = geodir_get_current_posttype(); |
1494 | 1494 | $post_type_info = get_post_type_object($gd_post_type); |
1495 | 1495 | |
1496 | - $add_string_in_title = __('All', 'geodirectory') . ' '; |
|
1496 | + $add_string_in_title = __('All', 'geodirectory').' '; |
|
1497 | 1497 | if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') { |
1498 | - $add_string_in_title = __('My Favorite', 'geodirectory') . ' '; |
|
1498 | + $add_string_in_title = __('My Favorite', 'geodirectory').' '; |
|
1499 | 1499 | } |
1500 | 1500 | |
1501 | - $list_title = $add_string_in_title . __(ucfirst($post_type_info->labels->name), 'geodirectory'); |
|
1501 | + $list_title = $add_string_in_title.__(ucfirst($post_type_info->labels->name), 'geodirectory'); |
|
1502 | 1502 | $single_name = $post_type_info->labels->singular_name; |
1503 | 1503 | |
1504 | 1504 | $taxonomy = geodir_get_taxonomies($gd_post_type, true); |
@@ -1526,12 +1526,12 @@ discard block |
||
1526 | 1526 | $current_term = get_term_by('slug', $term, $taxonomy[0]); |
1527 | 1527 | if (!empty($current_term)) { |
1528 | 1528 | $current_term_name = __(ucfirst($current_term->name), 'geodirectory'); |
1529 | - if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') { |
|
1529 | + if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type.'category') { |
|
1530 | 1530 | $location_last_char = substr($location_name, -1); |
1531 | 1531 | $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory'); |
1532 | - $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name; |
|
1532 | + $list_title .= __(' in', 'geodirectory').' '.$location_name.$location_name_attach.' '.$current_term_name; |
|
1533 | 1533 | } else { |
1534 | - $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'"; |
|
1534 | + $list_title .= __(' in', 'geodirectory')." '".$current_term_name."'"; |
|
1535 | 1535 | } |
1536 | 1536 | } else { |
1537 | 1537 | if (count($taxonomy) > 1) { |
@@ -1539,12 +1539,12 @@ discard block |
||
1539 | 1539 | |
1540 | 1540 | if (!empty($current_term)) { |
1541 | 1541 | $current_term_name = __(ucfirst($current_term->name), 'geodirectory'); |
1542 | - if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') { |
|
1542 | + if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type.'category') { |
|
1543 | 1543 | $location_last_char = substr($location_name, -1); |
1544 | 1544 | $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory'); |
1545 | - $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name; |
|
1545 | + $list_title .= __(' in', 'geodirectory').' '.$location_name.$location_name_attach.' '.$current_term_name; |
|
1546 | 1546 | } else { |
1547 | - $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'"; |
|
1547 | + $list_title .= __(' in', 'geodirectory')." '".$current_term_name."'"; |
|
1548 | 1548 | } |
1549 | 1549 | } |
1550 | 1550 | } |
@@ -1572,7 +1572,7 @@ discard block |
||
1572 | 1572 | $gd_city = __(geodir_ucwords($gd_city), 'geodirectory'); |
1573 | 1573 | } |
1574 | 1574 | |
1575 | - $list_title .= __(' in', 'geodirectory') . " '" . $gd_city . "'"; |
|
1575 | + $list_title .= __(' in', 'geodirectory')." '".$gd_city."'"; |
|
1576 | 1576 | } else if ($gd_region != '') { |
1577 | 1577 | if ($gd_region_actual != '') { |
1578 | 1578 | $gd_region = $gd_region_actual; |
@@ -1582,7 +1582,7 @@ discard block |
||
1582 | 1582 | $gd_region = __(geodir_ucwords($gd_region), 'geodirectory'); |
1583 | 1583 | } |
1584 | 1584 | |
1585 | - $list_title .= __(' in', 'geodirectory') . " '" . $gd_region . "'"; |
|
1585 | + $list_title .= __(' in', 'geodirectory')." '".$gd_region."'"; |
|
1586 | 1586 | } else if ($gd_country != '') { |
1587 | 1587 | if ($gd_country_actual != '') { |
1588 | 1588 | $gd_country = $gd_country_actual; |
@@ -1592,12 +1592,12 @@ discard block |
||
1592 | 1592 | $gd_country = __(geodir_ucwords($gd_country), 'geodirectory'); |
1593 | 1593 | } |
1594 | 1594 | |
1595 | - $list_title .= __(' in', 'geodirectory') . " '" . $gd_country . "'"; |
|
1595 | + $list_title .= __(' in', 'geodirectory')." '".$gd_country."'"; |
|
1596 | 1596 | } |
1597 | 1597 | } |
1598 | 1598 | |
1599 | 1599 | if (is_search()) { |
1600 | - $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'"; |
|
1600 | + $list_title = __('Search', 'geodirectory').' '.__(ucfirst($post_type_info->labels->name), 'geodirectory').__(' For :', 'geodirectory')." '".get_search_query()."'"; |
|
1601 | 1601 | } |
1602 | 1602 | /** This action is documented in geodirectory_template_actions.php */ |
1603 | 1603 | $class = apply_filters('geodir_page_title_class', 'entry-title fn'); |
@@ -1606,26 +1606,26 @@ discard block |
||
1606 | 1606 | |
1607 | 1607 | |
1608 | 1608 | $title = $list_title; |
1609 | - if(geodir_is_page('pt')){ |
|
1609 | + if (geodir_is_page('pt')) { |
|
1610 | 1610 | $gd_page = 'pt'; |
1611 | - $title = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title; |
|
1611 | + $title = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title; |
|
1612 | 1612 | } |
1613 | - elseif(geodir_is_page('listing')){ |
|
1613 | + elseif (geodir_is_page('listing')) { |
|
1614 | 1614 | $gd_page = 'listing'; |
1615 | 1615 | global $wp_query; |
1616 | 1616 | $current_term = $wp_query->get_queried_object(); |
1617 | - if (strpos($current_term->taxonomy,'_tags') !== false) { |
|
1617 | + if (strpos($current_term->taxonomy, '_tags') !== false) { |
|
1618 | 1618 | $title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title; |
1619 | - }else{ |
|
1619 | + } else { |
|
1620 | 1620 | $title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title; |
1621 | 1621 | } |
1622 | 1622 | |
1623 | 1623 | } |
1624 | - elseif(geodir_is_page('author')){ |
|
1624 | + elseif (geodir_is_page('author')) { |
|
1625 | 1625 | $gd_page = 'author'; |
1626 | - if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){ |
|
1626 | + if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') { |
|
1627 | 1627 | $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title; |
1628 | - }else{ |
|
1628 | + } else { |
|
1629 | 1629 | $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title; |
1630 | 1630 | } |
1631 | 1631 | |
@@ -1639,16 +1639,16 @@ discard block |
||
1639 | 1639 | * @param string $title The page title including variables. |
1640 | 1640 | * @param string $gd_page The GeoDirectory page type if any. |
1641 | 1641 | */ |
1642 | - $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page); |
|
1642 | + $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page); |
|
1643 | 1643 | |
1644 | - echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . |
|
1644 | + echo '<header class="'.$class_header.'"><h1 class="'.$class.'">'. |
|
1645 | 1645 | /** |
1646 | 1646 | * Filter the listing page title. |
1647 | 1647 | * |
1648 | 1648 | * @since 1.0.0 |
1649 | 1649 | * @param string $list_title The title for the category page. |
1650 | 1650 | */ |
1651 | - apply_filters('geodir_listing_page_title', $title) . '</h1></header>'; |
|
1651 | + apply_filters('geodir_listing_page_title', $title).'</h1></header>'; |
|
1652 | 1652 | } |
1653 | 1653 | |
1654 | 1654 | add_action('geodir_listings_page_description', 'geodir_action_listings_description', 10); |
@@ -1667,7 +1667,7 @@ discard block |
||
1667 | 1667 | $gd_post_type = geodir_get_current_posttype(); |
1668 | 1668 | if (isset($current_term->term_id) && $current_term->term_id != '') { |
1669 | 1669 | |
1670 | - $term_desc = term_description($current_term->term_id, $gd_post_type . '_tags'); |
|
1670 | + $term_desc = term_description($current_term->term_id, $gd_post_type.'_tags'); |
|
1671 | 1671 | $saved_data = stripslashes(get_tax_meta($current_term->term_id, 'ct_cat_top_desc', false, $gd_post_type)); |
1672 | 1672 | if ($term_desc && !$saved_data) { |
1673 | 1673 | $saved_data = $term_desc; |
@@ -1684,7 +1684,7 @@ discard block |
||
1684 | 1684 | if ($cat_description) { |
1685 | 1685 | ?> |
1686 | 1686 | |
1687 | - <div class="term_description"><?php echo $cat_description;?></div> <?php |
|
1687 | + <div class="term_description"><?php echo $cat_description; ?></div> <?php |
|
1688 | 1688 | } |
1689 | 1689 | |
1690 | 1690 | } |
@@ -1734,13 +1734,13 @@ discard block |
||
1734 | 1734 | function geodir_action_sidebar_left_open($type = '', $id = '', $class = '', $itemtype = '') |
1735 | 1735 | { |
1736 | 1736 | if ($type == 'home-page' && $width = get_option('geodir_width_home_left_section')) { |
1737 | - $width_css = 'style="width:' . $width . '%;"'; |
|
1737 | + $width_css = 'style="width:'.$width.'%;"'; |
|
1738 | 1738 | } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_left_section')) { |
1739 | - $width_css = 'style="width:' . $width . '%;"'; |
|
1739 | + $width_css = 'style="width:'.$width.'%;"'; |
|
1740 | 1740 | } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_left_section')) { |
1741 | - $width_css = 'style="width:' . $width . '%;"'; |
|
1741 | + $width_css = 'style="width:'.$width.'%;"'; |
|
1742 | 1742 | } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_left_section')) { |
1743 | - $width_css = 'style="width:' . $width . '%;"'; |
|
1743 | + $width_css = 'style="width:'.$width.'%;"'; |
|
1744 | 1744 | } else { |
1745 | 1745 | $width_css = ''; |
1746 | 1746 | } |
@@ -2045,11 +2045,11 @@ discard block |
||
2045 | 2045 | |
2046 | 2046 | $title = apply_filters('geodir_add_listing_page_title_text', get_the_title()); |
2047 | 2047 | |
2048 | - if(geodir_is_page('add-listing')){ |
|
2048 | + if (geodir_is_page('add-listing')) { |
|
2049 | 2049 | $gd_page = 'add-listing'; |
2050 | - if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){ |
|
2050 | + if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') { |
|
2051 | 2051 | $title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title; |
2052 | - }elseif(isset($listing_type)){ |
|
2052 | + }elseif (isset($listing_type)) { |
|
2053 | 2053 | $title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title; |
2054 | 2054 | } |
2055 | 2055 | |
@@ -2063,9 +2063,9 @@ discard block |
||
2063 | 2063 | * @param string $title The page title including variables. |
2064 | 2064 | * @param string $gd_page The GeoDirectory page type if any. |
2065 | 2065 | */ |
2066 | - $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page); |
|
2066 | + $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page); |
|
2067 | 2067 | |
2068 | - echo '<header class="' . $class_header . '"><h1 class="' . $class . '">'; |
|
2068 | + echo '<header class="'.$class_header.'"><h1 class="'.$class.'">'; |
|
2069 | 2069 | echo $title; |
2070 | 2070 | echo '</h1></header>'; |
2071 | 2071 | } |
@@ -2079,7 +2079,7 @@ discard block |
||
2079 | 2079 | */ |
2080 | 2080 | function geodir_action_add_listing_page_mandatory() |
2081 | 2081 | {?> |
2082 | - <p class="geodir-note "><span class="geodir-required">*</span> <?php echo INDICATES_MANDATORY_FIELDS_TEXT;?></p> |
|
2082 | + <p class="geodir-note "><span class="geodir-required">*</span> <?php echo INDICATES_MANDATORY_FIELDS_TEXT; ?></p> |
|
2083 | 2083 | <?php |
2084 | 2084 | } |
2085 | 2085 | |
@@ -2114,7 +2114,7 @@ discard block |
||
2114 | 2114 | |
2115 | 2115 | if (isset($_REQUEST['backandedit'])) { |
2116 | 2116 | global $post; |
2117 | - $post = (object)$gd_session->get('listing'); |
|
2117 | + $post = (object) $gd_session->get('listing'); |
|
2118 | 2118 | $listing_type = $post->listing_type; |
2119 | 2119 | $title = $post->post_title; |
2120 | 2120 | $desc = $post->post_desc; |
@@ -2129,7 +2129,7 @@ discard block |
||
2129 | 2129 | $thumb_img_arr = geodir_get_images($post->ID); |
2130 | 2130 | if ($thumb_img_arr) { |
2131 | 2131 | foreach ($thumb_img_arr as $post_img) { |
2132 | - $curImages .= $post_img->src . ','; |
|
2132 | + $curImages .= $post_img->src.','; |
|
2133 | 2133 | } |
2134 | 2134 | } |
2135 | 2135 | |
@@ -2137,7 +2137,7 @@ discard block |
||
2137 | 2137 | $title = $post->post_title; |
2138 | 2138 | $desc = $post->post_content; |
2139 | 2139 | $kw_tags = $post->post_tags; |
2140 | - $kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type . '_tags', array('fields' => 'names'))); |
|
2140 | + $kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type.'_tags', array('fields' => 'names'))); |
|
2141 | 2141 | } else { |
2142 | 2142 | $listing_type = sanitize_text_field($_REQUEST['listing_type']); |
2143 | 2143 | } |
@@ -2146,15 +2146,15 @@ discard block |
||
2146 | 2146 | $user_login = true; |
2147 | 2147 | } |
2148 | 2148 | ?> |
2149 | - <form name="propertyform" id="propertyform" action="<?php echo get_page_link(geodir_preview_page_id());?>" method="post" enctype="multipart/form-data"> |
|
2150 | - <input type="hidden" name="preview" value="<?php echo sanitize_text_field($listing_type);?>"/> |
|
2151 | - <input type="hidden" name="listing_type" value="<?php echo sanitize_text_field($listing_type);?>"/> |
|
2149 | + <form name="propertyform" id="propertyform" action="<?php echo get_page_link(geodir_preview_page_id()); ?>" method="post" enctype="multipart/form-data"> |
|
2150 | + <input type="hidden" name="preview" value="<?php echo sanitize_text_field($listing_type); ?>"/> |
|
2151 | + <input type="hidden" name="listing_type" value="<?php echo sanitize_text_field($listing_type); ?>"/> |
|
2152 | 2152 | <?php if ($page_id) { ?> |
2153 | - <input type="hidden" name="add_listing_page_id" value="<?php echo $page_id;?>"/> |
|
2153 | + <input type="hidden" name="add_listing_page_id" value="<?php echo $page_id; ?>"/> |
|
2154 | 2154 | <?php } if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') { ?> |
2155 | - <input type="hidden" name="pid" value="<?php echo sanitize_text_field($_REQUEST['pid']);?>"/> |
|
2155 | + <input type="hidden" name="pid" value="<?php echo sanitize_text_field($_REQUEST['pid']); ?>"/> |
|
2156 | 2156 | <?php } if (isset($_REQUEST['backandedit'])) { ?> |
2157 | - <input type="hidden" name="backandedit" value="<?php echo sanitize_text_field($_REQUEST['backandedit']);?>"/> |
|
2157 | + <input type="hidden" name="backandedit" value="<?php echo sanitize_text_field($_REQUEST['backandedit']); ?>"/> |
|
2158 | 2158 | <?php |
2159 | 2159 | } |
2160 | 2160 | /** |
@@ -2166,7 +2166,7 @@ discard block |
||
2166 | 2166 | */ |
2167 | 2167 | do_action('geodir_before_detail_fields'); |
2168 | 2168 | ?> |
2169 | - <h5 id="geodir_fieldset_details" class="geodir-fieldset-row" gd-fieldset="details"><?php echo LISTING_DETAILS_TEXT;?></h5> |
|
2169 | + <h5 id="geodir_fieldset_details" class="geodir-fieldset-row" gd-fieldset="details"><?php echo LISTING_DETAILS_TEXT; ?></h5> |
|
2170 | 2170 | <?php |
2171 | 2171 | /** |
2172 | 2172 | * Called at the top of the add listing page form for frontend. |
@@ -2178,10 +2178,10 @@ discard block |
||
2178 | 2178 | do_action('geodir_before_main_form_fields'); |
2179 | 2179 | ?> |
2180 | 2180 | <div id="geodir_post_title_row" class="required_field geodir_form_row clearfix gd-fieldset-details"> |
2181 | - <label><?php echo PLACE_TITLE_TEXT;?><span>*</span> </label> |
|
2181 | + <label><?php echo PLACE_TITLE_TEXT; ?><span>*</span> </label> |
|
2182 | 2182 | <input type="text" field_type="text" name="post_title" id="post_title" class="geodir_textfield" |
2183 | 2183 | value="<?php echo esc_attr(stripslashes($title)); ?>"/> |
2184 | - <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory');?></span> |
|
2184 | + <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span> |
|
2185 | 2185 | </div> |
2186 | 2186 | <?php |
2187 | 2187 | $show_editor = get_option('geodir_tiny_editor_on_add_listing'); |
@@ -2216,7 +2216,7 @@ discard block |
||
2216 | 2216 | $desc_limit_msg = apply_filters('geodir_description_field_desc_limit_msg', $desc_limit_msg, $desc_limit); |
2217 | 2217 | |
2218 | 2218 | $desc_class = ''; |
2219 | - if ($desc_limit === '' || (int)$desc_limit > 0) { |
|
2219 | + if ($desc_limit === '' || (int) $desc_limit > 0) { |
|
2220 | 2220 | /** |
2221 | 2221 | * Called on the add listing page form for frontend just before the description field. |
2222 | 2222 | * |
@@ -2229,8 +2229,8 @@ discard block |
||
2229 | 2229 | $desc_class = ' hidden'; |
2230 | 2230 | } |
2231 | 2231 | ?> |
2232 | - <div id="geodir_post_desc_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $desc_class;?>"> |
|
2233 | - <label><?php echo PLACE_DESC_TEXT;?><span><?php if ($desc_limit != '0') { echo '*'; } ?></span> </label> |
|
2232 | + <div id="geodir_post_desc_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $desc_class; ?>"> |
|
2233 | + <label><?php echo PLACE_DESC_TEXT; ?><span><?php if ($desc_limit != '0') { echo '*'; } ?></span> </label> |
|
2234 | 2234 | <?php |
2235 | 2235 | if (!empty($show_editor) && in_array($listing_type, $show_editor)) { |
2236 | 2236 | $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10); |
@@ -2239,16 +2239,16 @@ discard block |
||
2239 | 2239 | <?php wp_editor($desc, "post_desc", $editor_settings); ?> |
2240 | 2240 | </div> |
2241 | 2241 | <?php if ($desc_limit != '') { ?> |
2242 | - <script type="text/javascript">jQuery('textarea#post_desc').attr('maxlength', "<?php echo $desc_limit;?>");</script> |
|
2242 | + <script type="text/javascript">jQuery('textarea#post_desc').attr('maxlength', "<?php echo $desc_limit; ?>");</script> |
|
2243 | 2243 | <?php } } else { ?> |
2244 | 2244 | <textarea field_type="textarea" name="post_desc" id="post_desc" class="geodir_textarea" maxlength="<?php echo $desc_limit; ?>"><?php echo $desc; ?></textarea> |
2245 | 2245 | <?php } if ($desc_limit_msg != '') { ?> |
2246 | 2246 | <span class="geodir_message_note"><?php echo $desc_limit_msg; ?></span> |
2247 | 2247 | <?php } ?> |
2248 | - <span class="geodir_message_error"><?php echo _e($required_msg, 'geodirectory');?></span> |
|
2248 | + <span class="geodir_message_error"><?php echo _e($required_msg, 'geodirectory'); ?></span> |
|
2249 | 2249 | </div> |
2250 | 2250 | <?php |
2251 | - if ($desc_limit === '' || (int)$desc_limit > 0) { |
|
2251 | + if ($desc_limit === '' || (int) $desc_limit > 0) { |
|
2252 | 2252 | /** |
2253 | 2253 | * Called on the add listing page form for frontend just after the description field. |
2254 | 2254 | * |
@@ -2287,7 +2287,7 @@ discard block |
||
2287 | 2287 | $kw_tags_msg = apply_filters('geodir_listing_tags_field_tags_msg', $kw_tags_msg, $kw_tags_count); |
2288 | 2288 | |
2289 | 2289 | $tags_class = ''; |
2290 | - if ($kw_tags_count === '' || (int)$kw_tags_count > 0) { |
|
2290 | + if ($kw_tags_count === '' || (int) $kw_tags_count > 0) { |
|
2291 | 2291 | /** |
2292 | 2292 | * Called on the add listing page form for frontend just before the tags field. |
2293 | 2293 | * |
@@ -2298,14 +2298,14 @@ discard block |
||
2298 | 2298 | $tags_class = ' hidden'; |
2299 | 2299 | } |
2300 | 2300 | ?> |
2301 | - <div id="geodir_post_tags_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $tags_class;?>"> |
|
2301 | + <div id="geodir_post_tags_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $tags_class; ?>"> |
|
2302 | 2302 | <label><?php echo TAGKW_TEXT; ?></label> |
2303 | 2303 | <input name="post_tags" id="post_tags" value="<?php echo $kw_tags; ?>" type="text" class="geodir_textfield" |
2304 | - maxlength="<?php echo $kw_tags_count;?>"/> |
|
2305 | - <span class="geodir_message_note"><?php echo $kw_tags_msg;?></span> |
|
2304 | + maxlength="<?php echo $kw_tags_count; ?>"/> |
|
2305 | + <span class="geodir_message_note"><?php echo $kw_tags_msg; ?></span> |
|
2306 | 2306 | </div> |
2307 | 2307 | <?php |
2308 | - if ($kw_tags_count === '' || (int)$kw_tags_count > 0) { |
|
2308 | + if ($kw_tags_count === '' || (int) $kw_tags_count > 0) { |
|
2309 | 2309 | /** |
2310 | 2310 | * Called on the add listing page form for frontend just after the tags field. |
2311 | 2311 | * |
@@ -2331,7 +2331,7 @@ discard block |
||
2331 | 2331 | $thumb_img_arr = array(); |
2332 | 2332 | $totImg = 0; |
2333 | 2333 | if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) { |
2334 | - $post = (object)$gd_session->get('listing'); |
|
2334 | + $post = (object) $gd_session->get('listing'); |
|
2335 | 2335 | if (isset($post->post_images)) |
2336 | 2336 | $curImages = trim($post->post_images, ","); |
2337 | 2337 | |
@@ -2344,7 +2344,7 @@ discard block |
||
2344 | 2344 | $listing_type = $post->listing_type; |
2345 | 2345 | |
2346 | 2346 | } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') { |
2347 | - $post = geodir_get_post_info((int)$_REQUEST['pid']); |
|
2347 | + $post = geodir_get_post_info((int) $_REQUEST['pid']); |
|
2348 | 2348 | $listing_type = $post->post_type; |
2349 | 2349 | $thumb_img_arr = geodir_get_images($_REQUEST['pid']); |
2350 | 2350 | |
@@ -2358,7 +2358,7 @@ discard block |
||
2358 | 2358 | //$curImages = $img->src.","; |
2359 | 2359 | } |
2360 | 2360 | |
2361 | - $totImg = count((array)$thumb_img_arr); |
|
2361 | + $totImg = count((array) $thumb_img_arr); |
|
2362 | 2362 | } |
2363 | 2363 | |
2364 | 2364 | if ($curImages != '') |
@@ -2379,15 +2379,15 @@ discard block |
||
2379 | 2379 | if ($show_image_input_box) { |
2380 | 2380 | ?> |
2381 | 2381 | |
2382 | - <h5 id="geodir_form_title_row" class="geodir-form_title"> <?php echo PRO_PHOTO_TEXT;?> |
|
2382 | + <h5 id="geodir_form_title_row" class="geodir-form_title"> <?php echo PRO_PHOTO_TEXT; ?> |
|
2383 | 2383 | <?php if ($image_limit == 1) { |
2384 | - echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>'; |
|
2384 | + echo '<br /><small>('.__('You can upload', 'geodirectory').' '.$image_limit.' '.__('image with this package', 'geodirectory').')</small>'; |
|
2385 | 2385 | } ?> |
2386 | 2386 | <?php if ($image_limit > 1) { |
2387 | - echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>'; |
|
2387 | + echo '<br /><small>('.__('You can upload', 'geodirectory').' '.$image_limit.' '.__('images with this package', 'geodirectory').')</small>'; |
|
2388 | 2388 | } ?> |
2389 | 2389 | <?php if ($image_limit == '') { |
2390 | - echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>'; |
|
2390 | + echo '<br /><small>('.__('You can upload unlimited images with this package', 'geodirectory').')</small>'; |
|
2391 | 2391 | } ?> |
2392 | 2392 | </h5> |
2393 | 2393 | |
@@ -2402,11 +2402,11 @@ discard block |
||
2402 | 2402 | <div |
2403 | 2403 | class="plupload-upload-uic hide-if-no-js <?php if ($multiple): ?>plupload-upload-uic-multiple<?php endif; ?>" |
2404 | 2404 | id="<?php echo $id; ?>plupload-upload-ui"> |
2405 | - <h4><?php _e('Drop files to upload', 'geodirectory');?></h4><br/> |
|
2405 | + <h4><?php _e('Drop files to upload', 'geodirectory'); ?></h4><br/> |
|
2406 | 2406 | <input id="<?php echo $id; ?>plupload-browse-button" type="button" |
2407 | 2407 | value="<?php esc_attr_e('Select Files', 'geodirectory'); ?>" class="geodir_button"/> |
2408 | 2408 | <span class="ajaxnonceplu" |
2409 | - id="ajaxnonceplu<?php echo wp_create_nonce($id . 'pluploadan'); ?>"></span> |
|
2409 | + id="ajaxnonceplu<?php echo wp_create_nonce($id.'pluploadan'); ?>"></span> |
|
2410 | 2410 | <?php if ($width && $height): ?> |
2411 | 2411 | <span class="plupload-resize"></span> |
2412 | 2412 | <span class="plupload-width" id="plupload-width<?php echo $width; ?>"></span> |
@@ -2419,7 +2419,7 @@ discard block |
||
2419 | 2419 | id="<?php echo $id; ?>plupload-thumbs" style="border-top:1px solid #ccc; padding-top:10px;"> |
2420 | 2420 | </div> |
2421 | 2421 | <span |
2422 | - id="upload-msg"><?php _e('Please drag & drop the images to rearrange the order', 'geodirectory');?></span> |
|
2422 | + id="upload-msg"><?php _e('Please drag & drop the images to rearrange the order', 'geodirectory'); ?></span> |
|
2423 | 2423 | <span id="<?php echo $id; ?>upload-error" style="display:none"></span> |
2424 | 2424 | </div> |
2425 | 2425 | |
@@ -2431,7 +2431,7 @@ discard block |
||
2431 | 2431 | * |
2432 | 2432 | * @since 1.0.0 |
2433 | 2433 | */ |
2434 | - do_action('geodir_after_main_form_fields');?> |
|
2434 | + do_action('geodir_after_main_form_fields'); ?> |
|
2435 | 2435 | |
2436 | 2436 | |
2437 | 2437 | <!-- add captcha code --> |
@@ -2442,7 +2442,7 @@ discard block |
||
2442 | 2442 | </script> |
2443 | 2443 | <noscript> |
2444 | 2444 | <div> |
2445 | - <label><?php _e('Type 64 into this box', 'geodirectory');?></label> |
|
2445 | + <label><?php _e('Type 64 into this box', 'geodirectory'); ?></label> |
|
2446 | 2446 | <input type="text" id="geodir_spamblocker_top_form" name="geodir_spamblocker" value="" maxlength="10"/> |
2447 | 2447 | </div> |
2448 | 2448 | </noscript> |
@@ -2452,10 +2452,10 @@ discard block |
||
2452 | 2452 | <!-- end captcha code --> |
2453 | 2453 | |
2454 | 2454 | <div id="geodir-add-listing-submit" class="geodir_form_row clear_both" style="padding:2px;text-align:center;"> |
2455 | - <input type="submit" value="<?php echo PRO_PREVIEW_BUTTON;?>" |
|
2456 | - class="geodir_button" <?php echo $submit_button;?>/> |
|
2455 | + <input type="submit" value="<?php echo PRO_PREVIEW_BUTTON; ?>" |
|
2456 | + class="geodir_button" <?php echo $submit_button; ?>/> |
|
2457 | 2457 | <span class="geodir_message_note" |
2458 | - style="padding-left:0px;"> <?php _e('Note: You will be able to see a preview in the next page', 'geodirectory');?></span> |
|
2458 | + style="padding-left:0px;"> <?php _e('Note: You will be able to see a preview in the next page', 'geodirectory'); ?></span> |
|
2459 | 2459 | </div> |
2460 | 2460 | |
2461 | 2461 | </form> |
@@ -2517,7 +2517,7 @@ discard block |
||
2517 | 2517 | class="<?php |
2518 | 2518 | /** This action is documented in geodirectory_template_actions.php */ |
2519 | 2519 | echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>"> |
2520 | - <?php dynamic_sidebar('Reg/Login Top Section');?> |
|
2520 | + <?php dynamic_sidebar('Reg/Login Top Section'); ?> |
|
2521 | 2521 | </div><!-- clearfix ends here--> |
2522 | 2522 | <?php |
2523 | 2523 | } |
@@ -2539,7 +2539,7 @@ discard block |
||
2539 | 2539 | |
2540 | 2540 | ?> |
2541 | 2541 | <script type="text/javascript"> |
2542 | - <?php if ( $user_login ) { ?> |
|
2542 | + <?php if ($user_login) { ?> |
|
2543 | 2543 | setTimeout(function () { |
2544 | 2544 | try { |
2545 | 2545 | d = document.getElementById('user_pass'); |
@@ -2556,7 +2556,7 @@ discard block |
||
2556 | 2556 | <?php } ?> |
2557 | 2557 | </script> |
2558 | 2558 | <script type="text/javascript"> |
2559 | - <?php if ( $user_login ) { ?> |
|
2559 | + <?php if ($user_login) { ?> |
|
2560 | 2560 | setTimeout(function () { |
2561 | 2561 | try { |
2562 | 2562 | d = document.getElementById('user_pass'); |
@@ -2581,7 +2581,7 @@ discard block |
||
2581 | 2581 | foreach ($errors as $errorsObj) { |
2582 | 2582 | foreach ($errorsObj as $key => $val) { |
2583 | 2583 | for ($i = 0; $i < count($val); $i++) { |
2584 | - echo "<div class=sucess_msg>" . $val[$i] . '</div>'; |
|
2584 | + echo "<div class=sucess_msg>".$val[$i].'</div>'; |
|
2585 | 2585 | $registration_error_msg = 1; |
2586 | 2586 | } |
2587 | 2587 | } |
@@ -2598,7 +2598,7 @@ discard block |
||
2598 | 2598 | * |
2599 | 2599 | * @since 1.0.0 |
2600 | 2600 | */ |
2601 | - include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?> |
|
2601 | + include(geodir_plugin_path()."/geodirectory-templates/login_frm.php"); ?> |
|
2602 | 2602 | </div> |
2603 | 2603 | |
2604 | 2604 | <?php } elseif (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_up') { ?> |
@@ -2610,7 +2610,7 @@ discard block |
||
2610 | 2610 | * |
2611 | 2611 | * @since 1.0.0 |
2612 | 2612 | */ |
2613 | - include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?> |
|
2613 | + include(geodir_plugin_path()."/geodirectory-templates/reg_frm.php"); ?> |
|
2614 | 2614 | </div> |
2615 | 2615 | |
2616 | 2616 | <?php } else { ?> |
@@ -2622,7 +2622,7 @@ discard block |
||
2622 | 2622 | * |
2623 | 2623 | * @since 1.0.0 |
2624 | 2624 | */ |
2625 | - include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?> |
|
2625 | + include(geodir_plugin_path()."/geodirectory-templates/login_frm.php"); ?> |
|
2626 | 2626 | </div> |
2627 | 2627 | <div class="registration_form_r"> |
2628 | 2628 | <?php |
@@ -2631,7 +2631,7 @@ discard block |
||
2631 | 2631 | * |
2632 | 2632 | * @since 1.0.0 |
2633 | 2633 | */ |
2634 | - include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?> |
|
2634 | + include(geodir_plugin_path()."/geodirectory-templates/reg_frm.php"); ?> |
|
2635 | 2635 | </div> |
2636 | 2636 | |
2637 | 2637 | <?php }?> |
@@ -2667,12 +2667,12 @@ discard block |
||
2667 | 2667 | $gd_post_type = geodir_get_current_posttype(); |
2668 | 2668 | $post_type_info = get_post_type_object($gd_post_type); |
2669 | 2669 | |
2670 | - $add_string_in_title = __('All', 'geodirectory') . ' '; |
|
2670 | + $add_string_in_title = __('All', 'geodirectory').' '; |
|
2671 | 2671 | if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') { |
2672 | - $add_string_in_title = __('My Favorite', 'geodirectory') . ' '; |
|
2672 | + $add_string_in_title = __('My Favorite', 'geodirectory').' '; |
|
2673 | 2673 | } |
2674 | 2674 | |
2675 | - $list_title = $add_string_in_title . $post_type_info->labels->name; |
|
2675 | + $list_title = $add_string_in_title.$post_type_info->labels->name; |
|
2676 | 2676 | $single_name = $post_type_info->labels->singular_name; |
2677 | 2677 | |
2678 | 2678 | $taxonomy = geodir_get_taxonomies($gd_post_type); |
@@ -2680,12 +2680,12 @@ discard block |
||
2680 | 2680 | if (!empty($term)) { |
2681 | 2681 | $current_term = get_term_by('slug', $term, $taxonomy[0]); |
2682 | 2682 | if (!empty($current_term)) |
2683 | - $list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'"; |
|
2683 | + $list_title .= __(' in', 'geodirectory')." '".geodir_ucwords($current_term->name)."'"; |
|
2684 | 2684 | } |
2685 | 2685 | |
2686 | 2686 | |
2687 | 2687 | if (is_search()) { |
2688 | - $list_title = __('Search', 'geodirectory') . ' ' . __($post_type_info->labels->name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'"; |
|
2688 | + $list_title = __('Search', 'geodirectory').' '.__($post_type_info->labels->name, 'geodirectory').__(' For :', 'geodirectory')." '".get_search_query()."'"; |
|
2689 | 2689 | |
2690 | 2690 | } |
2691 | 2691 | /** This action is documented in geodirectory_template_actions.php */ |
@@ -2694,11 +2694,11 @@ discard block |
||
2694 | 2694 | $class_header = apply_filters('geodir_page_title_header_class', 'entry-header'); |
2695 | 2695 | |
2696 | 2696 | $title = $list_title; |
2697 | - if(geodir_is_page('author')){ |
|
2697 | + if (geodir_is_page('author')) { |
|
2698 | 2698 | $gd_page = 'author'; |
2699 | - if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){ |
|
2699 | + if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') { |
|
2700 | 2700 | $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title; |
2701 | - }else{ |
|
2701 | + } else { |
|
2702 | 2702 | $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title; |
2703 | 2703 | } |
2704 | 2704 | |
@@ -2712,16 +2712,16 @@ discard block |
||
2712 | 2712 | * @param string $title The page title including variables. |
2713 | 2713 | * @param string $gd_page The GeoDirectory page type if any. |
2714 | 2714 | */ |
2715 | - $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page); |
|
2715 | + $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page); |
|
2716 | 2716 | |
2717 | - echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . |
|
2717 | + echo '<header class="'.$class_header.'"><h1 class="'.$class.'">'. |
|
2718 | 2718 | /** |
2719 | 2719 | * Filter the author page title text. |
2720 | 2720 | * |
2721 | 2721 | * @since 1.0.0 |
2722 | 2722 | * @param string $list_title The title for the page. |
2723 | 2723 | */ |
2724 | - apply_filters('geodir_author_page_title_text', $title) . '</h1></header>'; |
|
2724 | + apply_filters('geodir_author_page_title_text', $title).'</h1></header>'; |
|
2725 | 2725 | } |
2726 | 2726 | |
2727 | 2727 | |
@@ -2926,19 +2926,19 @@ discard block |
||
2926 | 2926 | $post_type_info = get_post_type_object($gd_post_type); |
2927 | 2927 | |
2928 | 2928 | $pt_name = ''; |
2929 | - if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;} |
|
2929 | + if (isset($post_type_info->labels->name)) {$pt_name = $post_type_info->labels->name; } |
|
2930 | 2930 | |
2931 | 2931 | if (is_search()) { |
2932 | - $list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'"; |
|
2932 | + $list_title = __('Search', 'geodirectory').' '.__($pt_name, 'geodirectory').__(' For :', 'geodirectory')." '".get_search_query()."'"; |
|
2933 | 2933 | |
2934 | 2934 | } |
2935 | 2935 | /** This action is documented in geodirectory_template_actions.php */ |
2936 | 2936 | $class = apply_filters('geodir_page_title_class', 'entry-title fn'); |
2937 | 2937 | /** This action is documented in geodirectory_template_actions.php */ |
2938 | 2938 | $class_header = apply_filters('geodir_page_title_header_class', 'entry-header'); |
2939 | - echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . |
|
2939 | + echo '<header class="'.$class_header.'"><h1 class="'.$class.'">'. |
|
2940 | 2940 | /** This action is documented in geodirectory_template_actions.php */ |
2941 | - apply_filters('geodir_listing_page_title', wptexturize($list_title)) . '</h1></header>'; |
|
2941 | + apply_filters('geodir_listing_page_title', wptexturize($list_title)).'</h1></header>'; |
|
2942 | 2942 | } |
2943 | 2943 | |
2944 | 2944 | // action for adding the listings page top widget area |
@@ -3342,7 +3342,7 @@ discard block |
||
3342 | 3342 | $gd_post_type = geodir_get_current_posttype(); |
3343 | 3343 | $post_type_info = get_post_type_object($gd_post_type); |
3344 | 3344 | |
3345 | - $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' :', 'geodirectory'); |
|
3345 | + $list_title = __('Search', 'geodirectory').' '.__(ucfirst($post_type_info->labels->name), 'geodirectory').__(' :', 'geodirectory'); |
|
3346 | 3346 | } |
3347 | 3347 | return $list_title; |
3348 | 3348 | } |
@@ -3358,7 +3358,7 @@ discard block |
||
3358 | 3358 | * @param string $position Position to add the post content. 'before' or 'after'. Default 'before'. |
3359 | 3359 | * @param string $gd_page The geodirectory page type. Default null. |
3360 | 3360 | */ |
3361 | -function geodir_add_page_content( $position = 'before', $gd_page = '' ) { |
|
3361 | +function geodir_add_page_content($position = 'before', $gd_page = '') { |
|
3362 | 3362 | global $post; |
3363 | 3363 | |
3364 | 3364 | $gd_page_id = NULL; |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | $this->add_missed_values(); |
114 | 114 | if (isset($meta_box['use_with_theme'])) |
115 | 115 | if ($meta_box['use_with_theme'] === true) { |
116 | - $this->SelfPath = get_stylesheet_directory_uri() . '/library/cat-meta'; |
|
116 | + $this->SelfPath = get_stylesheet_directory_uri().'/library/cat-meta'; |
|
117 | 117 | } elseif ($meta_box['use_with_theme'] === false) { |
118 | 118 | $this->SelfPath = plugins_url('cat-meta-functions', plugin_basename(dirname(__FILE__))); |
119 | 119 | } else { |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | $li = "<li id='item_{$attachment_id}'>"; |
263 | 263 | $li .= "<img src='{$attachment['url']}' alt='image_{$attachment_id}' />"; |
264 | 264 | //$li .= "<a title='" . __( 'Delete this image' ) . "' class='at-delete-file' href='#' rel='{$nonce}|{$term_id}|{$id}|{$attachment_id}'>" . __( 'Delete' ) . "</a>"; |
265 | - $li .= "<a title='" . __('Remove this image', 'geodirectory') . "' class='at-delete-file' href='#' rel='{$nonce}|{$term_id}|{$id}|{$attachment_id}'><img src='" . $this->SelfPath . "/images/delete-16.png' alt='" . __('Remove', 'geodirectory') . "' /></a>"; |
|
265 | + $li .= "<a title='".__('Remove this image', 'geodirectory')."' class='at-delete-file' href='#' rel='{$nonce}|{$term_id}|{$id}|{$attachment_id}'><img src='".$this->SelfPath."/images/delete-16.png' alt='".__('Remove', 'geodirectory')."' /></a>"; |
|
266 | 266 | $li .= "<input type='hidden' name='{$id}[]' value='{$attachment_id}' />"; |
267 | 267 | $li .= "</li>"; |
268 | 268 | $html .= $li; |
@@ -335,7 +335,7 @@ discard block |
||
335 | 335 | $attachment_id = isset($_GET['attachment_id']) ? intval($_GET['attachment_id']) : 0; |
336 | 336 | $ok = false; |
337 | 337 | if (strpos($field_id, '[') === false) { |
338 | - check_admin_referer("at-delete-mupload_" . urldecode($field_id)); |
|
338 | + check_admin_referer("at-delete-mupload_".urldecode($field_id)); |
|
339 | 339 | if ($term_id > 0) |
340 | 340 | $this->delete_tax_meta($term_id, $field_id); |
341 | 341 | //$ok = wp_delete_attachment( $attachment_id ); |
@@ -423,8 +423,8 @@ discard block |
||
423 | 423 | |
424 | 424 | if ($this->has_field('date') && $this->is_edit_page()) { |
425 | 425 | // Enqueu JQuery UI, use proper version. |
426 | - wp_enqueue_style('tmc-jquery-ui-css', 'https://ajax.googleapis.com/ajax/libs/jqueryui/' . $this->get_jqueryui_ver() . '/themes/base/jquery-ui.css'); |
|
427 | - wp_enqueue_script('tmc-jquery-ui', 'https://ajax.googleapis.com/ajax/libs/jqueryui/' . $this->get_jqueryui_ver() . '/jquery-ui.min.js', array('jquery')); |
|
426 | + wp_enqueue_style('tmc-jquery-ui-css', 'https://ajax.googleapis.com/ajax/libs/jqueryui/'.$this->get_jqueryui_ver().'/themes/base/jquery-ui.css'); |
|
427 | + wp_enqueue_script('tmc-jquery-ui', 'https://ajax.googleapis.com/ajax/libs/jqueryui/'.$this->get_jqueryui_ver().'/jquery-ui.min.js', array('jquery')); |
|
428 | 428 | } |
429 | 429 | |
430 | 430 | } |
@@ -441,8 +441,8 @@ discard block |
||
441 | 441 | if ($this->has_field('time') && $this->is_edit_page()) { |
442 | 442 | |
443 | 443 | // Enqueu JQuery UI, use proper version. |
444 | - wp_enqueue_style('tmc-jquery-ui-css', 'https://ajax.googleapis.com/ajax/libs/jqueryui/' . $this->get_jqueryui_ver() . '/themes/base/jquery-ui.css', array(), false, true); |
|
445 | - wp_enqueue_script('tmc-jquery-ui', 'https://ajax.googleapis.com/ajax/libs/jqueryui/' . $this->get_jqueryui_ver() . '/jquery-ui.min.js', array('jquery'), false, true); |
|
444 | + wp_enqueue_style('tmc-jquery-ui-css', 'https://ajax.googleapis.com/ajax/libs/jqueryui/'.$this->get_jqueryui_ver().'/themes/base/jquery-ui.css', array(), false, true); |
|
445 | + wp_enqueue_script('tmc-jquery-ui', 'https://ajax.googleapis.com/ajax/libs/jqueryui/'.$this->get_jqueryui_ver().'/jquery-ui.min.js', array('jquery'), false, true); |
|
446 | 446 | wp_enqueue_script('at-timepicker', 'https://github.com/trentrichardson/jQuery-Timepicker-Addon/raw/master/jquery-ui-timepicker-addon.js', array('tmc-jquery-ui'), false, true); |
447 | 447 | |
448 | 448 | } |
@@ -462,13 +462,13 @@ discard block |
||
462 | 462 | if (!empty($this->_meta_box['pages'])) { |
463 | 463 | foreach ($this->_meta_box['pages'] as $page) { |
464 | 464 | //add fields to edit form |
465 | - add_action($page . '_edit_form_fields', array(&$this, 'show_edit_form')); |
|
465 | + add_action($page.'_edit_form_fields', array(&$this, 'show_edit_form')); |
|
466 | 466 | //add fields to add new form |
467 | - add_action($page . '_add_form_fields', array(&$this, 'show_new_form')); |
|
467 | + add_action($page.'_add_form_fields', array(&$this, 'show_new_form')); |
|
468 | 468 | // this saves the edit fields |
469 | - add_action('edited_' . $page, array(&$this, 'save'), 10, 2); |
|
469 | + add_action('edited_'.$page, array(&$this, 'save'), 10, 2); |
|
470 | 470 | // this saves the add fields |
471 | - add_action('created_' . $page, array(&$this, 'save'), 10, 2); |
|
471 | + add_action('created_'.$page, array(&$this, 'save'), 10, 2); |
|
472 | 472 | } |
473 | 473 | } |
474 | 474 | |
@@ -517,13 +517,13 @@ discard block |
||
517 | 517 | $meta = is_array($meta) ? array_map('esc_attr', $meta) : esc_attr($meta); |
518 | 518 | |
519 | 519 | if ($field['validate_func']) { |
520 | - echo '<tr class="form-field form-required ' . $field['style'] . '">'; |
|
520 | + echo '<tr class="form-field form-required '.$field['style'].'">'; |
|
521 | 521 | } else { |
522 | - echo '<tr class="form-field ' . $field['style'] . '">'; |
|
522 | + echo '<tr class="form-field '.$field['style'].'">'; |
|
523 | 523 | } |
524 | 524 | |
525 | 525 | // Call Separated methods for displaying each type of field. |
526 | - call_user_func(array(&$this, 'show_field_' . $field['type']), $field, $meta); |
|
526 | + call_user_func(array(&$this, 'show_field_'.$field['type']), $field, $meta); |
|
527 | 527 | echo '</tr>'; |
528 | 528 | } |
529 | 529 | echo '</table>'; |
@@ -550,14 +550,14 @@ discard block |
||
550 | 550 | foreach ($meta as $me) { |
551 | 551 | //for labling toggles |
552 | 552 | $mmm = $me[$field['fields'][0]['id']]; |
553 | - echo '<div class="at-repater-block">' . $mmm . '<br/><table class="repeater-table" style="display: none;">'; |
|
553 | + echo '<div class="at-repater-block">'.$mmm.'<br/><table class="repeater-table" style="display: none;">'; |
|
554 | 554 | if ($field['inline']) { |
555 | 555 | echo '<tr class="at-inline" VALIGN="top">'; |
556 | 556 | } |
557 | 557 | foreach ($field['fields'] as $f) { |
558 | 558 | //reset var $id for repeater |
559 | 559 | $id = ''; |
560 | - $id = $field['id'] . '[' . $c . '][' . $f['id'] . ']'; |
|
560 | + $id = $field['id'].'['.$c.']['.$f['id'].']'; |
|
561 | 561 | $m = $me[$f['id']]; |
562 | 562 | $m = ($m !== '') ? $m : $f['std']; |
563 | 563 | if ('image' != $f['type'] && $f['type'] != 'repeater') |
@@ -567,7 +567,7 @@ discard block |
||
567 | 567 | if (!$field['inline']) { |
568 | 568 | echo '<tr>'; |
569 | 569 | } |
570 | - call_user_func(array(&$this, 'show_field_' . $f['type']), $f, $m); |
|
570 | + call_user_func(array(&$this, 'show_field_'.$f['type']), $f, $m); |
|
571 | 571 | if (!$field['inline']) { |
572 | 572 | echo '</tr>'; |
573 | 573 | } |
@@ -578,18 +578,18 @@ discard block |
||
578 | 578 | echo '</table> |
579 | 579 | <span class="at-re-toggle"><img src="'; |
580 | 580 | if ($this->_Local_images) { |
581 | - echo $plugin_path . '/images/edit.png'; |
|
581 | + echo $plugin_path.'/images/edit.png'; |
|
582 | 582 | } else { |
583 | 583 | echo 'http://i.imgur.com/ka0E2.png'; |
584 | 584 | } |
585 | 585 | echo '" alt="Edit" title="Edit"/></span> |
586 | 586 | <img src="'; |
587 | 587 | if ($this->_Local_images) { |
588 | - echo $plugin_path . '/images/remove.png'; |
|
588 | + echo $plugin_path.'/images/remove.png'; |
|
589 | 589 | } else { |
590 | 590 | echo 'http://i.imgur.com/g8Duj.png'; |
591 | 591 | } |
592 | - echo '" alt="' . __('Remove', 'geodirectory') . '" title="' . __('Remove', 'geodirectory') . '" id="remove-' . $field['id'] . '"></div>'; |
|
592 | + echo '" alt="'.__('Remove', 'geodirectory').'" title="'.__('Remove', 'geodirectory').'" id="remove-'.$field['id'].'"></div>'; |
|
593 | 593 | $c = $c + 1; |
594 | 594 | |
595 | 595 | } |
@@ -598,11 +598,11 @@ discard block |
||
598 | 598 | |
599 | 599 | echo '<img src="'; |
600 | 600 | if ($this->_Local_images) { |
601 | - echo $plugin_path . '/images/add.png'; |
|
601 | + echo $plugin_path.'/images/add.png'; |
|
602 | 602 | } else { |
603 | 603 | echo 'http://i.imgur.com/w5Tuc.png'; |
604 | 604 | } |
605 | - echo '" alt="' . __('Add', 'geodirectory') . '" title="' . __('Add', 'geodirectory') . '" id="add-' . $field['id'] . '"><br/></div>'; |
|
605 | + echo '" alt="'.__('Add', 'geodirectory').'" title="'.__('Add', 'geodirectory').'" id="add-'.$field['id'].'"><br/></div>'; |
|
606 | 606 | |
607 | 607 | //create all fields once more for js function and catch with object buffer |
608 | 608 | ob_start(); |
@@ -613,12 +613,12 @@ discard block |
||
613 | 613 | foreach ($field['fields'] as $f) { |
614 | 614 | //reset var $id for repeater |
615 | 615 | $id = ''; |
616 | - $id = $field['id'] . '[CurrentCounter][' . $f['id'] . ']'; |
|
616 | + $id = $field['id'].'[CurrentCounter]['.$f['id'].']'; |
|
617 | 617 | $f['id'] = $id; |
618 | 618 | if (!$field['inline']) { |
619 | 619 | echo '<tr>'; |
620 | 620 | } |
621 | - call_user_func(array(&$this, 'show_field_' . $f['type']), $f, ''); |
|
621 | + call_user_func(array(&$this, 'show_field_'.$f['type']), $f, ''); |
|
622 | 622 | if (!$field['inline']) { |
623 | 623 | echo '</tr>'; |
624 | 624 | } |
@@ -628,24 +628,24 @@ discard block |
||
628 | 628 | } |
629 | 629 | echo '</table><img src="'; |
630 | 630 | if ($this->_Local_images) { |
631 | - echo $plugin_path . '/images/remove.png'; |
|
631 | + echo $plugin_path.'/images/remove.png'; |
|
632 | 632 | } else { |
633 | 633 | echo 'http://i.imgur.com/g8Duj.png'; |
634 | 634 | } |
635 | - echo '" alt="' . __('Remove', 'geodirectory') . '" title="' . __('Remove', 'geodirectory') . '" id="remove-' . $field['id'] . '"></div>'; |
|
636 | - $counter = 'countadd_' . $field['id']; |
|
635 | + echo '" alt="'.__('Remove', 'geodirectory').'" title="'.__('Remove', 'geodirectory').'" id="remove-'.$field['id'].'"></div>'; |
|
636 | + $counter = 'countadd_'.$field['id']; |
|
637 | 637 | $js_code = ob_get_clean(); |
638 | 638 | $js_code = str_replace("'", "\"", $js_code); |
639 | - $js_code = str_replace("CurrentCounter", "' + " . $counter . " + '", $js_code); |
|
639 | + $js_code = str_replace("CurrentCounter", "' + ".$counter." + '", $js_code); |
|
640 | 640 | echo '<script> |
641 | 641 | jQuery(document).ready(function() { |
642 | - var ' . $counter . ' = ' . $c . '; |
|
643 | - jQuery("#add-' . $field['id'] . '").live(\'click\', function() { |
|
644 | - ' . $counter . ' = ' . $counter . ' + 1; |
|
645 | - jQuery(this).before(\'' . $js_code . '\'); |
|
642 | + var ' . $counter.' = '.$c.'; |
|
643 | + jQuery("#add-' . $field['id'].'").live(\'click\', function() { |
|
644 | + ' . $counter.' = '.$counter.' + 1; |
|
645 | + jQuery(this).before(\'' . $js_code.'\'); |
|
646 | 646 | update_repeater_fields(); |
647 | 647 | }); |
648 | - jQuery("#remove-' . $field['id'] . '").live(\'click\', function() { |
|
648 | + jQuery("#remove-' . $field['id'].'").live(\'click\', function() { |
|
649 | 649 | jQuery(this).parent().remove(); |
650 | 650 | }); |
651 | 651 | }); |
@@ -772,7 +772,7 @@ discard block |
||
772 | 772 | public function show_field_paragraph($field) |
773 | 773 | { |
774 | 774 | //$this->show_field_begin( $field, $meta ); |
775 | - echo '<p>' . $field['value'] . '</p>'; |
|
775 | + echo '<p>'.$field['value'].'</p>'; |
|
776 | 776 | //$this->show_field_end( $field, $meta ); |
777 | 777 | } |
778 | 778 | |
@@ -803,12 +803,12 @@ discard block |
||
803 | 803 | { |
804 | 804 | |
805 | 805 | if (!is_array($meta)) |
806 | - $meta = (array)$meta; |
|
806 | + $meta = (array) $meta; |
|
807 | 807 | |
808 | 808 | $this->show_field_begin($field, $meta); |
809 | - echo "<select class='at-select' name='{$field['id']}" . ($field['multiple'] ? "[]' id='{$field['id']}' multiple='multiple'" : "'") . ">"; |
|
809 | + echo "<select class='at-select' name='{$field['id']}".($field['multiple'] ? "[]' id='{$field['id']}' multiple='multiple'" : "'").">"; |
|
810 | 810 | foreach ($field['options'] as $key => $value) { |
811 | - echo "<option value='{$key}'" . selected(in_array($key, $meta), true, false) . ">{$value}</option>"; |
|
811 | + echo "<option value='{$key}'".selected(in_array($key, $meta), true, false).">{$value}</option>"; |
|
812 | 812 | } |
813 | 813 | echo "</select>"; |
814 | 814 | $this->show_field_end($field, $meta); |
@@ -827,11 +827,11 @@ discard block |
||
827 | 827 | { |
828 | 828 | |
829 | 829 | if (!is_array($meta)) |
830 | - $meta = (array)$meta; |
|
830 | + $meta = (array) $meta; |
|
831 | 831 | |
832 | 832 | $this->show_field_begin($field, $meta); |
833 | 833 | foreach ($field['options'] as $key => $value) { |
834 | - echo "<input type='radio' class='at-radio' name='{$field['id']}' value='{$key}'" . checked(in_array($key, $meta), true, false) . " /> <span class='at-radio-label'>{$value}</span>"; |
|
834 | + echo "<input type='radio' class='at-radio' name='{$field['id']}' value='{$key}'".checked(in_array($key, $meta), true, false)." /> <span class='at-radio-label'>{$value}</span>"; |
|
835 | 835 | } |
836 | 836 | $this->show_field_end($field, $meta); |
837 | 837 | } |
@@ -848,7 +848,7 @@ discard block |
||
848 | 848 | { |
849 | 849 | |
850 | 850 | $this->show_field_begin($field, $meta); |
851 | - echo "<input type='checkbox' class='rw-checkbox' name='{$field['id']}' id='{$field['id']}'" . checked(!empty($meta), true, false) . " /> {$field['desc']}"; |
|
851 | + echo "<input type='checkbox' class='rw-checkbox' name='{$field['id']}' id='{$field['id']}'".checked(!empty($meta), true, false)." /> {$field['desc']}"; |
|
852 | 852 | $this->show_field_end($field, $meta); |
853 | 853 | } |
854 | 854 | |
@@ -890,18 +890,18 @@ discard block |
||
890 | 890 | global $post; |
891 | 891 | |
892 | 892 | if (!is_array($meta)) |
893 | - $meta = (array)$meta; |
|
893 | + $meta = (array) $meta; |
|
894 | 894 | |
895 | 895 | $this->show_field_begin($field, $meta); |
896 | 896 | echo "{$field['desc']}<br />"; |
897 | 897 | |
898 | 898 | if (!empty($meta)) { |
899 | 899 | $nonce = wp_create_nonce('at_ajax_delete'); |
900 | - echo '<div style="margin-bottom: 10px"><strong>' . __('Uploaded files', 'geodirectory') . '</strong></div>'; |
|
900 | + echo '<div style="margin-bottom: 10px"><strong>'.__('Uploaded files', 'geodirectory').'</strong></div>'; |
|
901 | 901 | echo '<ol class="at-upload">'; |
902 | 902 | foreach ($meta as $att) { |
903 | 903 | // if (wp_attachment_is_image($att)) continue; // what's image uploader for? |
904 | - echo "<li>" . wp_get_attachment_link($att, '', false, false, ' ') . " (<a class='at-delete-file' href='#' rel='{$nonce}|{$post->ID}|{$field['id']}|{$att}'>" . __('Remove', 'geodirectory') . "</a>)</li>"; |
|
904 | + echo "<li>".wp_get_attachment_link($att, '', false, false, ' ')." (<a class='at-delete-file' href='#' rel='{$nonce}|{$post->ID}|{$field['id']}|{$att}'>".__('Remove', 'geodirectory')."</a>)</li>"; |
|
905 | 905 | } |
906 | 906 | echo '</ol>'; |
907 | 907 | } |
@@ -909,13 +909,13 @@ discard block |
||
909 | 909 | // show form upload |
910 | 910 | |
911 | 911 | echo "<div class='at-file-upload-label'>"; |
912 | - echo "<strong>" . __('Upload new files', 'geodirectory') . "</strong>"; |
|
912 | + echo "<strong>".__('Upload new files', 'geodirectory')."</strong>"; |
|
913 | 913 | echo "</div>"; |
914 | 914 | echo "<div class='new-files'>"; |
915 | 915 | echo "<div class='file-input'>"; |
916 | 916 | echo "<input type='file' name='{$field['id']}[]' />"; |
917 | 917 | echo "</div><!-- End .file-input -->"; |
918 | - echo "<a class='at-add-file button' href='#'>" . __('Add more files', 'geodirectory') . "</a>"; |
|
918 | + echo "<a class='at-add-file button' href='#'>".__('Add more files', 'geodirectory')."</a>"; |
|
919 | 919 | echo "</div><!-- End .new-files -->"; |
920 | 920 | echo "</td>"; |
921 | 921 | $this->show_field_end($field, $meta); |
@@ -932,7 +932,7 @@ discard block |
||
932 | 932 | public function show_field_image($field, $meta) |
933 | 933 | { |
934 | 934 | $this->show_field_begin($field, $meta); |
935 | - $html = wp_nonce_field("at-delete-mupload_{$field['id']}", "nonce-delete-mupload_" . $field['id'], false, false); |
|
935 | + $html = wp_nonce_field("at-delete-mupload_{$field['id']}", "nonce-delete-mupload_".$field['id'], false, false); |
|
936 | 936 | if (is_array($meta)) { |
937 | 937 | if (isset($meta[0]) && is_array($meta[0])) |
938 | 938 | $meta = $meta[0]; |
@@ -958,20 +958,20 @@ discard block |
||
958 | 958 | |
959 | 959 | $sub_dir = str_replace($uploads_baseurl, '', $sub_dir); |
960 | 960 | |
961 | - $uploads_url = $uploads_baseurl . $sub_dir; |
|
961 | + $uploads_url = $uploads_baseurl.$sub_dir; |
|
962 | 962 | |
963 | - $meta['src'] = $uploads_url . '/' . $file_name; |
|
963 | + $meta['src'] = $uploads_url.'/'.$file_name; |
|
964 | 964 | |
965 | 965 | |
966 | - $html .= "<span class='mupload_img_holder'><img src='" . $meta['src'] . "' style='max-height: 150px;max-width: 150px;' /></span>"; |
|
967 | - $html .= "<input type='hidden' name='" . $field['id'] . "[id]' id='" . $field['id'] . "[id]' value='" . $meta['id'] . "' />"; |
|
968 | - $html .= "<input type='hidden' class='" . $field['id'] . "[src]' name='" . $field['id'] . "[src]' id='" . $field['id'] . "[src]' value='" . $meta['src'] . "' />"; |
|
969 | - $html .= "<input class='at-delete_image_button' type='button' rel='" . $field['id'] . "' value='" . __('Remove Image', 'geodirectory') . "' />"; |
|
966 | + $html .= "<span class='mupload_img_holder'><img src='".$meta['src']."' style='max-height: 150px;max-width: 150px;' /></span>"; |
|
967 | + $html .= "<input type='hidden' name='".$field['id']."[id]' id='".$field['id']."[id]' value='".$meta['id']."' />"; |
|
968 | + $html .= "<input type='hidden' class='".$field['id']."[src]' name='".$field['id']."[src]' id='".$field['id']."[src]' value='".$meta['src']."' />"; |
|
969 | + $html .= "<input class='at-delete_image_button' type='button' rel='".$field['id']."' value='".__('Remove Image', 'geodirectory')."' />"; |
|
970 | 970 | } else { |
971 | 971 | $html .= "<span class='mupload_img_holder'></span>"; |
972 | - $html .= "<input type='hidden' name='" . $field['id'] . "[id]' id='" . $field['id'] . "[id]' value='' />"; |
|
973 | - $html .= "<input class='" . $field['id'] . "[src]' style='position:absolute;left:-500px;width:50px;' type='text' name='" . $field['id'] . "[src]' id='" . $field['id'] . "[src]' value='' />"; |
|
974 | - $html .= "<input class='at-upload_image_button' type='button' rel='" . $field['id'] . "' value='" . __('Upload Image', 'geodirectory') . "' />"; |
|
972 | + $html .= "<input type='hidden' name='".$field['id']."[id]' id='".$field['id']."[id]' value='' />"; |
|
973 | + $html .= "<input class='".$field['id']."[src]' style='position:absolute;left:-500px;width:50px;' type='text' name='".$field['id']."[src]' id='".$field['id']."[src]' value='' />"; |
|
974 | + $html .= "<input class='at-upload_image_button' type='button' rel='".$field['id']."' value='".__('Upload Image', 'geodirectory')."' />"; |
|
975 | 975 | } |
976 | 976 | echo $html; |
977 | 977 | $this->show_field_end($field, $meta); |
@@ -995,7 +995,7 @@ discard block |
||
995 | 995 | |
996 | 996 | echo "<input class='at-color' type='text' name='{$field['id']}' id='{$field['id']}' value='{$meta}' size='8' />"; |
997 | 997 | // echo "<a href='#' class='at-color-select button' rel='{$field['id']}'>" . __( 'Select a color' ) . "</a>"; |
998 | - echo "<input type='button' class='at-color-select button' rel='{$field['id']}' value='" . __('Select a color', 'geodirectory') . "'/>"; |
|
998 | + echo "<input type='button' class='at-color-select button' rel='{$field['id']}' value='".__('Select a color', 'geodirectory')."'/>"; |
|
999 | 999 | echo "<div style='display:none' class='at-color-picker' rel='{$field['id']}'></div>"; |
1000 | 1000 | $this->show_field_end($field, $meta); |
1001 | 1001 | |
@@ -1013,14 +1013,14 @@ discard block |
||
1013 | 1013 | { |
1014 | 1014 | |
1015 | 1015 | if (!is_array($meta)) |
1016 | - $meta = (array)$meta; |
|
1016 | + $meta = (array) $meta; |
|
1017 | 1017 | |
1018 | 1018 | $this->show_field_begin($field, $meta); |
1019 | 1019 | |
1020 | 1020 | $html = array(); |
1021 | 1021 | |
1022 | 1022 | foreach ($field['options'] as $key => $value) { |
1023 | - $html[] = "<input type='checkbox' class='at-checkbox_list' name='{$field['id']}[]' value='{$key}'" . checked(in_array($key, $meta), true, false) . " /> {$value}"; |
|
1023 | + $html[] = "<input type='checkbox' class='at-checkbox_list' name='{$field['id']}[]' value='{$key}'".checked(in_array($key, $meta), true, false)." /> {$value}"; |
|
1024 | 1024 | } |
1025 | 1025 | |
1026 | 1026 | echo implode('<br />', $html); |
@@ -1073,7 +1073,7 @@ discard block |
||
1073 | 1073 | { |
1074 | 1074 | global $post; |
1075 | 1075 | |
1076 | - if (!is_array($meta)) $meta = (array)$meta; |
|
1076 | + if (!is_array($meta)) $meta = (array) $meta; |
|
1077 | 1077 | $this->show_field_begin($field, $meta); |
1078 | 1078 | $options = $field['options']; |
1079 | 1079 | $posts = get_posts($options['args']); |
@@ -1081,13 +1081,13 @@ discard block |
||
1081 | 1081 | // checkbox_list |
1082 | 1082 | if ('checkbox_list' == $options['type']) { |
1083 | 1083 | foreach ($posts as $p) { |
1084 | - echo "<input type='checkbox' name='{$field['id']}[]' value='$p->ID'" . checked(in_array($p->ID, $meta), true, false) . " /> $p->post_title<br/>"; |
|
1084 | + echo "<input type='checkbox' name='{$field['id']}[]' value='$p->ID'".checked(in_array($p->ID, $meta), true, false)." /> $p->post_title<br/>"; |
|
1085 | 1085 | } |
1086 | 1086 | } // select |
1087 | 1087 | else { |
1088 | - echo "<select name='{$field['id']}" . ($field['multiple'] ? "[]' multiple='multiple' style='height:auto'" : "'") . ">"; |
|
1088 | + echo "<select name='{$field['id']}".($field['multiple'] ? "[]' multiple='multiple' style='height:auto'" : "'").">"; |
|
1089 | 1089 | foreach ($posts as $p) { |
1090 | - echo "<option value='$p->ID'" . selected(in_array($p->ID, $meta), true, false) . ">$p->post_title</option>"; |
|
1090 | + echo "<option value='$p->ID'".selected(in_array($p->ID, $meta), true, false).">$p->post_title</option>"; |
|
1091 | 1091 | } |
1092 | 1092 | echo "</select>"; |
1093 | 1093 | } |
@@ -1111,7 +1111,7 @@ discard block |
||
1111 | 1111 | { |
1112 | 1112 | global $post; |
1113 | 1113 | |
1114 | - if (!is_array($meta)) $meta = (array)$meta; |
|
1114 | + if (!is_array($meta)) $meta = (array) $meta; |
|
1115 | 1115 | $this->show_field_begin($field, $meta); |
1116 | 1116 | $options = $field['options']; |
1117 | 1117 | $terms = get_terms($options['taxonomy'], $options['args']); |
@@ -1119,13 +1119,13 @@ discard block |
||
1119 | 1119 | // checkbox_list |
1120 | 1120 | if ('checkbox_list' == $options['type']) { |
1121 | 1121 | foreach ($terms as $term) { |
1122 | - echo "<input type='checkbox' name='{$field['id']}[]' value='$term->slug'" . checked(in_array($term->slug, $meta), true, false) . " /> $term->name<br/>"; |
|
1122 | + echo "<input type='checkbox' name='{$field['id']}[]' value='$term->slug'".checked(in_array($term->slug, $meta), true, false)." /> $term->name<br/>"; |
|
1123 | 1123 | } |
1124 | 1124 | } // select |
1125 | 1125 | else { |
1126 | - echo "<select name='{$field['id']}" . ($field['multiple'] ? "[]' multiple='multiple' style='height:auto'" : "'") . ">"; |
|
1126 | + echo "<select name='{$field['id']}".($field['multiple'] ? "[]' multiple='multiple' style='height:auto'" : "'").">"; |
|
1127 | 1127 | foreach ($terms as $term) { |
1128 | - echo "<option value='$term->slug'" . selected(in_array($term->slug, $meta), true, false) . ">$term->name</option>"; |
|
1128 | + echo "<option value='$term->slug'".selected(in_array($term->slug, $meta), true, false).">$term->name</option>"; |
|
1129 | 1129 | } |
1130 | 1130 | echo "</select>"; |
1131 | 1131 | } |
@@ -1181,7 +1181,7 @@ discard block |
||
1181 | 1181 | |
1182 | 1182 | //$old_filename = $upload_dir['path'].'/'.$old_filename; |
1183 | 1183 | |
1184 | - $new_filename = $upload_dir['path'] . '/' . 'cat_icon_' . $term_id . '.png'; |
|
1184 | + $new_filename = $upload_dir['path'].'/'.'cat_icon_'.$term_id.'.png'; |
|
1185 | 1185 | |
1186 | 1186 | /*rename($old_filename, $new_filename); |
1187 | 1187 | |
@@ -1223,9 +1223,9 @@ discard block |
||
1223 | 1223 | if ($type != "paragraph") { |
1224 | 1224 | |
1225 | 1225 | // Call defined method to save meta value, if there's no methods, call common one. |
1226 | - $save_func = 'save_field_' . $type; |
|
1226 | + $save_func = 'save_field_'.$type; |
|
1227 | 1227 | if (method_exists($this, $save_func)) { |
1228 | - call_user_func(array(&$this, 'save_field_' . $type), $term_id, $field, $old, $new); |
|
1228 | + call_user_func(array(&$this, 'save_field_'.$type), $term_id, $field, $old, $new); |
|
1229 | 1229 | } else { |
1230 | 1230 | $this->save_field($term_id, $field, $old, $new); |
1231 | 1231 | } |
@@ -1370,7 +1370,7 @@ discard block |
||
1370 | 1370 | if (!is_wp_error($id)) { |
1371 | 1371 | |
1372 | 1372 | wp_update_attachment_metadata($id, wp_generate_attachment_metadata($id, $filename)); |
1373 | - add_post_meta($term_id, $name, $id, false); // save file's url in meta fields |
|
1373 | + add_post_meta($term_id, $name, $id, false); // save file's url in meta fields |
|
1374 | 1374 | |
1375 | 1375 | } // End if |
1376 | 1376 | |
@@ -1415,7 +1415,7 @@ discard block |
||
1415 | 1415 | if (!is_wp_error($id)) { |
1416 | 1416 | |
1417 | 1417 | wp_update_attachment_metadata($id, wp_generate_attachment_metadata($id, $filename)); |
1418 | - return $id; // return file's url in meta fields |
|
1418 | + return $id; // return file's url in meta fields |
|
1419 | 1419 | } // End if |
1420 | 1420 | } // End foreach |
1421 | 1421 | } |
@@ -1430,9 +1430,9 @@ discard block |
||
1430 | 1430 | { |
1431 | 1431 | |
1432 | 1432 | // Default values for meta box |
1433 | - $this->_meta_box = array_merge(array('context' => 'normal', 'priority' => 'high', 'pages' => array('post')), (array)$this->_meta_box); |
|
1433 | + $this->_meta_box = array_merge(array('context' => 'normal', 'priority' => 'high', 'pages' => array('post')), (array) $this->_meta_box); |
|
1434 | 1434 | |
1435 | - if(is_array($this->_fields)) { |
|
1435 | + if (is_array($this->_fields)) { |
|
1436 | 1436 | // Default values for fields |
1437 | 1437 | foreach ($this->_fields as &$field) { |
1438 | 1438 | $multiple = in_array($field['type'], array('checkbox_list', 'file', 'image')); |
@@ -1452,7 +1452,7 @@ discard block |
||
1452 | 1452 | */ |
1453 | 1453 | public function has_field($type) |
1454 | 1454 | { |
1455 | - if(is_array($this->_fields)) { |
|
1455 | + if (is_array($this->_fields)) { |
|
1456 | 1456 | foreach ($this->_fields as $field) { |
1457 | 1457 | if ($type == $field['type']) |
1458 | 1458 | return true; |
@@ -2020,12 +2020,12 @@ discard block |
||
2020 | 2020 | $post_type = $taxObject->object_type[0]; |
2021 | 2021 | } |
2022 | 2022 | |
2023 | - if($post_type=='post'){$post_type='';} |
|
2024 | - if($post_type){$post_type = $post_type.'_';} |
|
2023 | + if ($post_type == 'post') {$post_type = ''; } |
|
2024 | + if ($post_type) {$post_type = $post_type.'_'; } |
|
2025 | 2025 | |
2026 | 2026 | $t_id = (is_object($term_id)) ? $term_id->term_id : $term_id; |
2027 | 2027 | |
2028 | - $m = get_option('tax_meta_' . $post_type . $t_id); |
|
2028 | + $m = get_option('tax_meta_'.$post_type.$t_id); |
|
2029 | 2029 | if (isset($m[$key])) { |
2030 | 2030 | return $m[$key]; |
2031 | 2031 | } else { |
@@ -2042,15 +2042,15 @@ discard block |
||
2042 | 2042 | $post_type = $taxObject->object_type[0]; |
2043 | 2043 | } |
2044 | 2044 | |
2045 | - if($post_type=='post'){$post_type='';} |
|
2046 | - if($post_type){$post_type = $post_type.'_';} |
|
2045 | + if ($post_type == 'post') {$post_type = ''; } |
|
2046 | + if ($post_type) {$post_type = $post_type.'_'; } |
|
2047 | 2047 | |
2048 | - $m = get_option('tax_meta_' . $post_type . $term_id); |
|
2048 | + $m = get_option('tax_meta_'.$post_type.$term_id); |
|
2049 | 2049 | |
2050 | 2050 | if (isset($m[$key])) { |
2051 | 2051 | unset($m[$key]); |
2052 | 2052 | } |
2053 | - update_option('tax_meta_' . $post_type . $term_id, $m); |
|
2053 | + update_option('tax_meta_'.$post_type.$term_id, $m); |
|
2054 | 2054 | } |
2055 | 2055 | |
2056 | 2056 | //update meta |
@@ -2062,13 +2062,13 @@ discard block |
||
2062 | 2062 | $post_type = $taxObject->object_type[0]; |
2063 | 2063 | } |
2064 | 2064 | |
2065 | - if($post_type=='post'){$post_type='';} |
|
2066 | - if($post_type){$post_type = $post_type.'_';} |
|
2065 | + if ($post_type == 'post') {$post_type = ''; } |
|
2066 | + if ($post_type) {$post_type = $post_type.'_'; } |
|
2067 | 2067 | |
2068 | - $m = get_option('tax_meta_' . $post_type . $term_id); |
|
2068 | + $m = get_option('tax_meta_'.$post_type.$term_id); |
|
2069 | 2069 | |
2070 | 2070 | $m[$key] = $value; |
2071 | - update_option('tax_meta_' . $post_type . $term_id, $m); |
|
2071 | + update_option('tax_meta_'.$post_type.$term_id, $m); |
|
2072 | 2072 | |
2073 | 2073 | /** |
2074 | 2074 | * Called after the tax meta is updated. |
@@ -2103,12 +2103,12 @@ discard block |
||
2103 | 2103 | $post_type = $taxObject->object_type[0]; |
2104 | 2104 | } |
2105 | 2105 | |
2106 | - if($post_type=='post'){$post_type='';} |
|
2107 | - if($post_type){$post_type = $post_type.'_';} |
|
2106 | + if ($post_type == 'post') {$post_type = ''; } |
|
2107 | + if ($post_type) {$post_type = $post_type.'_'; } |
|
2108 | 2108 | |
2109 | 2109 | $t_id = (is_object($term_id)) ? $term_id->term_id : $term_id; |
2110 | 2110 | |
2111 | - $m = get_option('tax_meta_' . $post_type . $t_id); |
|
2111 | + $m = get_option('tax_meta_'.$post_type.$t_id); |
|
2112 | 2112 | if (isset($m[$key])) { |
2113 | 2113 | return $m[$key]; |
2114 | 2114 | } else { |
@@ -2125,15 +2125,15 @@ discard block |
||
2125 | 2125 | $taxObject = get_taxonomy($_REQUEST['taxonomy']); |
2126 | 2126 | $post_type = $taxObject->object_type[0]; |
2127 | 2127 | |
2128 | - if($post_type=='post'){$post_type='';} |
|
2129 | - if($post_type){$post_type = $post_type.'_';} |
|
2128 | + if ($post_type == 'post') {$post_type = ''; } |
|
2129 | + if ($post_type) {$post_type = $post_type.'_'; } |
|
2130 | 2130 | |
2131 | - $m = get_option('tax_meta_' . $post_type . $term_id); |
|
2131 | + $m = get_option('tax_meta_'.$post_type.$term_id); |
|
2132 | 2132 | |
2133 | 2133 | if (isset($m[$key])) { |
2134 | 2134 | unset($m[$key]); |
2135 | 2135 | } |
2136 | - update_option('tax_meta_' . $post_type . $term_id, $m); |
|
2136 | + update_option('tax_meta_'.$post_type.$term_id, $m); |
|
2137 | 2137 | } |
2138 | 2138 | } |
2139 | 2139 | |
@@ -2147,13 +2147,13 @@ discard block |
||
2147 | 2147 | $post_type = $taxObject->object_type[0]; |
2148 | 2148 | } |
2149 | 2149 | |
2150 | - if($post_type=='post'){$post_type='';} |
|
2151 | - if($post_type){$post_type = $post_type.'_';} |
|
2150 | + if ($post_type == 'post') {$post_type = ''; } |
|
2151 | + if ($post_type) {$post_type = $post_type.'_'; } |
|
2152 | 2152 | |
2153 | - $m = get_option('tax_meta_' . $post_type . $term_id); |
|
2153 | + $m = get_option('tax_meta_'.$post_type.$term_id); |
|
2154 | 2154 | |
2155 | 2155 | $m[$key] = $value; |
2156 | - update_option('tax_meta_' . $post_type . $term_id, $m); |
|
2156 | + update_option('tax_meta_'.$post_type.$term_id, $m); |
|
2157 | 2157 | |
2158 | 2158 | /** This action is documented in geodirectory-functions/cat-meta-functions/Tax-meta-class.php */ |
2159 | 2159 | do_action('gd_tax_meta_updated', false, true, $term_id, $post_type); |
@@ -26,11 +26,11 @@ discard block |
||
26 | 26 | |
27 | 27 | if (!isset($default_cat) || empty($default_cat)) { |
28 | 28 | $default_cat = isset($post_cat_array[0]) ? $post_cat_array[0] : ''; |
29 | - }else{ |
|
30 | - if(!is_int($default_cat)){ |
|
29 | + } else { |
|
30 | + if (!is_int($default_cat)) { |
|
31 | 31 | $category = get_term_by('name', $default_cat, $taxonomy); |
32 | - if(isset($category->term_id)){ |
|
33 | - $default_cat = $category->term_id; |
|
32 | + if (isset($category->term_id)) { |
|
33 | + $default_cat = $category->term_id; |
|
34 | 34 | } |
35 | 35 | } |
36 | 36 | |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | |
59 | 59 | if ($default_pos === false) { |
60 | 60 | |
61 | - $change_cat_str = str_replace($default_cat . ',y:', $default_cat . ',y,d:', $change_cat_str); |
|
61 | + $change_cat_str = str_replace($default_cat.',y:', $default_cat.',y,d:', $change_cat_str); |
|
62 | 62 | |
63 | 63 | } |
64 | 64 | |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | $send_post_submit_mail = false; |
228 | 228 | |
229 | 229 | // unhook this function so it doesn't loop infinitely |
230 | - remove_action('save_post', 'geodir_post_information_save',10,2); |
|
230 | + remove_action('save_post', 'geodir_post_information_save', 10, 2); |
|
231 | 231 | |
232 | 232 | if (isset($request_info['pid']) && $request_info['pid'] != '') { |
233 | 233 | $post['ID'] = $request_info['pid']; |
@@ -251,13 +251,13 @@ discard block |
||
251 | 251 | } |
252 | 252 | |
253 | 253 | // re-hook this function |
254 | - add_action('save_post', 'geodir_post_information_save',10,2); |
|
254 | + add_action('save_post', 'geodir_post_information_save', 10, 2); |
|
255 | 255 | |
256 | 256 | $post_tags = ''; |
257 | 257 | if (!isset($request_info['post_tags'])) { |
258 | 258 | |
259 | 259 | $post_type = $request_info['listing_type']; |
260 | - $post_tags = implode(",", wp_get_object_terms($last_post_id, $post_type . '_tags', array('fields' => 'names'))); |
|
260 | + $post_tags = implode(",", wp_get_object_terms($last_post_id, $post_type.'_tags', array('fields' => 'names'))); |
|
261 | 261 | |
262 | 262 | } |
263 | 263 | |
@@ -275,13 +275,13 @@ discard block |
||
275 | 275 | $payment_info = array(); |
276 | 276 | $package_info = array(); |
277 | 277 | |
278 | - $package_info = (array)geodir_post_package_info($package_info, $post); |
|
278 | + $package_info = (array) geodir_post_package_info($package_info, $post); |
|
279 | 279 | |
280 | 280 | $post_package_id = geodir_get_post_meta($last_post_id, 'package_id'); |
281 | 281 | |
282 | 282 | if (!empty($package_info) && !$post_package_id) { |
283 | 283 | if (isset($package_info['days']) && $package_info['days'] != 0) { |
284 | - $payment_info['expire_date'] = date('Y-m-d', strtotime("+" . $package_info['days'] . " days")); |
|
284 | + $payment_info['expire_date'] = date('Y-m-d', strtotime("+".$package_info['days']." days")); |
|
285 | 285 | } else { |
286 | 286 | $payment_info['expire_date'] = 'Never'; |
287 | 287 | } |
@@ -302,8 +302,8 @@ discard block |
||
302 | 302 | $extrafields = $val['extra_fields']; |
303 | 303 | |
304 | 304 | if (trim($type) == 'address') { |
305 | - $prefix = $name . '_'; |
|
306 | - $address = $prefix . 'address'; |
|
305 | + $prefix = $name.'_'; |
|
306 | + $address = $prefix.'address'; |
|
307 | 307 | |
308 | 308 | if (isset($request_info[$address]) && $request_info[$address] != '') { |
309 | 309 | $gd_post_info[$address] = wp_slash($request_info[$address]); |
@@ -313,59 +313,59 @@ discard block |
||
313 | 313 | $extrafields = unserialize($extrafields); |
314 | 314 | |
315 | 315 | |
316 | - if (!isset($request_info[$prefix . 'city']) || $request_info[$prefix . 'city'] == '') { |
|
316 | + if (!isset($request_info[$prefix.'city']) || $request_info[$prefix.'city'] == '') { |
|
317 | 317 | |
318 | 318 | $location_result = geodir_get_default_location(); |
319 | 319 | |
320 | - $gd_post_info[$prefix . 'city'] = $location_result->city; |
|
321 | - $gd_post_info[$prefix . 'region'] = $location_result->region; |
|
322 | - $gd_post_info[$prefix . 'country'] = $location_result->country; |
|
320 | + $gd_post_info[$prefix.'city'] = $location_result->city; |
|
321 | + $gd_post_info[$prefix.'region'] = $location_result->region; |
|
322 | + $gd_post_info[$prefix.'country'] = $location_result->country; |
|
323 | 323 | |
324 | - $gd_post_info['post_locations'] = '[' . $location_result->city_slug . '],[' . $location_result->region_slug . '],[' . $location_result->country_slug . ']'; // set all overall post location |
|
324 | + $gd_post_info['post_locations'] = '['.$location_result->city_slug.'],['.$location_result->region_slug.'],['.$location_result->country_slug.']'; // set all overall post location |
|
325 | 325 | |
326 | 326 | } else { |
327 | 327 | |
328 | - $gd_post_info[$prefix . 'city'] = $request_info[$prefix . 'city']; |
|
329 | - $gd_post_info[$prefix . 'region'] = $request_info[$prefix . 'region']; |
|
330 | - $gd_post_info[$prefix . 'country'] = $request_info[$prefix . 'country']; |
|
328 | + $gd_post_info[$prefix.'city'] = $request_info[$prefix.'city']; |
|
329 | + $gd_post_info[$prefix.'region'] = $request_info[$prefix.'region']; |
|
330 | + $gd_post_info[$prefix.'country'] = $request_info[$prefix.'country']; |
|
331 | 331 | |
332 | 332 | //----------set post locations when import dummy data------- |
333 | 333 | $location_result = geodir_get_default_location(); |
334 | 334 | |
335 | - $gd_post_info['post_locations'] = '[' . $location_result->city_slug . '],[' . $location_result->region_slug . '],[' . $location_result->country_slug . ']'; // set all overall post location |
|
335 | + $gd_post_info['post_locations'] = '['.$location_result->city_slug.'],['.$location_result->region_slug.'],['.$location_result->country_slug.']'; // set all overall post location |
|
336 | 336 | //----------------------------------------------------------------- |
337 | 337 | |
338 | 338 | } |
339 | 339 | |
340 | 340 | |
341 | - if (isset($extrafields['show_zip']) && $extrafields['show_zip'] && isset($request_info[$prefix . 'zip'])) { |
|
342 | - $gd_post_info[$prefix . 'zip'] = $request_info[$prefix . 'zip']; |
|
341 | + if (isset($extrafields['show_zip']) && $extrafields['show_zip'] && isset($request_info[$prefix.'zip'])) { |
|
342 | + $gd_post_info[$prefix.'zip'] = $request_info[$prefix.'zip']; |
|
343 | 343 | } |
344 | 344 | |
345 | 345 | |
346 | 346 | if (isset($extrafields['show_map']) && $extrafields['show_map']) { |
347 | 347 | |
348 | - if (isset($request_info[$prefix . 'latitude']) && $request_info[$prefix . 'latitude'] != '') { |
|
349 | - $gd_post_info[$prefix . 'latitude'] = $request_info[$prefix . 'latitude']; |
|
348 | + if (isset($request_info[$prefix.'latitude']) && $request_info[$prefix.'latitude'] != '') { |
|
349 | + $gd_post_info[$prefix.'latitude'] = $request_info[$prefix.'latitude']; |
|
350 | 350 | } |
351 | 351 | |
352 | - if (isset($request_info[$prefix . 'longitude']) && $request_info[$prefix . 'longitude'] != '') { |
|
353 | - $gd_post_info[$prefix . 'longitude'] = $request_info[$prefix . 'longitude']; |
|
352 | + if (isset($request_info[$prefix.'longitude']) && $request_info[$prefix.'longitude'] != '') { |
|
353 | + $gd_post_info[$prefix.'longitude'] = $request_info[$prefix.'longitude']; |
|
354 | 354 | } |
355 | 355 | |
356 | - if (isset($request_info[$prefix . 'mapview']) && $request_info[$prefix . 'mapview'] != '') { |
|
357 | - $gd_post_info[$prefix . 'mapview'] = $request_info[$prefix . 'mapview']; |
|
356 | + if (isset($request_info[$prefix.'mapview']) && $request_info[$prefix.'mapview'] != '') { |
|
357 | + $gd_post_info[$prefix.'mapview'] = $request_info[$prefix.'mapview']; |
|
358 | 358 | } |
359 | 359 | |
360 | - if (isset($request_info[$prefix . 'mapzoom']) && $request_info[$prefix . 'mapzoom'] != '') { |
|
361 | - $gd_post_info[$prefix . 'mapzoom'] = $request_info[$prefix . 'mapzoom']; |
|
360 | + if (isset($request_info[$prefix.'mapzoom']) && $request_info[$prefix.'mapzoom'] != '') { |
|
361 | + $gd_post_info[$prefix.'mapzoom'] = $request_info[$prefix.'mapzoom']; |
|
362 | 362 | } |
363 | 363 | |
364 | 364 | } |
365 | 365 | |
366 | 366 | // show lat lng |
367 | - if (isset($extrafields['show_latlng']) && $extrafields['show_latlng'] && isset($request_info[$prefix . 'latlng'])) { |
|
368 | - $gd_post_info[$prefix . 'latlng'] = $request_info[$prefix . 'latlng']; |
|
367 | + if (isset($extrafields['show_latlng']) && $extrafields['show_latlng'] && isset($request_info[$prefix.'latlng'])) { |
|
368 | + $gd_post_info[$prefix.'latlng'] = $request_info[$prefix.'latlng']; |
|
369 | 369 | } |
370 | 370 | } |
371 | 371 | |
@@ -402,7 +402,7 @@ discard block |
||
402 | 402 | if (isset($request_info[$name])) { |
403 | 403 | $gd_post_info[$name] = $request_info[$name]; |
404 | 404 | } else { |
405 | - if (isset($request_info['gd_field_' . $name])) { |
|
405 | + if (isset($request_info['gd_field_'.$name])) { |
|
406 | 406 | $gd_post_info[$name] = ''; /* fix de-select for multiselect */ |
407 | 407 | } |
408 | 408 | } |
@@ -462,7 +462,7 @@ discard block |
||
462 | 462 | } |
463 | 463 | |
464 | 464 | if (is_array($post_tags)) { |
465 | - $taxonomy = $request_info['listing_type'] . '_tags'; |
|
465 | + $taxonomy = $request_info['listing_type'].'_tags'; |
|
466 | 466 | wp_set_object_terms($last_post_id, $post_tags, $taxonomy); |
467 | 467 | } |
468 | 468 | |
@@ -474,7 +474,7 @@ discard block |
||
474 | 474 | $tmpimgArr = trim($request_info['post_images'], ","); |
475 | 475 | $tmpimgArr = explode(",", $tmpimgArr); |
476 | 476 | geodir_save_post_images($last_post_id, $tmpimgArr, $dummy); |
477 | - } else{ |
|
477 | + } else { |
|
478 | 478 | geodir_save_post_images($last_post_id, $request_info['post_images'], $dummy); |
479 | 479 | } |
480 | 480 | |
@@ -555,7 +555,7 @@ discard block |
||
555 | 555 | if (!in_array($post_type, $all_postypes)) |
556 | 556 | return false; |
557 | 557 | |
558 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
558 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
559 | 559 | |
560 | 560 | /** |
561 | 561 | * Apply Filter to change Post info |
@@ -565,7 +565,7 @@ discard block |
||
565 | 565 | * @since 1.0.0 |
566 | 566 | * @package GeoDirectory |
567 | 567 | */ |
568 | - $query = apply_filters('geodir_post_info_query', "SELECT p.*,pd.* FROM " . $wpdb->posts . " p," . $table . " pd |
|
568 | + $query = apply_filters('geodir_post_info_query', "SELECT p.*,pd.* FROM ".$wpdb->posts." p,".$table." pd |
|
569 | 569 | WHERE p.ID = pd.post_id |
570 | 570 | AND post_id = " . $post_id); |
571 | 571 | |
@@ -628,7 +628,7 @@ discard block |
||
628 | 628 | |
629 | 629 | $post_type = get_post_type($post_id); |
630 | 630 | |
631 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
631 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
632 | 632 | |
633 | 633 | /** |
634 | 634 | * Filter to change Post info |
@@ -652,13 +652,13 @@ discard block |
||
652 | 652 | $mval = implode(",", $mval); |
653 | 653 | } |
654 | 654 | |
655 | - $post_meta_set_query .= $mkey . " = '" . $mval . "', "; |
|
655 | + $post_meta_set_query .= $mkey." = '".$mval."', "; |
|
656 | 656 | } |
657 | 657 | } |
658 | 658 | |
659 | 659 | $post_meta_set_query = trim($post_meta_set_query, ", "); |
660 | 660 | |
661 | - $post_meta_set_query = str_replace('%', '%%', $post_meta_set_query);// escape % |
|
661 | + $post_meta_set_query = str_replace('%', '%%', $post_meta_set_query); // escape % |
|
662 | 662 | |
663 | 663 | /** |
664 | 664 | * Called before saving the listing info. |
@@ -670,11 +670,11 @@ discard block |
||
670 | 670 | */ |
671 | 671 | do_action('geodir_before_save_listinginfo', $postinfo_array, $post_id); |
672 | 672 | |
673 | - if ($wpdb->get_var($wpdb->prepare("SELECT post_id from " . $table . " where post_id = %d", array($post_id)))) { |
|
673 | + if ($wpdb->get_var($wpdb->prepare("SELECT post_id from ".$table." where post_id = %d", array($post_id)))) { |
|
674 | 674 | |
675 | 675 | $wpdb->query( |
676 | 676 | $wpdb->prepare( |
677 | - "UPDATE " . $table . " SET " . $post_meta_set_query . " where post_id =%d", |
|
677 | + "UPDATE ".$table." SET ".$post_meta_set_query." where post_id =%d", |
|
678 | 678 | array($post_id) |
679 | 679 | ) |
680 | 680 | ); |
@@ -684,7 +684,7 @@ discard block |
||
684 | 684 | |
685 | 685 | $wpdb->query( |
686 | 686 | $wpdb->prepare( |
687 | - "INSERT INTO " . $table . " SET post_id = %d," . $post_meta_set_query, |
|
687 | + "INSERT INTO ".$table." SET post_id = %d,".$post_meta_set_query, |
|
688 | 688 | array($post_id) |
689 | 689 | ) |
690 | 690 | ); |
@@ -730,7 +730,7 @@ discard block |
||
730 | 730 | |
731 | 731 | $post_type = get_post_type($post_id); |
732 | 732 | |
733 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
733 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
734 | 734 | |
735 | 735 | if ($postmeta != '' && geodir_column_exist($table, $postmeta) && $post_id) { |
736 | 736 | |
@@ -738,11 +738,11 @@ discard block |
||
738 | 738 | $meta_value = implode(",", $meta_value); |
739 | 739 | } |
740 | 740 | |
741 | - if ($wpdb->get_var($wpdb->prepare("SELECT post_id from " . $table . " where post_id = %d", array($post_id)))) { |
|
741 | + if ($wpdb->get_var($wpdb->prepare("SELECT post_id from ".$table." where post_id = %d", array($post_id)))) { |
|
742 | 742 | |
743 | 743 | $wpdb->query( |
744 | 744 | $wpdb->prepare( |
745 | - "UPDATE " . $table . " SET " . $postmeta . " = '" . $meta_value . "' where post_id =%d", |
|
745 | + "UPDATE ".$table." SET ".$postmeta." = '".$meta_value."' where post_id =%d", |
|
746 | 746 | array($post_id) |
747 | 747 | ) |
748 | 748 | ); |
@@ -751,7 +751,7 @@ discard block |
||
751 | 751 | |
752 | 752 | $wpdb->query( |
753 | 753 | $wpdb->prepare( |
754 | - "INSERT INTO " . $table . " SET post_id = %d, " . $postmeta . " = '" . $meta_value . "'", |
|
754 | + "INSERT INTO ".$table." SET post_id = %d, ".$postmeta." = '".$meta_value."'", |
|
755 | 755 | array($post_id) |
756 | 756 | ) |
757 | 757 | ); |
@@ -784,23 +784,23 @@ discard block |
||
784 | 784 | |
785 | 785 | $post_type = get_post_type($post_id); |
786 | 786 | |
787 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
787 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
788 | 788 | |
789 | 789 | if (is_array($postmeta) && !empty($postmeta) && $post_id) { |
790 | 790 | $post_meta_set_query = ''; |
791 | 791 | |
792 | 792 | foreach ($postmeta as $mkey) { |
793 | 793 | if ($mval != '') |
794 | - $post_meta_set_query .= $mkey . " = '', "; |
|
794 | + $post_meta_set_query .= $mkey." = '', "; |
|
795 | 795 | } |
796 | 796 | |
797 | 797 | $post_meta_set_query = trim($post_meta_set_query, ", "); |
798 | 798 | |
799 | - if ($wpdb->get_var("SHOW COLUMNS FROM " . $table . " WHERE field = '" . $postmeta . "'") != '') { |
|
799 | + if ($wpdb->get_var("SHOW COLUMNS FROM ".$table." WHERE field = '".$postmeta."'") != '') { |
|
800 | 800 | |
801 | 801 | $wpdb->query( |
802 | 802 | $wpdb->prepare( |
803 | - "UPDATE " . $table . " SET " . $post_meta_set_query . " where post_id = %d", |
|
803 | + "UPDATE ".$table." SET ".$post_meta_set_query." where post_id = %d", |
|
804 | 804 | array($post_id) |
805 | 805 | ) |
806 | 806 | ); |
@@ -809,11 +809,11 @@ discard block |
||
809 | 809 | } |
810 | 810 | |
811 | 811 | } elseif ($postmeta != '' && $post_id) { |
812 | - if ($wpdb->get_var("SHOW COLUMNS FROM " . $table . " WHERE field = '" . $postmeta . "'") != '') { |
|
812 | + if ($wpdb->get_var("SHOW COLUMNS FROM ".$table." WHERE field = '".$postmeta."'") != '') { |
|
813 | 813 | |
814 | 814 | $wpdb->query( |
815 | 815 | $wpdb->prepare( |
816 | - "UPDATE " . $table . " SET " . $postmeta . "= '' where post_id = %d", |
|
816 | + "UPDATE ".$table." SET ".$postmeta."= '' where post_id = %d", |
|
817 | 817 | array($post_id) |
818 | 818 | ) |
819 | 819 | ); |
@@ -855,10 +855,10 @@ discard block |
||
855 | 855 | if (!in_array($post_type, $all_postypes)) |
856 | 856 | return false; |
857 | 857 | |
858 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
858 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
859 | 859 | |
860 | - if ($wpdb->get_var("SHOW COLUMNS FROM " . $table . " WHERE field = '" . $meta_key . "'") != '') { |
|
861 | - $meta_value = $wpdb->get_var($wpdb->prepare("SELECT " . $meta_key . " from " . $table . " where post_id = %d", array($post_id))); |
|
860 | + if ($wpdb->get_var("SHOW COLUMNS FROM ".$table." WHERE field = '".$meta_key."'") != '') { |
|
861 | + $meta_value = $wpdb->get_var($wpdb->prepare("SELECT ".$meta_key." from ".$table." where post_id = %d", array($post_id))); |
|
862 | 862 | |
863 | 863 | if ($meta_value && $meta_value !== '') { |
864 | 864 | return maybe_serialize($meta_value); |
@@ -892,13 +892,13 @@ discard block |
||
892 | 892 | |
893 | 893 | $post_type = get_post_type($post_id); |
894 | 894 | |
895 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
895 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
896 | 896 | |
897 | 897 | $post_images = geodir_get_images($post_id); |
898 | 898 | |
899 | 899 | $wpdb->query( |
900 | 900 | $wpdb->prepare( |
901 | - "UPDATE " . $table . " SET featured_image = '' where post_id =%d", |
|
901 | + "UPDATE ".$table." SET featured_image = '' where post_id =%d", |
|
902 | 902 | array($post_id) |
903 | 903 | ) |
904 | 904 | ); |
@@ -928,12 +928,12 @@ discard block |
||
928 | 928 | $file_path = ''; |
929 | 929 | /* --------- start ------- */ |
930 | 930 | |
931 | - $split_img_path = explode(str_replace(array('http://','https://'),'',$uploads['baseurl']), str_replace(array('http://','https://'),'',$post_image[$m])); |
|
931 | + $split_img_path = explode(str_replace(array('http://', 'https://'), '', $uploads['baseurl']), str_replace(array('http://', 'https://'), '', $post_image[$m])); |
|
932 | 932 | |
933 | 933 | $split_img_file_path = isset($split_img_path[1]) ? $split_img_path[1] : ''; |
934 | 934 | |
935 | 935 | |
936 | - if (!$find_image = $wpdb->get_var($wpdb->prepare("SELECT ID FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE file=%s AND post_id = %d", array($split_img_file_path, $post_id)))) { |
|
936 | + if (!$find_image = $wpdb->get_var($wpdb->prepare("SELECT ID FROM ".GEODIR_ATTACHMENT_TABLE." WHERE file=%s AND post_id = %d", array($split_img_file_path, $post_id)))) { |
|
937 | 937 | |
938 | 938 | /* --------- end ------- */ |
939 | 939 | $curr_img_url = $post_image[$m]; |
@@ -977,7 +977,7 @@ discard block |
||
977 | 977 | // If the uploaded file is the right format |
978 | 978 | if (in_array($uploaded_file_type, $allowed_file_types)) { |
979 | 979 | if (!function_exists('wp_handle_upload')) { |
980 | - require_once(ABSPATH . 'wp-admin/includes/file.php'); |
|
980 | + require_once(ABSPATH.'wp-admin/includes/file.php'); |
|
981 | 981 | } |
982 | 982 | |
983 | 983 | if (!is_dir($geodir_uploadpath)) { |
@@ -985,41 +985,41 @@ discard block |
||
985 | 985 | } |
986 | 986 | |
987 | 987 | $external_img = false; |
988 | - if (strpos(str_replace(array('http://','https://'),'',$curr_img_url), str_replace(array('http://','https://'),'',$uploads['baseurl'])) !== false) { |
|
988 | + if (strpos(str_replace(array('http://', 'https://'), '', $curr_img_url), str_replace(array('http://', 'https://'), '', $uploads['baseurl'])) !== false) { |
|
989 | 989 | } else { |
990 | 990 | $external_img = true; |
991 | 991 | } |
992 | 992 | |
993 | 993 | if ($dummy || $external_img) { |
994 | 994 | $uploaded_file = array(); |
995 | - $uploaded = (array)fetch_remote_file($curr_img_url); |
|
995 | + $uploaded = (array) fetch_remote_file($curr_img_url); |
|
996 | 996 | |
997 | 997 | if (isset($uploaded['error']) && empty($uploaded['error'])) { |
998 | 998 | $new_name = basename($uploaded['file']); |
999 | 999 | $uploaded_file = $uploaded; |
1000 | - }else{ |
|
1001 | - print_r($uploaded);exit; |
|
1000 | + } else { |
|
1001 | + print_r($uploaded); exit; |
|
1002 | 1002 | } |
1003 | 1003 | $external_img = false; |
1004 | 1004 | } else { |
1005 | - $new_name = $post_id . '_' . $file_name; |
|
1005 | + $new_name = $post_id.'_'.$file_name; |
|
1006 | 1006 | |
1007 | 1007 | if ($curr_img_dir == $sub_dir) { |
1008 | - $img_path = $geodir_uploadpath . '/' . $filename; |
|
1009 | - $img_url = $geodir_uploadurl . '/' . $filename; |
|
1008 | + $img_path = $geodir_uploadpath.'/'.$filename; |
|
1009 | + $img_url = $geodir_uploadurl.'/'.$filename; |
|
1010 | 1010 | } else { |
1011 | - $img_path = $uploads_dir . '/temp_' . $current_user->data->ID . '/' . $filename; |
|
1012 | - $img_url = $uploads['url'] . '/temp_' . $current_user->data->ID . '/' . $filename; |
|
1011 | + $img_path = $uploads_dir.'/temp_'.$current_user->data->ID.'/'.$filename; |
|
1012 | + $img_url = $uploads['url'].'/temp_'.$current_user->data->ID.'/'.$filename; |
|
1013 | 1013 | } |
1014 | 1014 | |
1015 | 1015 | $uploaded_file = ''; |
1016 | 1016 | |
1017 | 1017 | if (file_exists($img_path)) { |
1018 | - $uploaded_file = copy($img_path, $geodir_uploadpath . '/' . $new_name); |
|
1018 | + $uploaded_file = copy($img_path, $geodir_uploadpath.'/'.$new_name); |
|
1019 | 1019 | $file_path = ''; |
1020 | - } else if (file_exists($uploads['basedir'] . $curr_img_dir . $filename)) { |
|
1020 | + } else if (file_exists($uploads['basedir'].$curr_img_dir.$filename)) { |
|
1021 | 1021 | $uploaded_file = true; |
1022 | - $file_path = $curr_img_dir . '/' . $filename; |
|
1022 | + $file_path = $curr_img_dir.'/'.$filename; |
|
1023 | 1023 | } |
1024 | 1024 | |
1025 | 1025 | if ($curr_img_dir != $geodir_uploaddir && file_exists($img_path)) |
@@ -1028,14 +1028,14 @@ discard block |
||
1028 | 1028 | |
1029 | 1029 | if (!empty($uploaded_file)) { |
1030 | 1030 | if (!isset($file_path) || !$file_path) { |
1031 | - $file_path = $sub_dir . '/' . $new_name; |
|
1031 | + $file_path = $sub_dir.'/'.$new_name; |
|
1032 | 1032 | } |
1033 | 1033 | |
1034 | - $postcurr_images[] = str_replace(array('http://','https://'),'',$uploads['baseurl'] . $file_path); |
|
1034 | + $postcurr_images[] = str_replace(array('http://', 'https://'), '', $uploads['baseurl'].$file_path); |
|
1035 | 1035 | |
1036 | 1036 | if ($menu_order == 1) { |
1037 | 1037 | |
1038 | - $wpdb->query($wpdb->prepare("UPDATE " . $table . " SET featured_image = %s where post_id =%d", array($file_path, $post_id))); |
|
1038 | + $wpdb->query($wpdb->prepare("UPDATE ".$table." SET featured_image = %s where post_id =%d", array($file_path, $post_id))); |
|
1039 | 1039 | |
1040 | 1040 | } |
1041 | 1041 | |
@@ -1053,12 +1053,12 @@ discard block |
||
1053 | 1053 | |
1054 | 1054 | foreach ($attachment as $key => $val) { |
1055 | 1055 | if ($val != '') |
1056 | - $attachment_set .= $key . " = '" . $val . "', "; |
|
1056 | + $attachment_set .= $key." = '".$val."', "; |
|
1057 | 1057 | } |
1058 | 1058 | |
1059 | 1059 | $attachment_set = trim($attachment_set, ", "); |
1060 | 1060 | |
1061 | - $wpdb->query("INSERT INTO " . GEODIR_ATTACHMENT_TABLE . " SET " . $attachment_set); |
|
1061 | + $wpdb->query("INSERT INTO ".GEODIR_ATTACHMENT_TABLE." SET ".$attachment_set); |
|
1062 | 1062 | |
1063 | 1063 | $valid_file_ids[] = $wpdb->insert_id; |
1064 | 1064 | } |
@@ -1069,17 +1069,17 @@ discard block |
||
1069 | 1069 | } else { |
1070 | 1070 | $valid_file_ids[] = $find_image; |
1071 | 1071 | |
1072 | - $postcurr_images[] = str_replace(array('http://','https://'),'',$post_image[$m]); |
|
1072 | + $postcurr_images[] = str_replace(array('http://', 'https://'), '', $post_image[$m]); |
|
1073 | 1073 | |
1074 | 1074 | $wpdb->query( |
1075 | 1075 | $wpdb->prepare( |
1076 | - "UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order = %d where file =%s AND post_id =%d", |
|
1076 | + "UPDATE ".GEODIR_ATTACHMENT_TABLE." SET menu_order = %d where file =%s AND post_id =%d", |
|
1077 | 1077 | array($menu_order, $split_img_path[1], $post_id) |
1078 | 1078 | ) |
1079 | 1079 | ); |
1080 | 1080 | |
1081 | 1081 | if ($menu_order == 1) |
1082 | - $wpdb->query($wpdb->prepare("UPDATE " . $table . " SET featured_image = %s where post_id =%d", array($split_img_path[1], $post_id))); |
|
1082 | + $wpdb->query($wpdb->prepare("UPDATE ".$table." SET featured_image = %s where post_id =%d", array($split_img_path[1], $post_id))); |
|
1083 | 1083 | |
1084 | 1084 | } |
1085 | 1085 | |
@@ -1103,9 +1103,9 @@ discard block |
||
1103 | 1103 | |
1104 | 1104 | foreach ($post_images as $img) { |
1105 | 1105 | |
1106 | - if (!in_array(str_replace(array('http://','https://'),'',$img->src), $postcurr_images)) { |
|
1106 | + if (!in_array(str_replace(array('http://', 'https://'), '', $img->src), $postcurr_images)) { |
|
1107 | 1107 | |
1108 | - $invalid_files[] = (object)array('src' => $img->src); |
|
1108 | + $invalid_files[] = (object) array('src' => $img->src); |
|
1109 | 1109 | |
1110 | 1110 | } |
1111 | 1111 | |
@@ -1113,12 +1113,12 @@ discard block |
||
1113 | 1113 | |
1114 | 1114 | } |
1115 | 1115 | |
1116 | - $invalid_files = (object)$invalid_files; |
|
1116 | + $invalid_files = (object) $invalid_files; |
|
1117 | 1117 | } |
1118 | 1118 | |
1119 | 1119 | $remove_files[] = $post_id; |
1120 | 1120 | |
1121 | - $wpdb->query($wpdb->prepare("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE " . $valid_files_condition . " post_id = %d", $remove_files)); |
|
1121 | + $wpdb->query($wpdb->prepare("DELETE FROM ".GEODIR_ATTACHMENT_TABLE." WHERE ".$valid_files_condition." post_id = %d", $remove_files)); |
|
1122 | 1122 | |
1123 | 1123 | if (!empty($invalid_files)) |
1124 | 1124 | geodir_remove_attachments($invalid_files); |
@@ -1158,7 +1158,7 @@ discard block |
||
1158 | 1158 | rmdir($dirPath); |
1159 | 1159 | } */ |
1160 | 1160 | |
1161 | - $dirname = $uploads_dir . '/temp_' . $current_user->ID; |
|
1161 | + $dirname = $uploads_dir.'/temp_'.$current_user->ID; |
|
1162 | 1162 | geodir_delete_directory($dirname); |
1163 | 1163 | } |
1164 | 1164 | |
@@ -1180,10 +1180,10 @@ discard block |
||
1180 | 1180 | return false; |
1181 | 1181 | while ($file = readdir($dir_handle)) { |
1182 | 1182 | if ($file != "." && $file != "..") { |
1183 | - if (!is_dir($dirname . "/" . $file)) |
|
1184 | - unlink($dirname . "/" . $file); |
|
1183 | + if (!is_dir($dirname."/".$file)) |
|
1184 | + unlink($dirname."/".$file); |
|
1185 | 1185 | else |
1186 | - geodir_delete_directory($dirname . '/' . $file); |
|
1186 | + geodir_delete_directory($dirname.'/'.$file); |
|
1187 | 1187 | } |
1188 | 1188 | } |
1189 | 1189 | closedir($dir_handle); |
@@ -1212,8 +1212,8 @@ discard block |
||
1212 | 1212 | foreach ($postcurr_images as $postimg) { |
1213 | 1213 | $image_name_arr = explode('/', $postimg->src); |
1214 | 1214 | $filename = end($image_name_arr); |
1215 | - if (file_exists($uploads_dir . '/' . $filename)) |
|
1216 | - unlink($uploads_dir . '/' . $filename); |
|
1215 | + if (file_exists($uploads_dir.'/'.$filename)) |
|
1216 | + unlink($uploads_dir.'/'.$filename); |
|
1217 | 1217 | } |
1218 | 1218 | |
1219 | 1219 | } // endif |
@@ -1254,16 +1254,16 @@ discard block |
||
1254 | 1254 | } |
1255 | 1255 | |
1256 | 1256 | if (!in_array($post_type, geodir_get_posttypes())) { |
1257 | - return false;// if not a GD CPT return; |
|
1257 | + return false; // if not a GD CPT return; |
|
1258 | 1258 | } |
1259 | 1259 | |
1260 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
1260 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
1261 | 1261 | |
1262 | 1262 | if (!$file) { |
1263 | 1263 | if (isset($post->featured_image)) { |
1264 | 1264 | $file = $post->featured_image; |
1265 | 1265 | } else { |
1266 | - $file = $wpdb->get_var($wpdb->prepare("SELECT featured_image FROM " . $table . " WHERE post_id = %d", array($post_id))); |
|
1266 | + $file = $wpdb->get_var($wpdb->prepare("SELECT featured_image FROM ".$table." WHERE post_id = %d", array($post_id))); |
|
1267 | 1267 | } |
1268 | 1268 | } |
1269 | 1269 | |
@@ -1281,7 +1281,7 @@ discard block |
||
1281 | 1281 | |
1282 | 1282 | $file_name = $file_info['basename']; |
1283 | 1283 | |
1284 | - $uploads_url = $uploads_baseurl . $sub_dir; |
|
1284 | + $uploads_url = $uploads_baseurl.$sub_dir; |
|
1285 | 1285 | /* |
1286 | 1286 | * Allows the filter of image src for such things as CDN change. |
1287 | 1287 | * |
@@ -1291,8 +1291,8 @@ discard block |
||
1291 | 1291 | * @param string $uploads_url The server upload directory url. |
1292 | 1292 | * @param string $uploads_baseurl The uploads dir base url. |
1293 | 1293 | */ |
1294 | - $img_arr['src'] = apply_filters('geodir_get_featured_image_src',$uploads_url . '/' . $file_name,$file_name,$uploads_url,$uploads_baseurl); |
|
1295 | - $img_arr['path'] = $uploads_path . '/' . $file_name; |
|
1294 | + $img_arr['src'] = apply_filters('geodir_get_featured_image_src', $uploads_url.'/'.$file_name, $file_name, $uploads_url, $uploads_baseurl); |
|
1295 | + $img_arr['path'] = $uploads_path.'/'.$file_name; |
|
1296 | 1296 | $width = 0; |
1297 | 1297 | $height = 0; |
1298 | 1298 | if (is_file($img_arr['path']) && file_exists($img_arr['path'])) { |
@@ -1335,7 +1335,7 @@ discard block |
||
1335 | 1335 | $file_name = $file_info['basename']; |
1336 | 1336 | |
1337 | 1337 | $img_arr['src'] = $default_img; |
1338 | - $img_arr['path'] = $uploads_path . '/' . $file_name; |
|
1338 | + $img_arr['path'] = $uploads_path.'/'.$file_name; |
|
1339 | 1339 | |
1340 | 1340 | $width = 0; |
1341 | 1341 | $height = 0; |
@@ -1352,7 +1352,7 @@ discard block |
||
1352 | 1352 | } |
1353 | 1353 | |
1354 | 1354 | if (!empty($img_arr)) |
1355 | - return (object)$img_arr;//return (object)array( 'src' => $file_url, 'path' => $file_path ); |
|
1355 | + return (object) $img_arr; //return (object)array( 'src' => $file_url, 'path' => $file_path ); |
|
1356 | 1356 | else |
1357 | 1357 | return false; |
1358 | 1358 | } |
@@ -1415,7 +1415,7 @@ discard block |
||
1415 | 1415 | |
1416 | 1416 | $arrImages = $wpdb->get_results( |
1417 | 1417 | $wpdb->prepare( |
1418 | - "SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE mime_type like %s AND post_id = %d" . $not_featured . " ORDER BY menu_order ASC, ID DESC $limit_q ", |
|
1418 | + "SELECT * FROM ".GEODIR_ATTACHMENT_TABLE." WHERE mime_type like %s AND post_id = %d".$not_featured." ORDER BY menu_order ASC, ID DESC $limit_q ", |
|
1419 | 1419 | array('%image%', $post_id) |
1420 | 1420 | ) |
1421 | 1421 | ); |
@@ -1441,7 +1441,7 @@ discard block |
||
1441 | 1441 | |
1442 | 1442 | $file_name = $file_info['basename']; |
1443 | 1443 | |
1444 | - $uploads_url = $uploads_baseurl . $sub_dir; |
|
1444 | + $uploads_url = $uploads_baseurl.$sub_dir; |
|
1445 | 1445 | /* |
1446 | 1446 | * Allows the filter of image src for such things as CDN change. |
1447 | 1447 | * |
@@ -1451,8 +1451,8 @@ discard block |
||
1451 | 1451 | * @param string $uploads_url The server upload directory url. |
1452 | 1452 | * @param string $uploads_baseurl The uploads dir base url. |
1453 | 1453 | */ |
1454 | - $img_arr['src'] = apply_filters('geodir_get_images_src',$uploads_url . '/' . $file_name,$file_name,$uploads_url,$uploads_baseurl); |
|
1455 | - $img_arr['path'] = $uploads_path . '/' . $file_name; |
|
1454 | + $img_arr['src'] = apply_filters('geodir_get_images_src', $uploads_url.'/'.$file_name, $file_name, $uploads_url, $uploads_baseurl); |
|
1455 | + $img_arr['path'] = $uploads_path.'/'.$file_name; |
|
1456 | 1456 | $width = 0; |
1457 | 1457 | $height = 0; |
1458 | 1458 | if (is_file($img_arr['path']) && file_exists($img_arr['path'])) { |
@@ -1469,11 +1469,11 @@ discard block |
||
1469 | 1469 | $img_arr['content'] = $attechment->content; // add the description to the array |
1470 | 1470 | $img_arr['is_approved'] = isset($attechment->is_approved) ? $attechment->is_approved : ''; // used for user image moderation. For backward compatibility Default value is 1. |
1471 | 1471 | |
1472 | - $return_arr[] = (object)$img_arr; |
|
1472 | + $return_arr[] = (object) $img_arr; |
|
1473 | 1473 | |
1474 | 1474 | $counter++; |
1475 | 1475 | } |
1476 | - return (object)$return_arr; |
|
1476 | + return (object) $return_arr; |
|
1477 | 1477 | } else if ($no_images) { |
1478 | 1478 | $default_img = ''; |
1479 | 1479 | $default_cat = geodir_get_post_meta($post_id, 'default_category', true); |
@@ -1512,7 +1512,7 @@ discard block |
||
1512 | 1512 | $img_arr['title'] = $file_info['filename']; // add the title to the array |
1513 | 1513 | $img_arr['content'] = $file_info['filename']; // add the description to the array |
1514 | 1514 | |
1515 | - $return_arr[] = (object)$img_arr; |
|
1515 | + $return_arr[] = (object) $img_arr; |
|
1516 | 1516 | |
1517 | 1517 | return $return_arr; |
1518 | 1518 | } else |
@@ -1539,8 +1539,8 @@ discard block |
||
1539 | 1539 | |
1540 | 1540 | $html = ''; |
1541 | 1541 | if (!empty($request)) { |
1542 | - if (!is_object($request)){ |
|
1543 | - $request = (object)$request; |
|
1542 | + if (!is_object($request)) { |
|
1543 | + $request = (object) $request; |
|
1544 | 1544 | } |
1545 | 1545 | |
1546 | 1546 | if (isset($request->src) && !isset($request->path)) { |
@@ -1554,7 +1554,7 @@ discard block |
||
1554 | 1554 | $img_no_http = str_replace(array("http://", "https://"), "", $request->path); |
1555 | 1555 | $upload_no_http = str_replace(array("http://", "https://"), "", $upload_dir['baseurl']); |
1556 | 1556 | if (strpos($img_no_http, $upload_no_http) !== false) { |
1557 | - $request->path = str_replace( $img_no_http,$upload_dir['basedir'], $request->path); |
|
1557 | + $request->path = str_replace($img_no_http, $upload_dir['basedir'], $request->path); |
|
1558 | 1558 | } |
1559 | 1559 | |
1560 | 1560 | $width = 0; |
@@ -1569,7 +1569,7 @@ discard block |
||
1569 | 1569 | $image->width = $width; |
1570 | 1570 | $image->height = $height; |
1571 | 1571 | |
1572 | - $max_size = (object)geodir_get_imagesize($size); |
|
1572 | + $max_size = (object) geodir_get_imagesize($size); |
|
1573 | 1573 | |
1574 | 1574 | if (!is_wp_error($max_size)) { |
1575 | 1575 | if ($image->width) { |
@@ -1581,12 +1581,12 @@ discard block |
||
1581 | 1581 | $width_per = 100; |
1582 | 1582 | } |
1583 | 1583 | |
1584 | - if (is_admin() && !isset($_REQUEST['geodir_ajax'])){ |
|
1585 | - $html = '<div class="geodir_thumbnail"><img style="max-height:' . $max_size->h . 'px;" alt="place image" src="' . $image->src . '" /></div>'; |
|
1584 | + if (is_admin() && !isset($_REQUEST['geodir_ajax'])) { |
|
1585 | + $html = '<div class="geodir_thumbnail"><img style="max-height:'.$max_size->h.'px;" alt="place image" src="'.$image->src.'" /></div>'; |
|
1586 | 1586 | } else { |
1587 | - if($size=='widget-thumb' || !get_option('geodir_lazy_load',1)){ |
|
1588 | - $html = '<div class="geodir_thumbnail" style="background-image:url(\'' . $image->src . '\');"></div>'; |
|
1589 | - }else{ |
|
1587 | + if ($size == 'widget-thumb' || !get_option('geodir_lazy_load', 1)) { |
|
1588 | + $html = '<div class="geodir_thumbnail" style="background-image:url(\''.$image->src.'\');"></div>'; |
|
1589 | + } else { |
|
1590 | 1590 | //$html = '<div class="geodir_thumbnail" style="background-image:url(\'' . $image->src . '\');"></div>'; |
1591 | 1591 | //$html = '<div data-src="'.$image->src.'" class="geodir_thumbnail" ></div>'; |
1592 | 1592 | $html = '<div data-src="'.$image->src.'" class="geodir_thumbnail geodir_lazy_load_thumbnail" ></div>'; |
@@ -1625,15 +1625,15 @@ discard block |
||
1625 | 1625 | |
1626 | 1626 | $post_type = get_post_type($post_id); |
1627 | 1627 | |
1628 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
1628 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
1629 | 1629 | |
1630 | 1630 | if (in_array($post_type, geodir_get_posttypes()) && !wp_is_post_revision($post_id)) { |
1631 | 1631 | |
1632 | - if ($taxonomy == $post_type . '_tags') { |
|
1632 | + if ($taxonomy == $post_type.'_tags') { |
|
1633 | 1633 | if (isset($_POST['action']) && $_POST['action'] == 'inline-save') { |
1634 | 1634 | geodir_save_post_meta($post_id, 'post_tags', $terms); |
1635 | 1635 | } |
1636 | - } elseif ($taxonomy == $post_type . 'category') { |
|
1636 | + } elseif ($taxonomy == $post_type.'category') { |
|
1637 | 1637 | $srcharr = array('"', '\\'); |
1638 | 1638 | $replarr = array(""", ''); |
1639 | 1639 | |
@@ -1655,7 +1655,7 @@ discard block |
||
1655 | 1655 | |
1656 | 1656 | $wpdb->get_var( |
1657 | 1657 | $wpdb->prepare( |
1658 | - "DELETE from " . GEODIR_ICON_TABLE . " WHERE cat_id NOT IN ($format) AND post_id = %d ", |
|
1658 | + "DELETE from ".GEODIR_ICON_TABLE." WHERE cat_id NOT IN ($format) AND post_id = %d ", |
|
1659 | 1659 | $cat_ids_array_del |
1660 | 1660 | ) |
1661 | 1661 | ); |
@@ -1663,7 +1663,7 @@ discard block |
||
1663 | 1663 | |
1664 | 1664 | $post_term = $wpdb->get_col( |
1665 | 1665 | $wpdb->prepare( |
1666 | - "SELECT term_id FROM " . $wpdb->term_taxonomy . " WHERE term_taxonomy_id IN($format) GROUP BY term_id", |
|
1666 | + "SELECT term_id FROM ".$wpdb->term_taxonomy." WHERE term_taxonomy_id IN($format) GROUP BY term_id", |
|
1667 | 1667 | $cat_ids_array |
1668 | 1668 | ) |
1669 | 1669 | ); |
@@ -1685,16 +1685,16 @@ discard block |
||
1685 | 1685 | $lat = geodir_get_post_meta($post_id, 'post_latitude', true); |
1686 | 1686 | $lng = geodir_get_post_meta($post_id, 'post_longitude', true); |
1687 | 1687 | |
1688 | - $timing = ' - ' . date('D M j, Y', strtotime(geodir_get_post_meta($post_id, 'st_date', true))); |
|
1689 | - $timing .= ' - ' . geodir_get_post_meta($post_id, 'st_time', true); |
|
1688 | + $timing = ' - '.date('D M j, Y', strtotime(geodir_get_post_meta($post_id, 'st_date', true))); |
|
1689 | + $timing .= ' - '.geodir_get_post_meta($post_id, 'st_time', true); |
|
1690 | 1690 | |
1691 | 1691 | $json = '{'; |
1692 | - $json .= '"id":"' . $post_id . '",'; |
|
1693 | - $json .= '"lat_pos": "' . $lat . '",'; |
|
1694 | - $json .= '"long_pos": "' . $lng . '",'; |
|
1695 | - $json .= '"marker_id":"' . $post_id . '_' . $cat_id . '",'; |
|
1696 | - $json .= '"icon":"' . $term_icon . '",'; |
|
1697 | - $json .= '"group":"catgroup' . $cat_id . '"'; |
|
1692 | + $json .= '"id":"'.$post_id.'",'; |
|
1693 | + $json .= '"lat_pos": "'.$lat.'",'; |
|
1694 | + $json .= '"long_pos": "'.$lng.'",'; |
|
1695 | + $json .= '"marker_id":"'.$post_id.'_'.$cat_id.'",'; |
|
1696 | + $json .= '"icon":"'.$term_icon.'",'; |
|
1697 | + $json .= '"group":"catgroup'.$cat_id.'"'; |
|
1698 | 1698 | $json .= '}'; |
1699 | 1699 | |
1700 | 1700 | |
@@ -1702,9 +1702,9 @@ discard block |
||
1702 | 1702 | $post_marker_json = $json; |
1703 | 1703 | |
1704 | 1704 | |
1705 | - if ($wpdb->get_var($wpdb->prepare("SELECT post_id from " . GEODIR_ICON_TABLE . " WHERE post_id = %d AND cat_id = %d", array($post_id, $cat_id)))) { |
|
1705 | + if ($wpdb->get_var($wpdb->prepare("SELECT post_id from ".GEODIR_ICON_TABLE." WHERE post_id = %d AND cat_id = %d", array($post_id, $cat_id)))) { |
|
1706 | 1706 | |
1707 | - $json_query = $wpdb->prepare("UPDATE " . GEODIR_ICON_TABLE . " SET |
|
1707 | + $json_query = $wpdb->prepare("UPDATE ".GEODIR_ICON_TABLE." SET |
|
1708 | 1708 | post_title = %s, |
1709 | 1709 | json = %s |
1710 | 1710 | WHERE post_id = %d AND cat_id = %d ", |
@@ -1712,7 +1712,7 @@ discard block |
||
1712 | 1712 | |
1713 | 1713 | } else { |
1714 | 1714 | |
1715 | - $json_query = $wpdb->prepare("INSERT INTO " . GEODIR_ICON_TABLE . " SET |
|
1715 | + $json_query = $wpdb->prepare("INSERT INTO ".GEODIR_ICON_TABLE." SET |
|
1716 | 1716 | post_id = %d, |
1717 | 1717 | post_title = %s, |
1718 | 1718 | cat_id = %d, |
@@ -1730,17 +1730,17 @@ discard block |
||
1730 | 1730 | if (!empty($post_term) && is_array($post_term)) { |
1731 | 1731 | $categories = implode(',', $post_term); |
1732 | 1732 | |
1733 | - if ($categories != '' && $categories != 0) $categories = ',' . $categories . ','; |
|
1733 | + if ($categories != '' && $categories != 0) $categories = ','.$categories.','; |
|
1734 | 1734 | |
1735 | 1735 | if (empty($post_marker_json)) |
1736 | 1736 | $post_marker_json = isset($json) ? $json : ''; |
1737 | 1737 | |
1738 | - if ($wpdb->get_var($wpdb->prepare("SELECT post_id from " . $table . " where post_id = %d", array($post_id)))) { |
|
1738 | + if ($wpdb->get_var($wpdb->prepare("SELECT post_id from ".$table." where post_id = %d", array($post_id)))) { |
|
1739 | 1739 | |
1740 | 1740 | $wpdb->query( |
1741 | 1741 | $wpdb->prepare( |
1742 | - "UPDATE " . $table . " SET |
|
1743 | - " . $taxonomy . " = %s, |
|
1742 | + "UPDATE ".$table." SET |
|
1743 | + " . $taxonomy." = %s, |
|
1744 | 1744 | marker_json = %s |
1745 | 1745 | where post_id = %d", |
1746 | 1746 | array($categories, $post_marker_json, $post_id) |
@@ -1761,7 +1761,7 @@ discard block |
||
1761 | 1761 | |
1762 | 1762 | $wpdb->query( |
1763 | 1763 | $wpdb->prepare( |
1764 | - "UPDATE " . $table . " SET |
|
1764 | + "UPDATE ".$table." SET |
|
1765 | 1765 | default_category = %s |
1766 | 1766 | where post_id = %d", |
1767 | 1767 | array($categories[0], $post_id) |
@@ -1786,9 +1786,9 @@ discard block |
||
1786 | 1786 | |
1787 | 1787 | $wpdb->query( |
1788 | 1788 | $wpdb->prepare( |
1789 | - "INSERT INTO " . $table . " SET |
|
1789 | + "INSERT INTO ".$table." SET |
|
1790 | 1790 | post_id = %d, |
1791 | - " . $taxonomy . " = %s, |
|
1791 | + " . $taxonomy." = %s, |
|
1792 | 1792 | marker_json = %s ", |
1793 | 1793 | |
1794 | 1794 | array($post_id, $categories, $post_marker_json) |
@@ -1917,7 +1917,7 @@ discard block |
||
1917 | 1917 | } ?>"><img alt="bubble image" style="max-height:50px;" |
1918 | 1918 | src="<?php echo $post_images[0]; ?>"/></a></div> |
1919 | 1919 | <?php |
1920 | - }else{ |
|
1920 | + } else { |
|
1921 | 1921 | echo '<div class="geodir-bubble_image"></div>'; |
1922 | 1922 | } |
1923 | 1923 | } else { |
@@ -1925,7 +1925,7 @@ discard block |
||
1925 | 1925 | ?> |
1926 | 1926 | <div class="geodir-bubble_image"><a href="<?php echo $plink; ?>"><?php echo $image; ?></a></div> |
1927 | 1927 | <?php |
1928 | - }else{ |
|
1928 | + } else { |
|
1929 | 1929 | echo '<div class="geodir-bubble_image"></div>'; |
1930 | 1930 | } |
1931 | 1931 | } |
@@ -1959,7 +1959,7 @@ discard block |
||
1959 | 1959 | * @param object $postinfo_obj The posts info as an object. |
1960 | 1960 | * @param bool|string $post_preview True if currently in post preview page. Empty string if not. * |
1961 | 1961 | */ |
1962 | - do_action('geodir_infowindow_meta_after',$postinfo_obj,$post_preview ); |
|
1962 | + do_action('geodir_infowindow_meta_after', $postinfo_obj, $post_preview); |
|
1963 | 1963 | ?> |
1964 | 1964 | </div> |
1965 | 1965 | <?php |
@@ -1971,10 +1971,10 @@ discard block |
||
1971 | 1971 | <div class="geodir-bubble-meta-fade"></div> |
1972 | 1972 | |
1973 | 1973 | <div class="geodir-bubble-meta-bottom"> |
1974 | - <span class="geodir-bubble-rating"><?php echo $rating_star;?></span> |
|
1974 | + <span class="geodir-bubble-rating"><?php echo $rating_star; ?></span> |
|
1975 | 1975 | |
1976 | 1976 | <span |
1977 | - class="geodir-bubble-fav"><?php echo geodir_favourite_html($post_author, $ID);?></span> |
|
1977 | + class="geodir-bubble-fav"><?php echo geodir_favourite_html($post_author, $ID); ?></span> |
|
1978 | 1978 | <span class="geodir-bubble-reviews"><a href="<?php echo get_comments_link($ID); ?>" |
1979 | 1979 | class="geodir-pcomments"><i class="fa fa-comments"></i> |
1980 | 1980 | <?php echo get_comments_number($ID); ?> |
@@ -2039,11 +2039,11 @@ discard block |
||
2039 | 2039 | |
2040 | 2040 | $post_type = get_post_type($post_id); |
2041 | 2041 | |
2042 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
2042 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
2043 | 2043 | |
2044 | 2044 | $wpdb->query( |
2045 | 2045 | $wpdb->prepare( |
2046 | - "UPDATE " . $table . " SET post_status=%s WHERE post_id=%d", |
|
2046 | + "UPDATE ".$table." SET post_status=%s WHERE post_id=%d", |
|
2047 | 2047 | array($status, $post_id) |
2048 | 2048 | ) |
2049 | 2049 | ); |
@@ -2115,18 +2115,18 @@ discard block |
||
2115 | 2115 | |
2116 | 2116 | $post_type = get_post_type($post_id); |
2117 | 2117 | |
2118 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
2118 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
2119 | 2119 | |
2120 | 2120 | $wpdb->query( |
2121 | 2121 | $wpdb->prepare( |
2122 | - "UPDATE " . $table . " SET `post_id` = %d WHERE `post_id` = %d", |
|
2122 | + "UPDATE ".$table." SET `post_id` = %d WHERE `post_id` = %d", |
|
2123 | 2123 | array($updatingpost, $temppost) |
2124 | 2124 | ) |
2125 | 2125 | ); |
2126 | 2126 | |
2127 | 2127 | $wpdb->query( |
2128 | 2128 | $wpdb->prepare( |
2129 | - "UPDATE " . GEODIR_ICON_TABLE . " SET `post_id` = %d WHERE `post_id` = %d", |
|
2129 | + "UPDATE ".GEODIR_ICON_TABLE." SET `post_id` = %d WHERE `post_id` = %d", |
|
2130 | 2130 | array($updatingpost, $temppost) |
2131 | 2131 | ) |
2132 | 2132 | ); |
@@ -2135,7 +2135,7 @@ discard block |
||
2135 | 2135 | |
2136 | 2136 | $wpdb->query( |
2137 | 2137 | $wpdb->prepare( |
2138 | - "UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET `post_id` = %d WHERE `post_id` = %d", |
|
2138 | + "UPDATE ".GEODIR_ATTACHMENT_TABLE." SET `post_id` = %d WHERE `post_id` = %d", |
|
2139 | 2139 | array($updatingpost, $temppost) |
2140 | 2140 | ) |
2141 | 2141 | ); |
@@ -2173,12 +2173,12 @@ discard block |
||
2173 | 2173 | if (!in_array($post_type, $all_postypes)) |
2174 | 2174 | return false; |
2175 | 2175 | |
2176 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
2176 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
2177 | 2177 | |
2178 | 2178 | /* Delete custom post meta*/ |
2179 | 2179 | $wpdb->query( |
2180 | 2180 | $wpdb->prepare( |
2181 | - "DELETE FROM " . $table . " WHERE `post_id` = %d", |
|
2181 | + "DELETE FROM ".$table." WHERE `post_id` = %d", |
|
2182 | 2182 | array($deleted_postid) |
2183 | 2183 | ) |
2184 | 2184 | ); |
@@ -2187,7 +2187,7 @@ discard block |
||
2187 | 2187 | |
2188 | 2188 | $wpdb->query( |
2189 | 2189 | $wpdb->prepare( |
2190 | - "DELETE FROM " . GEODIR_ICON_TABLE . " WHERE `post_id` = %d", |
|
2190 | + "DELETE FROM ".GEODIR_ICON_TABLE." WHERE `post_id` = %d", |
|
2191 | 2191 | array($deleted_postid) |
2192 | 2192 | ) |
2193 | 2193 | ); |
@@ -2197,7 +2197,7 @@ discard block |
||
2197 | 2197 | |
2198 | 2198 | $wpdb->query( |
2199 | 2199 | $wpdb->prepare( |
2200 | - "DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE `post_id` = %d", |
|
2200 | + "DELETE FROM ".GEODIR_ATTACHMENT_TABLE." WHERE `post_id` = %d", |
|
2201 | 2201 | array($deleted_postid) |
2202 | 2202 | ) |
2203 | 2203 | ); |
@@ -2269,7 +2269,7 @@ discard block |
||
2269 | 2269 | */ |
2270 | 2270 | do_action('geodir_before_add_from_favorite', $post_id); |
2271 | 2271 | |
2272 | - echo '<a href="javascript:void(0);" title="' . $remove_favourite_text . '" class="geodir-addtofav geodir-removetofav-icon" onclick="javascript:addToFavourite(\'' . $post_id . '\',\'remove\');"><i class="'. $favourite_icon .'"></i> ' . $unfavourite_text . '</a>'; |
|
2272 | + echo '<a href="javascript:void(0);" title="'.$remove_favourite_text.'" class="geodir-addtofav geodir-removetofav-icon" onclick="javascript:addToFavourite(\''.$post_id.'\',\'remove\');"><i class="'.$favourite_icon.'"></i> '.$unfavourite_text.'</a>'; |
|
2273 | 2273 | |
2274 | 2274 | /** |
2275 | 2275 | * Called after adding the post from favourites. |
@@ -2348,7 +2348,7 @@ discard block |
||
2348 | 2348 | */ |
2349 | 2349 | do_action('geodir_before_remove_from_favorite', $post_id); |
2350 | 2350 | |
2351 | - echo '<a href="javascript:void(0);" title="' . $add_favourite_text . '" class="geodir-addtofav geodir-addtofav-icon" onclick="javascript:addToFavourite(\'' . $post_id . '\',\'add\');"><i class="'. $favourite_icon .'"></i> ' . $favourite_text . '</a>'; |
|
2351 | + echo '<a href="javascript:void(0);" title="'.$add_favourite_text.'" class="geodir-addtofav geodir-addtofav-icon" onclick="javascript:addToFavourite(\''.$post_id.'\',\'add\');"><i class="'.$favourite_icon.'"></i> '.$favourite_text.'</a>'; |
|
2352 | 2352 | |
2353 | 2353 | /** |
2354 | 2354 | * Called after removing the post from favourites. |
@@ -2443,24 +2443,24 @@ discard block |
||
2443 | 2443 | $user_meta_data = get_user_meta($current_user->data->ID, 'gd_user_favourite_post', true); |
2444 | 2444 | |
2445 | 2445 | if (!empty($user_meta_data) && in_array($post_id, $user_meta_data)) { |
2446 | - ?><span class="geodir-addtofav favorite_property_<?php echo $post_id;?>" ><a |
|
2446 | + ?><span class="geodir-addtofav favorite_property_<?php echo $post_id; ?>" ><a |
|
2447 | 2447 | class="geodir-removetofav-icon" href="javascript:void(0);" |
2448 | - onclick="javascript:addToFavourite(<?php echo $post_id;?>,'remove');" |
|
2449 | - title="<?php echo $remove_favourite_text;?>"><i class="<?php echo $unfavourite_icon; ?>"></i> <?php echo $unfavourite_text;?> |
|
2448 | + onclick="javascript:addToFavourite(<?php echo $post_id; ?>,'remove');" |
|
2449 | + title="<?php echo $remove_favourite_text; ?>"><i class="<?php echo $unfavourite_icon; ?>"></i> <?php echo $unfavourite_text; ?> |
|
2450 | 2450 | </a> </span><?php |
2451 | 2451 | |
2452 | 2452 | } else { |
2453 | 2453 | |
2454 | 2454 | if (!isset($current_user->data->ID) || $current_user->data->ID == '') { |
2455 | - $script_text = 'javascript:window.location.href=\'' . geodir_login_url() . '\''; |
|
2455 | + $script_text = 'javascript:window.location.href=\''.geodir_login_url().'\''; |
|
2456 | 2456 | } else |
2457 | - $script_text = 'javascript:addToFavourite(' . $post_id . ',\'add\')'; |
|
2457 | + $script_text = 'javascript:addToFavourite('.$post_id.',\'add\')'; |
|
2458 | 2458 | |
2459 | - ?><span class="geodir-addtofav favorite_property_<?php echo $post_id;?>"><a class="geodir-addtofav-icon" |
|
2459 | + ?><span class="geodir-addtofav favorite_property_<?php echo $post_id; ?>"><a class="geodir-addtofav-icon" |
|
2460 | 2460 | href="javascript:void(0);" |
2461 | - onclick="<?php echo $script_text;?>" |
|
2462 | - title="<?php echo $add_favourite_text;?>"><i |
|
2463 | - class="<?php echo $favourite_icon; ?>"></i> <?php echo $favourite_text;?></a></span> |
|
2461 | + onclick="<?php echo $script_text; ?>" |
|
2462 | + title="<?php echo $add_favourite_text; ?>"><i |
|
2463 | + class="<?php echo $favourite_icon; ?>"></i> <?php echo $favourite_text; ?></a></span> |
|
2464 | 2464 | <?php } |
2465 | 2465 | } |
2466 | 2466 | } |
@@ -2490,7 +2490,7 @@ discard block |
||
2490 | 2490 | |
2491 | 2491 | $post_type = $taxonomy_obj->object_type[0]; |
2492 | 2492 | |
2493 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
2493 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
2494 | 2494 | |
2495 | 2495 | /** |
2496 | 2496 | * Filter to modify the 'join' query |
@@ -2513,8 +2513,8 @@ discard block |
||
2513 | 2513 | $where = apply_filters('geodir_cat_post_count_where', $where, $term); |
2514 | 2514 | |
2515 | 2515 | $count_query = "SELECT count(post_id) FROM |
2516 | - " . $table . " as pd " . $join . " |
|
2517 | - WHERE pd.post_status='publish' AND FIND_IN_SET('" . $term->term_id . "'," . $term->taxonomy . ") " . $where; |
|
2516 | + " . $table." as pd ".$join." |
|
2517 | + WHERE pd.post_status='publish' AND FIND_IN_SET('" . $term->term_id."',".$term->taxonomy.") ".$where; |
|
2518 | 2518 | |
2519 | 2519 | $cat_post_count = $wpdb->get_var($count_query); |
2520 | 2520 | if (empty($cat_post_count) || is_wp_error($cat_post_count)) |
@@ -2597,7 +2597,7 @@ discard block |
||
2597 | 2597 | global $post; |
2598 | 2598 | $all_postypes = geodir_get_posttypes(); |
2599 | 2599 | if (is_array($all_postypes) && in_array($post->post_type, $all_postypes)) { |
2600 | - return ' <a href="' . get_permalink($post->ID) . '">' . READ_MORE_TXT . '</a>'; |
|
2600 | + return ' <a href="'.get_permalink($post->ID).'">'.READ_MORE_TXT.'</a>'; |
|
2601 | 2601 | } |
2602 | 2602 | |
2603 | 2603 | return $more; |
@@ -2624,14 +2624,14 @@ discard block |
||
2624 | 2624 | if (is_array($gd_taxonomies) && in_array($taxonomy, $gd_taxonomies)) { |
2625 | 2625 | |
2626 | 2626 | $geodir_post_type = geodir_get_taxonomy_posttype($taxonomy); |
2627 | - $table = $plugin_prefix . $geodir_post_type . '_detail'; |
|
2627 | + $table = $plugin_prefix.$geodir_post_type.'_detail'; |
|
2628 | 2628 | |
2629 | 2629 | $path_parts = pathinfo($_REQUEST['ct_cat_icon']['src']); |
2630 | - $term_icon = $path_parts['dirname'] . '/cat_icon_' . $term_id . '.png'; |
|
2630 | + $term_icon = $path_parts['dirname'].'/cat_icon_'.$term_id.'.png'; |
|
2631 | 2631 | |
2632 | 2632 | $posts = $wpdb->get_results( |
2633 | 2633 | $wpdb->prepare( |
2634 | - "SELECT post_id,post_title,post_latitude,post_longitude,default_category FROM " . $table . " WHERE FIND_IN_SET(%s,%1\$s ) ", |
|
2634 | + "SELECT post_id,post_title,post_latitude,post_longitude,default_category FROM ".$table." WHERE FIND_IN_SET(%s,%1\$s ) ", |
|
2635 | 2635 | array($term_id, $taxonomy) |
2636 | 2636 | ) |
2637 | 2637 | ); |
@@ -2643,19 +2643,19 @@ discard block |
||
2643 | 2643 | $lng = $post_obj->post_longitude; |
2644 | 2644 | |
2645 | 2645 | $json = '{'; |
2646 | - $json .= '"id":"' . $post_obj->post_id . '",'; |
|
2647 | - $json .= '"lat_pos": "' . $lat . '",'; |
|
2648 | - $json .= '"long_pos": "' . $lng . '",'; |
|
2649 | - $json .= '"marker_id":"' . $post_obj->post_id . '_' . $term_id . '",'; |
|
2650 | - $json .= '"icon":"' . $term_icon . '",'; |
|
2651 | - $json .= '"group":"catgroup' . $term_id . '"'; |
|
2646 | + $json .= '"id":"'.$post_obj->post_id.'",'; |
|
2647 | + $json .= '"lat_pos": "'.$lat.'",'; |
|
2648 | + $json .= '"long_pos": "'.$lng.'",'; |
|
2649 | + $json .= '"marker_id":"'.$post_obj->post_id.'_'.$term_id.'",'; |
|
2650 | + $json .= '"icon":"'.$term_icon.'",'; |
|
2651 | + $json .= '"group":"catgroup'.$term_id.'"'; |
|
2652 | 2652 | $json .= '}'; |
2653 | 2653 | |
2654 | 2654 | if ($post_obj->default_category == $term_id) { |
2655 | 2655 | |
2656 | 2656 | $wpdb->query( |
2657 | 2657 | $wpdb->prepare( |
2658 | - "UPDATE " . $table . " SET marker_json = %s where post_id = %d", |
|
2658 | + "UPDATE ".$table." SET marker_json = %s where post_id = %d", |
|
2659 | 2659 | array($json, $post_obj->post_id) |
2660 | 2660 | ) |
2661 | 2661 | ); |
@@ -2663,7 +2663,7 @@ discard block |
||
2663 | 2663 | |
2664 | 2664 | $wpdb->query( |
2665 | 2665 | $wpdb->prepare( |
2666 | - "UPDATE " . GEODIR_ICON_TABLE . " SET json = %s WHERE post_id = %d AND cat_id = %d", |
|
2666 | + "UPDATE ".GEODIR_ICON_TABLE." SET json = %s WHERE post_id = %d AND cat_id = %d", |
|
2667 | 2667 | array($json, $post_obj->post_id, $term_id) |
2668 | 2668 | ) |
2669 | 2669 | ); |
@@ -2787,7 +2787,7 @@ discard block |
||
2787 | 2787 | // print_r($uploads ) ; |
2788 | 2788 | $post_first_image = $wpdb->get_results( |
2789 | 2789 | $wpdb->prepare( |
2790 | - "SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id = %d and menu_order = 1 ", array($post_id) |
|
2790 | + "SELECT * FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id = %d and menu_order = 1 ", array($post_id) |
|
2791 | 2791 | ) |
2792 | 2792 | ); |
2793 | 2793 | |
@@ -2808,9 +2808,9 @@ discard block |
||
2808 | 2808 | |
2809 | 2809 | $post_type = get_post_type($post_id); |
2810 | 2810 | |
2811 | - $table_name = $plugin_prefix . $post_type . '_detail'; |
|
2811 | + $table_name = $plugin_prefix.$post_type.'_detail'; |
|
2812 | 2812 | |
2813 | - $wpdb->query("UPDATE " . $table_name . " SET featured_image='" . $post_first_image[0]->file . "' WHERE post_id =" . $post_id); |
|
2813 | + $wpdb->query("UPDATE ".$table_name." SET featured_image='".$post_first_image[0]->file."' WHERE post_id =".$post_id); |
|
2814 | 2814 | |
2815 | 2815 | $new_attachment_name = basename($post_first_image[0]->file); |
2816 | 2816 | |
@@ -2823,11 +2823,11 @@ discard block |
||
2823 | 2823 | wp_delete_attachment($post_thumbnail_id); |
2824 | 2824 | |
2825 | 2825 | } |
2826 | - $filename = $uploads['basedir'] . $post_first_image[0]->file; |
|
2826 | + $filename = $uploads['basedir'].$post_first_image[0]->file; |
|
2827 | 2827 | |
2828 | 2828 | $attachment = array( |
2829 | 2829 | 'post_mime_type' => $post_first_image[0]->mime_type, |
2830 | - 'guid' => $uploads['baseurl'] . $post_first_image[0]->file, |
|
2830 | + 'guid' => $uploads['baseurl'].$post_first_image[0]->file, |
|
2831 | 2831 | 'post_parent' => $post_id, |
2832 | 2832 | 'post_title' => preg_replace('/\.[^.]+$/', '', $post_first_image[0]->title), |
2833 | 2833 | 'post_content' => '' |
@@ -2840,7 +2840,7 @@ discard block |
||
2840 | 2840 | |
2841 | 2841 | set_post_thumbnail($post_id, $id); |
2842 | 2842 | |
2843 | - require_once(ABSPATH . 'wp-admin/includes/image.php'); |
|
2843 | + require_once(ABSPATH.'wp-admin/includes/image.php'); |
|
2844 | 2844 | wp_update_attachment_metadata($id, wp_generate_attachment_metadata($id, $filename)); |
2845 | 2845 | |
2846 | 2846 | } |
@@ -2873,35 +2873,35 @@ discard block |
||
2873 | 2873 | $post_id = absint($_POST['post_id']); |
2874 | 2874 | $upload_dir = wp_upload_dir(); |
2875 | 2875 | $post_type = get_post_type($_POST['post_id']); |
2876 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
2876 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
2877 | 2877 | |
2878 | 2878 | $post_arr = $wpdb->get_results($wpdb->prepare( |
2879 | - "SELECT * FROM $wpdb->posts p JOIN " . $table . " gd ON gd.post_id=p.ID WHERE p.ID=%d LIMIT 1", |
|
2879 | + "SELECT * FROM $wpdb->posts p JOIN ".$table." gd ON gd.post_id=p.ID WHERE p.ID=%d LIMIT 1", |
|
2880 | 2880 | array($post_id) |
2881 | 2881 | ) |
2882 | 2882 | , ARRAY_A); |
2883 | 2883 | |
2884 | 2884 | $arrImages = $wpdb->get_results( |
2885 | 2885 | $wpdb->prepare( |
2886 | - "SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE mime_type like %s AND post_id = %d ORDER BY menu_order ASC, ID DESC ", |
|
2886 | + "SELECT * FROM ".GEODIR_ATTACHMENT_TABLE." WHERE mime_type like %s AND post_id = %d ORDER BY menu_order ASC, ID DESC ", |
|
2887 | 2887 | array('%image%', $post_id) |
2888 | 2888 | ) |
2889 | 2889 | ); |
2890 | 2890 | if ($arrImages) { |
2891 | 2891 | $image_arr = array(); |
2892 | 2892 | foreach ($arrImages as $img) { |
2893 | - $image_arr[] = $upload_dir['baseurl'] . $img->file; |
|
2893 | + $image_arr[] = $upload_dir['baseurl'].$img->file; |
|
2894 | 2894 | } |
2895 | 2895 | $comma_separated = implode(",", $image_arr); |
2896 | 2896 | $post_arr[0]['post_images'] = $comma_separated; |
2897 | 2897 | } |
2898 | 2898 | |
2899 | 2899 | |
2900 | - $cats = $post_arr[0][$post_arr[0]['post_type'] . 'category']; |
|
2900 | + $cats = $post_arr[0][$post_arr[0]['post_type'].'category']; |
|
2901 | 2901 | $cat_arr = array_filter(explode(",", $cats)); |
2902 | 2902 | $trans_cat = array(); |
2903 | 2903 | foreach ($cat_arr as $cat) { |
2904 | - $trans_cat[] = icl_object_id($cat, $post_arr[0]['post_type'] . 'category', false); |
|
2904 | + $trans_cat[] = icl_object_id($cat, $post_arr[0]['post_type'].'category', false); |
|
2905 | 2905 | } |
2906 | 2906 | |
2907 | 2907 | |
@@ -2943,7 +2943,7 @@ discard block |
||
2943 | 2943 | |
2944 | 2944 | $get_data = $wpdb->get_results( |
2945 | 2945 | $wpdb->prepare( |
2946 | - "SELECT htmlvar_name, field_type, extra_fields FROM " . GEODIR_CUSTOM_FIELDS_TABLE . " WHERE post_type=%s AND is_active='1'", |
|
2946 | + "SELECT htmlvar_name, field_type, extra_fields FROM ".GEODIR_CUSTOM_FIELDS_TABLE." WHERE post_type=%s AND is_active='1'", |
|
2947 | 2947 | array($listing_type) |
2948 | 2948 | ) |
2949 | 2949 | ); |
@@ -2956,12 +2956,12 @@ discard block |
||
2956 | 2956 | |
2957 | 2957 | $extra_fields = unserialize($data->extra_fields); |
2958 | 2958 | |
2959 | - $prefix = $data->htmlvar_name . '_'; |
|
2959 | + $prefix = $data->htmlvar_name.'_'; |
|
2960 | 2960 | |
2961 | - $fields_info[$prefix . 'address'] = $data->field_type; |
|
2961 | + $fields_info[$prefix.'address'] = $data->field_type; |
|
2962 | 2962 | |
2963 | 2963 | if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) |
2964 | - $fields_info[$prefix . 'zip'] = $data->field_type; |
|
2964 | + $fields_info[$prefix.'zip'] = $data->field_type; |
|
2965 | 2965 | |
2966 | 2966 | } else { |
2967 | 2967 | |
@@ -3059,13 +3059,13 @@ discard block |
||
3059 | 3059 | * @since 1.4.9 |
3060 | 3060 | * @package GeoDirectory |
3061 | 3061 | */ |
3062 | -function geodir_fb_like_thumbnail(){ |
|
3062 | +function geodir_fb_like_thumbnail() { |
|
3063 | 3063 | |
3064 | 3064 | // return if not a single post |
3065 | - if(!is_single()){return;} |
|
3065 | + if (!is_single()) {return; } |
|
3066 | 3066 | |
3067 | 3067 | global $post; |
3068 | - if(isset($post->featured_image) && $post->featured_image){ |
|
3068 | + if (isset($post->featured_image) && $post->featured_image) { |
|
3069 | 3069 | $upload_dir = wp_upload_dir(); |
3070 | 3070 | $thumb = $upload_dir['baseurl'].$post->featured_image; |
3071 | 3071 | echo "\n\n<!-- GD Facebook Like Thumbnail -->\n<link rel=\"image_src\" href=\"$thumb\" />\n<!-- End GD Facebook Like Thumbnail -->\n\n"; |
@@ -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#asyncload', array(), GEODIRECTORY_VERSION); |
|
47 | + wp_register_script('geodirectory-script', geodir_plugin_url().'/geodirectory-assets/js/geodirectory.min.js#asyncload', 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,23 +73,23 @@ 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(); |
|
92 | + $map_lang = "&language=".geodir_get_map_default_language(); |
|
93 | 93 | /** |
94 | 94 | * Filter the variables that are added to the end of the google maps script call. |
95 | 95 | * |
@@ -99,40 +99,40 @@ discard block |
||
99 | 99 | * @param string $var The string to filter, default is empty string. |
100 | 100 | */ |
101 | 101 | $map_extra = apply_filters('geodir_googlemap_script_extra', ''); |
102 | - wp_enqueue_script('geodirectory-googlemap-script', '//maps.google.com/maps/api/js?' . $map_lang . $map_extra, '', NULL); |
|
102 | + wp_enqueue_script('geodirectory-googlemap-script', '//maps.google.com/maps/api/js?'.$map_lang.$map_extra, '', NULL); |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | if ($geodir_map_name == 'osm') { |
106 | 106 | // Leaflet OpenStreetMap |
107 | - wp_register_style('geodirectory-leaflet-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION); |
|
107 | + wp_register_style('geodirectory-leaflet-style', geodir_plugin_url().'/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION); |
|
108 | 108 | wp_enqueue_style('geodirectory-leaflet-style'); |
109 | 109 | |
110 | - wp_register_script('geodirectory-leaflet-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION); |
|
110 | + wp_register_script('geodirectory-leaflet-script', geodir_plugin_url().'/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION); |
|
111 | 111 | wp_enqueue_script('geodirectory-leaflet-script'); |
112 | 112 | |
113 | - wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/osm.geocode.js', array(), GEODIRECTORY_VERSION); |
|
113 | + wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url().'/geodirectory-assets/leaflet/osm.geocode.js', array(), GEODIRECTORY_VERSION); |
|
114 | 114 | wp_enqueue_script('geodirectory-leaflet-geo-script'); |
115 | 115 | } |
116 | - wp_enqueue_script( 'jquery-ui-autocomplete' ); |
|
116 | + wp_enqueue_script('jquery-ui-autocomplete'); |
|
117 | 117 | |
118 | - wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION,true); |
|
118 | + wp_register_script('geodirectory-goMap-script', geodir_plugin_url().'/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION, true); |
|
119 | 119 | wp_enqueue_script('geodirectory-goMap-script'); |
120 | 120 | |
121 | 121 | |
122 | - wp_register_script('chosen', geodir_plugin_url() . '/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION); |
|
122 | + wp_register_script('chosen', geodir_plugin_url().'/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION); |
|
123 | 123 | wp_enqueue_script('chosen'); |
124 | 124 | |
125 | - wp_register_script('geodirectory-choose-ajax', geodir_plugin_url() . '/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION); |
|
125 | + wp_register_script('geodirectory-choose-ajax', geodir_plugin_url().'/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION); |
|
126 | 126 | wp_enqueue_script('geodirectory-choose-ajax'); |
127 | 127 | |
128 | - wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.ui.timepicker.min.js#asyncload', array('jquery-ui-datepicker', 'jquery-ui-slider', 'jquery-effects-core', 'jquery-effects-slide'), '', true); |
|
128 | + wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url().'/geodirectory-assets/js/jquery.ui.timepicker.min.js#asyncload', array('jquery-ui-datepicker', 'jquery-ui-slider', 'jquery-effects-core', 'jquery-effects-slide'), '', true); |
|
129 | 129 | |
130 | 130 | if (is_page() && geodir_is_page('add-listing')) { |
131 | 131 | // SCRIPT FOR UPLOAD |
132 | 132 | wp_enqueue_script('plupload-all'); |
133 | 133 | wp_enqueue_script('jquery-ui-sortable'); |
134 | 134 | |
135 | - wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION,true); |
|
135 | + wp_register_script('geodirectory-plupload-script', geodir_plugin_url().'/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION, true); |
|
136 | 136 | wp_enqueue_script('geodirectory-plupload-script'); |
137 | 137 | // SCRIPT FOR UPLOAD END |
138 | 138 | |
@@ -179,27 +179,27 @@ discard block |
||
179 | 179 | |
180 | 180 | wp_localize_script('geodirectory-plupload-script', 'gd_plupload', $gd_plupload_init); |
181 | 181 | |
182 | - wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url() . '/geodirectory-assets/js/listing_validation.min.js#asyncload'); |
|
182 | + wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url().'/geodirectory-assets/js/listing_validation.min.js#asyncload'); |
|
183 | 183 | } // End if for add place page |
184 | 184 | |
185 | - wp_register_script('geodirectory-post-custom-js', geodir_plugin_url() . '/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true); |
|
185 | + wp_register_script('geodirectory-post-custom-js', geodir_plugin_url().'/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true); |
|
186 | 186 | if ($is_detail_page) { |
187 | 187 | wp_enqueue_script('geodirectory-post-custom-js'); |
188 | 188 | } |
189 | 189 | |
190 | 190 | // font awesome rating script |
191 | 191 | if (get_option('geodir_reviewrating_enable_font_awesome')) { |
192 | - wp_register_script('geodir-barrating-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.barrating.min.js', array(), GEODIRECTORY_VERSION, true); |
|
192 | + wp_register_script('geodir-barrating-js', geodir_plugin_url().'/geodirectory-assets/js/jquery.barrating.min.js', array(), GEODIRECTORY_VERSION, true); |
|
193 | 193 | wp_enqueue_script('geodir-barrating-js'); |
194 | 194 | } else { // default rating script |
195 | - wp_register_script('geodir-jRating-js', geodir_plugin_url() . '/geodirectory-assets/js/jRating.jquery.min.js', array(), GEODIRECTORY_VERSION, true); |
|
195 | + wp_register_script('geodir-jRating-js', geodir_plugin_url().'/geodirectory-assets/js/jRating.jquery.min.js', array(), GEODIRECTORY_VERSION, true); |
|
196 | 196 | wp_enqueue_script('geodir-jRating-js'); |
197 | 197 | } |
198 | 198 | |
199 | - wp_register_script('geodir-on-document-load', geodir_plugin_url() . '/geodirectory-assets/js/on_document_load.js#asyncload', array(), GEODIRECTORY_VERSION, true); |
|
199 | + wp_register_script('geodir-on-document-load', geodir_plugin_url().'/geodirectory-assets/js/on_document_load.js#asyncload', array(), GEODIRECTORY_VERSION, true); |
|
200 | 200 | wp_enqueue_script('geodir-on-document-load'); |
201 | 201 | |
202 | - wp_register_script('google-geometa', geodir_plugin_url() . '/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true); |
|
202 | + wp_register_script('google-geometa', geodir_plugin_url().'/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true); |
|
203 | 203 | wp_enqueue_script('google-geometa'); |
204 | 204 | } |
205 | 205 | |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | */ |
215 | 215 | function geodir_header_scripts() |
216 | 216 | { |
217 | - echo '<style>' . stripslashes(get_option('geodir_coustem_css')) . '</style>'; |
|
217 | + echo '<style>'.stripslashes(get_option('geodir_coustem_css')).'</style>'; |
|
218 | 218 | echo stripslashes(get_option('geodir_header_scripts')); |
219 | 219 | } |
220 | 220 | |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | */ |
246 | 246 | function geodir_add_async_forscript($url) |
247 | 247 | { |
248 | - if (strpos($url, '#asyncload')===false) |
|
248 | + if (strpos($url, '#asyncload') === false) |
|
249 | 249 | return $url; |
250 | 250 | else if (is_admin()) |
251 | 251 | return str_replace('#asyncload', '', $url); |
@@ -264,50 +264,50 @@ discard block |
||
264 | 264 | { |
265 | 265 | |
266 | 266 | |
267 | - if(get_option('geodir_scss_core')) { |
|
267 | + if (get_option('geodir_scss_core')) { |
|
268 | 268 | |
269 | 269 | |
270 | - wp_register_style('geodirectory-frontend-style', geodir_plugin_url() . '/geodirectory-assets/css/style.css', array(), GEODIRECTORY_VERSION); |
|
270 | + wp_register_style('geodirectory-frontend-style', geodir_plugin_url().'/geodirectory-assets/css/style.css', array(), GEODIRECTORY_VERSION); |
|
271 | 271 | wp_enqueue_style('geodirectory-frontend-style'); |
272 | 272 | |
273 | - wp_register_style('geodirectory-media-style', geodir_plugin_url() . '/geodirectory-assets/css/media.css', array(), GEODIRECTORY_VERSION); |
|
273 | + wp_register_style('geodirectory-media-style', geodir_plugin_url().'/geodirectory-assets/css/media.css', array(), GEODIRECTORY_VERSION); |
|
274 | 274 | wp_enqueue_style('geodirectory-media-style'); |
275 | 275 | |
276 | 276 | |
277 | - wp_register_style('geodirectory-jquery-ui-css', geodir_plugin_url() . '/geodirectory-assets/css/jquery-ui.css', array(), GEODIRECTORY_VERSION); |
|
277 | + wp_register_style('geodirectory-jquery-ui-css', geodir_plugin_url().'/geodirectory-assets/css/jquery-ui.css', array(), GEODIRECTORY_VERSION); |
|
278 | 278 | wp_enqueue_style('geodirectory-jquery-ui-css'); |
279 | 279 | |
280 | - wp_register_style('geodirectory-jquery-ui-timepicker-css', geodir_plugin_url() . '/geodirectory-assets/css/jquery.ui.timepicker.css', array(), GEODIRECTORY_VERSION); |
|
280 | + wp_register_style('geodirectory-jquery-ui-timepicker-css', geodir_plugin_url().'/geodirectory-assets/css/jquery.ui.timepicker.css', array(), GEODIRECTORY_VERSION); |
|
281 | 281 | wp_enqueue_style('geodirectory-jquery-ui-timepicker-css'); |
282 | 282 | |
283 | - wp_register_style('geodirectory-flexslider-css', geodir_plugin_url() . '/geodirectory-assets/css/flexslider.css', array(), GEODIRECTORY_VERSION); |
|
283 | + wp_register_style('geodirectory-flexslider-css', geodir_plugin_url().'/geodirectory-assets/css/flexslider.css', array(), GEODIRECTORY_VERSION); |
|
284 | 284 | wp_enqueue_style('geodirectory-flexslider-css'); |
285 | 285 | |
286 | - wp_register_style('geodirectory-thic-box-css', geodir_plugin_url() . '/geodirectory-assets/css/thic-box.css', array(), GEODIRECTORY_VERSION); |
|
286 | + wp_register_style('geodirectory-thic-box-css', geodir_plugin_url().'/geodirectory-assets/css/thic-box.css', array(), GEODIRECTORY_VERSION); |
|
287 | 287 | wp_enqueue_style('geodirectory-thic-box-css'); |
288 | 288 | |
289 | - wp_register_style('geodirectory-pluplodar-css', geodir_plugin_url() . '/geodirectory-assets/css/pluploader.css', array(), GEODIRECTORY_VERSION); |
|
289 | + wp_register_style('geodirectory-pluplodar-css', geodir_plugin_url().'/geodirectory-assets/css/pluploader.css', array(), GEODIRECTORY_VERSION); |
|
290 | 290 | wp_enqueue_style('geodirectory-pluplodar-css'); |
291 | 291 | |
292 | - wp_register_style('geodirectory-lightbox-css', geodir_plugin_url() . '/geodirectory-assets/css/jquery.lightbox-0.5.css', array(), GEODIRECTORY_VERSION); |
|
292 | + wp_register_style('geodirectory-lightbox-css', geodir_plugin_url().'/geodirectory-assets/css/jquery.lightbox-0.5.css', array(), GEODIRECTORY_VERSION); |
|
293 | 293 | wp_enqueue_style('geodirectory-lightbox-css'); |
294 | 294 | |
295 | - wp_register_style('geodir-rating-style', geodir_plugin_url() . '/geodirectory-assets/css/jRating.jquery.css', array(), GEODIRECTORY_VERSION); |
|
295 | + wp_register_style('geodir-rating-style', geodir_plugin_url().'/geodirectory-assets/css/jRating.jquery.css', array(), GEODIRECTORY_VERSION); |
|
296 | 296 | wp_enqueue_style('geodir-rating-style'); |
297 | 297 | |
298 | - wp_register_style('geodir-chosen-style', geodir_plugin_url() . '/geodirectory-assets/css/chosen.css', array(), GEODIRECTORY_VERSION); |
|
298 | + wp_register_style('geodir-chosen-style', geodir_plugin_url().'/geodirectory-assets/css/chosen.css', array(), GEODIRECTORY_VERSION); |
|
299 | 299 | wp_enqueue_style('geodir-chosen-style'); |
300 | 300 | |
301 | - }else{ |
|
302 | - wp_register_style('geodir-core-scss', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION); |
|
301 | + } else { |
|
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 | 304 | |
305 | - wp_register_style('geodir-core-scss-footer', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend_footer.css', array(), GEODIRECTORY_VERSION); |
|
305 | + wp_register_style('geodir-core-scss-footer', geodir_plugin_url().'/geodirectory-assets/css/gd_core_frontend_footer.css', array(), GEODIRECTORY_VERSION); |
|
306 | 306 | |
307 | 307 | } |
308 | 308 | |
309 | - if(is_rtl()){ |
|
310 | - wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url() . '/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION); |
|
309 | + if (is_rtl()) { |
|
310 | + wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url().'/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION); |
|
311 | 311 | wp_enqueue_style('geodirectory-frontend-rtl-style'); |
312 | 312 | } |
313 | 313 | |
@@ -381,18 +381,18 @@ discard block |
||
381 | 381 | $term_id = get_queried_object_id(); |
382 | 382 | $taxonomy = get_query_var('taxonomy'); |
383 | 383 | |
384 | - if ($term_id && $post_type && get_query_var('taxonomy') == $post_type . 'category' ) { |
|
385 | - $term = get_term($term_id, $post_type . 'category'); |
|
384 | + if ($term_id && $post_type && get_query_var('taxonomy') == $post_type.'category') { |
|
385 | + $term = get_term($term_id, $post_type.'category'); |
|
386 | 386 | } |
387 | 387 | } |
388 | 388 | |
389 | - if (geodir_is_page('search') && !empty($_REQUEST['s' . $post_type . 'category'])) { |
|
390 | - $taxonomy_search = $_REQUEST['s' . $post_type . 'category']; |
|
389 | + if (geodir_is_page('search') && !empty($_REQUEST['s'.$post_type.'category'])) { |
|
390 | + $taxonomy_search = $_REQUEST['s'.$post_type.'category']; |
|
391 | 391 | |
392 | 392 | if (!is_array($taxonomy_search)) { |
393 | - $term = get_term((int)$taxonomy_search, $post_type . 'category'); |
|
394 | - } else if(is_array($taxonomy_search) && count($taxonomy_search) == 1) { // single category search |
|
395 | - $term = get_term((int)$taxonomy_search[0], $post_type . 'category'); |
|
393 | + $term = get_term((int) $taxonomy_search, $post_type.'category'); |
|
394 | + } else if (is_array($taxonomy_search) && count($taxonomy_search) == 1) { // single category search |
|
395 | + $term = get_term((int) $taxonomy_search[0], $post_type.'category'); |
|
396 | 396 | } |
397 | 397 | } |
398 | 398 | |
@@ -404,7 +404,7 @@ discard block |
||
404 | 404 | if ($max_page > 1 || $always_show) { |
405 | 405 | // Extra pagination info |
406 | 406 | $geodir_pagination_more_info = get_option('geodir_pagination_advance_info'); |
407 | - $start_no = ( $paged - 1 ) * $posts_per_page + 1; |
|
407 | + $start_no = ($paged - 1) * $posts_per_page + 1; |
|
408 | 408 | $end_no = min($paged * $posts_per_page, $numposts); |
409 | 409 | |
410 | 410 | if ($geodir_pagination_more_info != '') { |
@@ -414,7 +414,7 @@ discard block |
||
414 | 414 | } else { |
415 | 415 | $pegination_desc = wp_sprintf(__('Showing listings %d-%d of %d', 'geodirectory'), $start_no, $end_no, $numposts); |
416 | 416 | } |
417 | - $pagination_info = '<div class="gd-pagination-details">' . $pegination_desc . '</div>'; |
|
417 | + $pagination_info = '<div class="gd-pagination-details">'.$pegination_desc.'</div>'; |
|
418 | 418 | /** |
419 | 419 | * Adds an extra pagination info above/under pagination. |
420 | 420 | * |
@@ -430,15 +430,15 @@ discard block |
||
430 | 430 | $pagination_info = apply_filters('geodir_pagination_advance_info', $pagination_info, $listing_type_name, $start_no, $end_no, $numposts, $post_type); |
431 | 431 | |
432 | 432 | if ($geodir_pagination_more_info == 'before') { |
433 | - $before = $before . $pagination_info; |
|
433 | + $before = $before.$pagination_info; |
|
434 | 434 | } else if ($geodir_pagination_more_info == 'after') { |
435 | - $after = $pagination_info . $after; |
|
435 | + $after = $pagination_info.$after; |
|
436 | 436 | } |
437 | 437 | } |
438 | 438 | |
439 | 439 | echo "$before <div class='Navi gd-navi'>"; |
440 | 440 | if ($paged >= ($pages_to_show - 1)) { |
441 | - echo '<a href="' . str_replace('&paged', '&paged', get_pagenum_link()) . '">«</a>'; |
|
441 | + echo '<a href="'.str_replace('&paged', '&paged', get_pagenum_link()).'">«</a>'; |
|
442 | 442 | } |
443 | 443 | previous_posts_link($prelabel); |
444 | 444 | for ($i = $paged - $half_pages_to_show; $i <= $paged + $half_pages_to_show; $i++) { |
@@ -446,13 +446,13 @@ discard block |
||
446 | 446 | if ($i == $paged) { |
447 | 447 | echo "<strong class='on'>$i</strong>"; |
448 | 448 | } else { |
449 | - echo ' <a href="' . str_replace('&paged', '&paged', get_pagenum_link($i)) . '">' . $i . '</a> '; |
|
449 | + echo ' <a href="'.str_replace('&paged', '&paged', get_pagenum_link($i)).'">'.$i.'</a> '; |
|
450 | 450 | } |
451 | 451 | } |
452 | 452 | } |
453 | 453 | next_posts_link($nxtlabel, $max_page); |
454 | 454 | if (($paged + $half_pages_to_show) < ($max_page)) { |
455 | - echo '<a href="' . str_replace('&paged', '&paged', get_pagenum_link($max_page)) . '">»</a>'; |
|
455 | + echo '<a href="'.str_replace('&paged', '&paged', get_pagenum_link($max_page)).'">»</a>'; |
|
456 | 456 | } |
457 | 457 | echo "</div> $after"; |
458 | 458 | } |
@@ -490,7 +490,7 @@ discard block |
||
490 | 490 | jQuery(function ($) { |
491 | 491 | $("#distance_slider").slider({ |
492 | 492 | range: true, |
493 | - values: [0, <?php echo ($_REQUEST['sdist']!='') ? sanitize_text_field($_REQUEST['sdist']) : "0"; ?>], |
|
493 | + values: [0, <?php echo ($_REQUEST['sdist'] != '') ? sanitize_text_field($_REQUEST['sdist']) : "0"; ?>], |
|
494 | 494 | min: 0, |
495 | 495 | max: <?php echo $dist; ?>, |
496 | 496 | step: <?php echo $dist_dif; ?>, |
@@ -555,7 +555,7 @@ discard block |
||
555 | 555 | |
556 | 556 | |
557 | 557 | <script type="text/javascript"> |
558 | - var default_location = '<?php if($search_location = geodir_get_default_location()) echo $search_location->city ;?>'; |
|
558 | + var default_location = '<?php if ($search_location = geodir_get_default_location()) echo $search_location->city; ?>'; |
|
559 | 559 | var latlng; |
560 | 560 | var address; |
561 | 561 | 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(''); |
@@ -601,7 +601,7 @@ discard block |
||
601 | 601 | }); |
602 | 602 | |
603 | 603 | function geodir_setsearch($form) { |
604 | - 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 | + 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); |
|
605 | 605 | geocodeAddress($form); |
606 | 606 | } |
607 | 607 | |
@@ -620,15 +620,15 @@ discard block |
||
620 | 620 | // Call the geocode function |
621 | 621 | Sgeocoder = window.gdMaps == 'google' ? new google.maps.Geocoder() : null; |
622 | 622 | |
623 | - if (jQuery('.snear', $form).val() == '' || ( jQuery('.sgeo_lat').val() != '' && jQuery('.sgeo_lon').val() != '' ) || jQuery('.snear', $form).val().match("^<?php _e('In:','geodirectory');?>")) { |
|
624 | - if (jQuery('.snear', $form).val().match("^<?php _e('In:','geodirectory');?>")) { |
|
623 | + if (jQuery('.snear', $form).val() == '' || ( jQuery('.sgeo_lat').val() != '' && jQuery('.sgeo_lon').val() != '' ) || jQuery('.snear', $form).val().match("^<?php _e('In:', 'geodirectory'); ?>")) { |
|
624 | + if (jQuery('.snear', $form).val().match("^<?php _e('In:', 'geodirectory'); ?>")) { |
|
625 | 625 | jQuery(".snear", $form).val(''); |
626 | 626 | } |
627 | 627 | jQuery($form).submit(); |
628 | 628 | } else { |
629 | 629 | var address = jQuery(".snear", $form).val(); |
630 | 630 | |
631 | - if (jQuery('.snear', $form).val() == '<?php echo $default_near_text;?>') { |
|
631 | + if (jQuery('.snear', $form).val() == '<?php echo $default_near_text; ?>') { |
|
632 | 632 | initialise2(); |
633 | 633 | } else { |
634 | 634 | <?php |
@@ -641,12 +641,12 @@ discard block |
||
641 | 641 | $near_add2 = apply_filters('geodir_search_near_addition', ''); |
642 | 642 | ?> |
643 | 643 | if (window.gdMaps === 'google') { |
644 | - Sgeocoder.geocode({'address': address<?php echo ($near_add ? '+", ' . $near_add . '"' : '') . $near_add2;?>}, |
|
644 | + Sgeocoder.geocode({'address': address<?php echo ($near_add ? '+", '.$near_add.'"' : '').$near_add2; ?>}, |
|
645 | 645 | function (results, status) { |
646 | 646 | if (status == google.maps.GeocoderStatus.OK) { |
647 | 647 | updateSearchPosition(results[0].geometry.location, $form); |
648 | 648 | } else { |
649 | - alert("<?php esc_attr_e('Search was not successful for the following reason:', 'geodirectory');?>" + status); |
|
649 | + alert("<?php esc_attr_e('Search was not successful for the following reason:', 'geodirectory'); ?>" + status); |
|
650 | 650 | } |
651 | 651 | }); |
652 | 652 | } else if (window.gdMaps === 'osm') { |
@@ -655,7 +655,7 @@ discard block |
||
655 | 655 | if (typeof geo !== 'undefined' && geo.lat && geo.lon) { |
656 | 656 | updateSearchPosition(geo, $form); |
657 | 657 | } else { |
658 | - alert("<?php esc_attr_e('Search was not successful for the requested address.', 'geodirectory');?>"); |
|
658 | + alert("<?php esc_attr_e('Search was not successful for the requested address.', 'geodirectory'); ?>"); |
|
659 | 659 | } |
660 | 660 | }); |
661 | 661 | } else { |
@@ -701,19 +701,19 @@ discard block |
||
701 | 701 | var msg; |
702 | 702 | switch (err.code) { |
703 | 703 | case err.UNKNOWN_ERROR: |
704 | - msg = "<?php _e('Unable to find your location','geodirectory');?>"; |
|
704 | + msg = "<?php _e('Unable to find your location', 'geodirectory'); ?>"; |
|
705 | 705 | break; |
706 | 706 | case err.PERMISSION_DENINED: |
707 | - msg = "<?php _e('Permission denied in finding your location','geodirectory');?>"; |
|
707 | + msg = "<?php _e('Permission denied in finding your location', 'geodirectory'); ?>"; |
|
708 | 708 | break; |
709 | 709 | case err.POSITION_UNAVAILABLE: |
710 | - msg = "<?php _e('Your location is currently unknown','geodirectory');?>"; |
|
710 | + msg = "<?php _e('Your location is currently unknown', 'geodirectory'); ?>"; |
|
711 | 711 | break; |
712 | 712 | case err.BREAK: |
713 | - msg = "<?php _e('Attempt to find location took too long','geodirectory');?>"; |
|
713 | + msg = "<?php _e('Attempt to find location took too long', 'geodirectory'); ?>"; |
|
714 | 714 | break; |
715 | 715 | default: |
716 | - msg = "<?php _e('Location detection not supported in browser','geodirectory');?>"; |
|
716 | + msg = "<?php _e('Location detection not supported in browser', 'geodirectory'); ?>"; |
|
717 | 717 | } |
718 | 718 | jQuery('#info').html(msg); |
719 | 719 | } |
@@ -752,7 +752,7 @@ discard block |
||
752 | 752 | * @param object $post The post object. |
753 | 753 | * @param string $link The link to the post. |
754 | 754 | */ |
755 | - $return = apply_filters('geodir_featured_badge_on_image', '<a href="' . $link . '"><span class="geodir_featured_img"> </span></a>',$post,$link); |
|
755 | + $return = apply_filters('geodir_featured_badge_on_image', '<a href="'.$link.'"><span class="geodir_featured_img"> </span></a>', $post, $link); |
|
756 | 756 | break; |
757 | 757 | case 'new' : |
758 | 758 | /** |
@@ -762,7 +762,7 @@ discard block |
||
762 | 762 | * @param object $post The post object. |
763 | 763 | * @param string $link The link to the post. |
764 | 764 | */ |
765 | - $return = apply_filters('geodir_new_badge_on_image', '<a href="' . $link . '"><span class="geodir_new_listing"> </span></a>',$post,$link); |
|
765 | + $return = apply_filters('geodir_new_badge_on_image', '<a href="'.$link.'"><span class="geodir_new_listing"> </span></a>', $post, $link); |
|
766 | 766 | break; |
767 | 767 | |
768 | 768 | } |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | /* ON TEMPLATE INCLUDE */ |
137 | 137 | ///////////////////////// |
138 | 138 | |
139 | -add_filter('template_include', 'geodir_template_loader',9); |
|
139 | +add_filter('template_include', 'geodir_template_loader', 9); |
|
140 | 140 | |
141 | 141 | ///////////////////////// |
142 | 142 | /* CATEGORY / TAXONOMY / CUSTOM POST ACTIONS */ |
@@ -176,9 +176,9 @@ discard block |
||
176 | 176 | /* WP REVIEW COUNT ACTIONS */ |
177 | 177 | //////////////////////// |
178 | 178 | |
179 | -add_action('geodir_update_postrating', 'geodir_term_review_count_force_update_single_post', 100,1); |
|
179 | +add_action('geodir_update_postrating', 'geodir_term_review_count_force_update_single_post', 100, 1); |
|
180 | 180 | //add_action('geodir_update_postrating', 'geodir_term_review_count_force_update', 100); |
181 | -add_action('transition_post_status', 'geodir_term_review_count_force_update', 100,3); |
|
181 | +add_action('transition_post_status', 'geodir_term_review_count_force_update', 100, 3); |
|
182 | 182 | //add_action('created_term', 'geodir_term_review_count_force_update', 100); |
183 | 183 | add_action('edited_term', 'geodir_term_review_count_force_update', 100); |
184 | 184 | add_action('delete_term', 'geodir_term_review_count_force_update', 100); |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | */ |
223 | 223 | function geodir_unset_prev_theme_nav_location($newname) |
224 | 224 | { |
225 | - $geodir_theme_location = get_option('geodir_theme_location_nav_' . $newname); |
|
225 | + $geodir_theme_location = get_option('geodir_theme_location_nav_'.$newname); |
|
226 | 226 | if ($geodir_theme_location) { |
227 | 227 | update_option('geodir_theme_location_nav', $geodir_theme_location); |
228 | 228 | } else { |
@@ -320,8 +320,8 @@ discard block |
||
320 | 320 | |
321 | 321 | /////// GEO DIRECOTORY CUSTOM HOOKS /// |
322 | 322 | |
323 | -add_action('geodir_before_tab_content', 'geodir_before_tab_content');// this function is in custom_functions.php and it is used to wrap detail page tab content |
|
324 | -add_action('geodir_after_tab_content', 'geodir_after_tab_content');// this function is in custom_functions.php and it is used to wrap detail page tab content |
|
323 | +add_action('geodir_before_tab_content', 'geodir_before_tab_content'); // this function is in custom_functions.php and it is used to wrap detail page tab content |
|
324 | +add_action('geodir_after_tab_content', 'geodir_after_tab_content'); // this function is in custom_functions.php and it is used to wrap detail page tab content |
|
325 | 325 | |
326 | 326 | // Detail page sidebar content |
327 | 327 | add_action('geodir_detail_page_sidebar', 'geodir_detail_page_sidebar_content_sorting', 1); |
@@ -422,8 +422,8 @@ discard block |
||
422 | 422 | do_action('geodir_after_social_sharing_buttons'); |
423 | 423 | $content_html = ob_get_clean(); |
424 | 424 | if (trim($content_html) != '') |
425 | - $content_html = '<div class="geodir-company_info geodir-details-sidebar-social-sharing">' . $content_html . '</div>'; |
|
426 | - if ((int)get_option('geodir_disable_tfg_buttons_section') != 1) { |
|
425 | + $content_html = '<div class="geodir-company_info geodir-details-sidebar-social-sharing">'.$content_html.'</div>'; |
|
426 | + if ((int) get_option('geodir_disable_tfg_buttons_section') != 1) { |
|
427 | 427 | /** |
428 | 428 | * Filter the geodir_social_sharing_buttons() function content. |
429 | 429 | * |
@@ -469,8 +469,8 @@ discard block |
||
469 | 469 | do_action('geodir_after_share_this_button'); |
470 | 470 | $content_html = ob_get_clean(); |
471 | 471 | if (trim($content_html) != '') |
472 | - $content_html = '<div class="geodir-company_info geodir-details-sidebar-sharethis">' . $content_html . '</div>'; |
|
473 | - if ((int)get_option('geodir_disable_sharethis_button_section') != 1) { |
|
472 | + $content_html = '<div class="geodir-company_info geodir-details-sidebar-sharethis">'.$content_html.'</div>'; |
|
473 | + if ((int) get_option('geodir_disable_sharethis_button_section') != 1) { |
|
474 | 474 | /** |
475 | 475 | * Filter the geodir_share_this_button() function content. |
476 | 476 | * |
@@ -509,12 +509,12 @@ discard block |
||
509 | 509 | $post_id = $post->ID; |
510 | 510 | |
511 | 511 | if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') { |
512 | - $post_id = (int)$_REQUEST['pid']; |
|
512 | + $post_id = (int) $_REQUEST['pid']; |
|
513 | 513 | } |
514 | 514 | |
515 | 515 | $postlink = get_permalink(geodir_add_listing_page_id()); |
516 | 516 | $editlink = geodir_getlink($postlink, array('pid' => $post_id), false); |
517 | - echo ' <p class="edit_link"><i class="fa fa-pencil"></i> <a href="' . esc_url($editlink) . '">' . __('Edit this Post', 'geodirectory') . '</a></p>'; |
|
517 | + echo ' <p class="edit_link"><i class="fa fa-pencil"></i> <a href="'.esc_url($editlink).'">'.__('Edit this Post', 'geodirectory').'</a></p>'; |
|
518 | 518 | } |
519 | 519 | }// end of if, if its a preview or not |
520 | 520 | /** |
@@ -525,8 +525,8 @@ discard block |
||
525 | 525 | do_action('geodir_after_edit_post_link'); |
526 | 526 | $content_html = ob_get_clean(); |
527 | 527 | if (trim($content_html) != '') |
528 | - $content_html = '<div class="geodir-company_info geodir-details-sidebar-user-links">' . $content_html . '</div>'; |
|
529 | - if ((int)get_option('geodir_disable_user_links_section') != 1) { |
|
528 | + $content_html = '<div class="geodir-company_info geodir-details-sidebar-user-links">'.$content_html.'</div>'; |
|
529 | + if ((int) get_option('geodir_disable_user_links_section') != 1) { |
|
530 | 530 | /** |
531 | 531 | * Filter the geodir_edit_post_link() function content. |
532 | 532 | * |
@@ -579,14 +579,14 @@ discard block |
||
579 | 579 | $hide_refresh = get_option('geodir_ga_auto_refresh'); |
580 | 580 | |
581 | 581 | $auto_refresh = $hide_refresh && $refresh_time && $refresh_time > 0 ? 1 : 0; |
582 | - if (get_option('geodir_ga_stats') && is_user_logged_in() && (isset($package_info->google_analytics) && $package_info->google_analytics == '1') && (get_current_user_id()==$post->post_author || current_user_can( 'manage_options' )) ) { |
|
582 | + if (get_option('geodir_ga_stats') && is_user_logged_in() && (isset($package_info->google_analytics) && $package_info->google_analytics == '1') && (get_current_user_id() == $post->post_author || current_user_can('manage_options'))) { |
|
583 | 583 | $page_url = urlencode($_SERVER['REQUEST_URI']); |
584 | 584 | ?> |
585 | 585 | <script type="text/javascript"> |
586 | 586 | var gd_gaTimeOut; |
587 | - var gd_gaTime = parseInt('<?php echo $refresh_time;?>'); |
|
588 | - var gd_gaHideRefresh = <?php echo (int)$hide_refresh;?>; |
|
589 | - var gd_gaAutoRefresh = <?php echo $auto_refresh;?>; |
|
587 | + var gd_gaTime = parseInt('<?php echo $refresh_time; ?>'); |
|
588 | + var gd_gaHideRefresh = <?php echo (int) $hide_refresh; ?>; |
|
589 | + var gd_gaAutoRefresh = <?php echo $auto_refresh; ?>; |
|
590 | 590 | ga_data1 = false; |
591 | 591 | ga_data2 = false; |
592 | 592 | ga_data3 = false; |
@@ -727,7 +727,7 @@ discard block |
||
727 | 727 | } |
728 | 728 | |
729 | 729 | function gdga_noResults() { |
730 | - jQuery('#gdga-chart-container').html('<?php _e('No results available','geodirectory');?>'); |
|
730 | + jQuery('#gdga-chart-container').html('<?php _e('No results available', 'geodirectory'); ?>'); |
|
731 | 731 | jQuery('#gdga-legend-container').html(''); |
732 | 732 | } |
733 | 733 | |
@@ -759,18 +759,18 @@ discard block |
||
759 | 759 | var data2 = results[1].rows.map(function(row) { return +row[2]; }); |
760 | 760 | //var labelsN = results[0].rows.map(function(row) { return +row[1]; }); |
761 | 761 | |
762 | - var labels = ['<?php _e('Jan', 'geodirectory');?>', |
|
763 | - '<?php _e('Feb', 'geodirectory');?>', |
|
764 | - '<?php _e('Mar', 'geodirectory');?>', |
|
765 | - '<?php _e('Apr', 'geodirectory');?>', |
|
766 | - '<?php _e('May', 'geodirectory');?>', |
|
767 | - '<?php _e('Jun', 'geodirectory');?>', |
|
768 | - '<?php _e('Jul', 'geodirectory');?>', |
|
769 | - '<?php _e('Aug', 'geodirectory');?>', |
|
770 | - '<?php _e('Sep', 'geodirectory');?>', |
|
771 | - '<?php _e('Oct', 'geodirectory');?>', |
|
772 | - '<?php _e('Nov', 'geodirectory');?>', |
|
773 | - '<?php _e('Dec', 'geodirectory');?>']; |
|
762 | + var labels = ['<?php _e('Jan', 'geodirectory'); ?>', |
|
763 | + '<?php _e('Feb', 'geodirectory'); ?>', |
|
764 | + '<?php _e('Mar', 'geodirectory'); ?>', |
|
765 | + '<?php _e('Apr', 'geodirectory'); ?>', |
|
766 | + '<?php _e('May', 'geodirectory'); ?>', |
|
767 | + '<?php _e('Jun', 'geodirectory'); ?>', |
|
768 | + '<?php _e('Jul', 'geodirectory'); ?>', |
|
769 | + '<?php _e('Aug', 'geodirectory'); ?>', |
|
770 | + '<?php _e('Sep', 'geodirectory'); ?>', |
|
771 | + '<?php _e('Oct', 'geodirectory'); ?>', |
|
772 | + '<?php _e('Nov', 'geodirectory'); ?>', |
|
773 | + '<?php _e('Dec', 'geodirectory'); ?>']; |
|
774 | 774 | |
775 | 775 | // Ensure the data arrays are at least as long as the labels array. |
776 | 776 | // Chart.js bar charts don't (yet) accept sparse datasets. |
@@ -783,13 +783,13 @@ discard block |
||
783 | 783 | labels : labels, |
784 | 784 | datasets : [ |
785 | 785 | { |
786 | - label: '<?php _e('Last Year', 'geodirectory');?>', |
|
786 | + label: '<?php _e('Last Year', 'geodirectory'); ?>', |
|
787 | 787 | fillColor : "rgba(220,220,220,0.5)", |
788 | 788 | strokeColor : "rgba(220,220,220,1)", |
789 | 789 | data : data2 |
790 | 790 | }, |
791 | 791 | { |
792 | - label: '<?php _e('This Year', 'geodirectory');?>', |
|
792 | + label: '<?php _e('This Year', 'geodirectory'); ?>', |
|
793 | 793 | fillColor : "rgba(151,187,205,0.5)", |
794 | 794 | strokeColor : "rgba(151,187,205,1)", |
795 | 795 | data : data1 |
@@ -834,30 +834,30 @@ discard block |
||
834 | 834 | |
835 | 835 | <?php |
836 | 836 | // Here we list the shorthand days of the week so it can be used in translation. |
837 | - __("Mon",'geodirectory'); |
|
838 | - __("Tue",'geodirectory'); |
|
839 | - __("Wed",'geodirectory'); |
|
840 | - __("Thu",'geodirectory'); |
|
841 | - __("Fri",'geodirectory'); |
|
842 | - __("Sat",'geodirectory'); |
|
843 | - __("Sun",'geodirectory'); |
|
837 | + __("Mon", 'geodirectory'); |
|
838 | + __("Tue", 'geodirectory'); |
|
839 | + __("Wed", 'geodirectory'); |
|
840 | + __("Thu", 'geodirectory'); |
|
841 | + __("Fri", 'geodirectory'); |
|
842 | + __("Sat", 'geodirectory'); |
|
843 | + __("Sun", 'geodirectory'); |
|
844 | 844 | ?> |
845 | 845 | |
846 | 846 | labels = [ |
847 | - "<?php _e(date('D', strtotime("+1 day")),'geodirectory'); ?>", |
|
848 | - "<?php _e(date('D', strtotime("+2 day")),'geodirectory'); ?>", |
|
849 | - "<?php _e(date('D', strtotime("+3 day")),'geodirectory'); ?>", |
|
850 | - "<?php _e(date('D', strtotime("+4 day")),'geodirectory'); ?>", |
|
851 | - "<?php _e(date('D', strtotime("+5 day")),'geodirectory'); ?>", |
|
852 | - "<?php _e(date('D', strtotime("+6 day")),'geodirectory'); ?>", |
|
853 | - "<?php _e(date('D', strtotime("+7 day")),'geodirectory'); ?>" |
|
847 | + "<?php _e(date('D', strtotime("+1 day")), 'geodirectory'); ?>", |
|
848 | + "<?php _e(date('D', strtotime("+2 day")), 'geodirectory'); ?>", |
|
849 | + "<?php _e(date('D', strtotime("+3 day")), 'geodirectory'); ?>", |
|
850 | + "<?php _e(date('D', strtotime("+4 day")), 'geodirectory'); ?>", |
|
851 | + "<?php _e(date('D', strtotime("+5 day")), 'geodirectory'); ?>", |
|
852 | + "<?php _e(date('D', strtotime("+6 day")), 'geodirectory'); ?>", |
|
853 | + "<?php _e(date('D', strtotime("+7 day")), 'geodirectory'); ?>" |
|
854 | 854 | ]; |
855 | 855 | |
856 | 856 | var data = { |
857 | 857 | labels : labels, |
858 | 858 | datasets : [ |
859 | 859 | { |
860 | - label: '<?php _e('Last Week', 'geodirectory');?>', |
|
860 | + label: '<?php _e('Last Week', 'geodirectory'); ?>', |
|
861 | 861 | fillColor : "rgba(220,220,220,0.5)", |
862 | 862 | strokeColor : "rgba(220,220,220,1)", |
863 | 863 | pointColor : "rgba(220,220,220,1)", |
@@ -865,7 +865,7 @@ discard block |
||
865 | 865 | data : data2 |
866 | 866 | }, |
867 | 867 | { |
868 | - label: '<?php _e('This Week', 'geodirectory');?>', |
|
868 | + label: '<?php _e('This Week', 'geodirectory'); ?>', |
|
869 | 869 | fillColor : "rgba(151,187,205,0.5)", |
870 | 870 | strokeColor : "rgba(151,187,205,1)", |
871 | 871 | pointColor : "rgba(151,187,205,1)", |
@@ -1072,18 +1072,18 @@ discard block |
||
1072 | 1072 | </style> |
1073 | 1073 | <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.2/Chart.min.js"></script> |
1074 | 1074 | <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.2/moment.min.js"></script> |
1075 | - <button type="button" class="gdga-show-analytics"><?php _e('Show Google Analytics', 'geodirectory');?></button> |
|
1075 | + <button type="button" class="gdga-show-analytics"><?php _e('Show Google Analytics', 'geodirectory'); ?></button> |
|
1076 | 1076 | <span id="ga_stats" class="gdga-analytics-box" style="display:none"> |
1077 | - <div id="ga-analytics-title"><?php _e("Analytics", 'geodirectory');?></div> |
|
1077 | + <div id="ga-analytics-title"><?php _e("Analytics", 'geodirectory'); ?></div> |
|
1078 | 1078 | <div id="gd-active-users-container"> |
1079 | - <div class="gd-ActiveUsers"><i id="gdga-loader-icon" class="fa fa-refresh fa-spin" title="<?php esc_attr_e("Refresh", 'geodirectory');?>"></i><?php _e("Active Users:", 'geodirectory');?> |
|
1079 | + <div class="gd-ActiveUsers"><i id="gdga-loader-icon" class="fa fa-refresh fa-spin" title="<?php esc_attr_e("Refresh", 'geodirectory'); ?>"></i><?php _e("Active Users:", 'geodirectory'); ?> |
|
1080 | 1080 | <b class="gd-ActiveUsers-value">0</b> |
1081 | 1081 | </div> |
1082 | 1082 | </div> |
1083 | 1083 | <select id="gdga-select-analytic" onchange="gdga_select_option();" style="display: none;"> |
1084 | - <option value="weeks"><?php _e("Last Week vs This Week", 'geodirectory');?></option> |
|
1085 | - <option value="years"><?php _e("This Year vs Last Year", 'geodirectory');?></option> |
|
1086 | - <option value="country"><?php _e("Top Countries", 'geodirectory');?></option> |
|
1084 | + <option value="weeks"><?php _e("Last Week vs This Week", 'geodirectory'); ?></option> |
|
1085 | + <option value="years"><?php _e("This Year vs Last Year", 'geodirectory'); ?></option> |
|
1086 | + <option value="country"><?php _e("Top Countries", 'geodirectory'); ?></option> |
|
1087 | 1087 | </select> |
1088 | 1088 | <div class="Chartjs-figure" id="gdga-chart-container"></div> |
1089 | 1089 | <ol class="Chartjs-legend" id="gdga-legend-container"></ol> |
@@ -1099,8 +1099,8 @@ discard block |
||
1099 | 1099 | do_action('geodir_after_google_analytics'); |
1100 | 1100 | $content_html = ob_get_clean(); |
1101 | 1101 | if (trim($content_html) != '') |
1102 | - $content_html = '<div class="geodir-company_info geodir-details-sidebar-google-analytics">' . $content_html . '</div>'; |
|
1103 | - if ((int)get_option('geodir_disable_google_analytics_section') != 1) { |
|
1102 | + $content_html = '<div class="geodir-company_info geodir-details-sidebar-google-analytics">'.$content_html.'</div>'; |
|
1103 | + if ((int) get_option('geodir_disable_google_analytics_section') != 1) { |
|
1104 | 1104 | /** |
1105 | 1105 | * Filter the geodir_edit_post_link() function content. |
1106 | 1106 | * |
@@ -1156,10 +1156,10 @@ discard block |
||
1156 | 1156 | |
1157 | 1157 | $reviews_text = $comment_count > 1 ? __("reviews", 'geodirectory') : __("review", 'geodirectory'); |
1158 | 1158 | |
1159 | - $html .= '<span itemprop="rating" itemscope itemtype="http://data-vocabulary.org/Rating"><span class="rating" itemprop="average" content="' . $post_avgratings . '">' . $post_avgratings . '</span> / <span itemprop="best" content="5">5</span> ' . __("based on", 'geodirectory') . ' </span><span class="count" itemprop="count" content="' . $comment_count . '">' . $comment_count . ' ' . $reviews_text . '</span><br />'; |
|
1159 | + $html .= '<span itemprop="rating" itemscope itemtype="http://data-vocabulary.org/Rating"><span class="rating" itemprop="average" content="'.$post_avgratings.'">'.$post_avgratings.'</span> / <span itemprop="best" content="5">5</span> '.__("based on", 'geodirectory').' </span><span class="count" itemprop="count" content="'.$comment_count.'">'.$comment_count.' '.$reviews_text.'</span><br />'; |
|
1160 | 1160 | |
1161 | 1161 | $html .= '<span class="item">'; |
1162 | - $html .= '<span class="fn" itemprop="itemreviewed">' . $post->post_title . '</span>'; |
|
1162 | + $html .= '<span class="fn" itemprop="itemreviewed">'.$post->post_title.'</span>'; |
|
1163 | 1163 | |
1164 | 1164 | if ($post_images) { |
1165 | 1165 | foreach ($post_images as $img) { |
@@ -1169,7 +1169,7 @@ discard block |
||
1169 | 1169 | } |
1170 | 1170 | |
1171 | 1171 | if (isset($post_img) && $post_img) { |
1172 | - $html .= '<br /><img src="' . $post_img . '" class="photo" alt="' . esc_attr($post->post_title) . '" itemprop="photo" content="' . $post_img . '" class="photo" />'; |
|
1172 | + $html .= '<br /><img src="'.$post_img.'" class="photo" alt="'.esc_attr($post->post_title).'" itemprop="photo" content="'.$post_img.'" class="photo" />'; |
|
1173 | 1173 | } |
1174 | 1174 | |
1175 | 1175 | $html .= '</span>'; |
@@ -1196,9 +1196,9 @@ discard block |
||
1196 | 1196 | do_action('geodir_after_detail_page_review_rating'); |
1197 | 1197 | $content_html = ob_get_clean(); |
1198 | 1198 | if (trim($content_html) != '') { |
1199 | - $content_html = '<div class="geodir-company_info geodir-details-sidebar-rating">' . $content_html . '</div>'; |
|
1199 | + $content_html = '<div class="geodir-company_info geodir-details-sidebar-rating">'.$content_html.'</div>'; |
|
1200 | 1200 | } |
1201 | - if ((int)get_option('geodir_disable_rating_info_section') != 1) { |
|
1201 | + if ((int) get_option('geodir_disable_rating_info_section') != 1) { |
|
1202 | 1202 | /** |
1203 | 1203 | * Filter the geodir_detail_page_review_rating() function content. |
1204 | 1204 | * |
@@ -1237,8 +1237,8 @@ discard block |
||
1237 | 1237 | |
1238 | 1238 | $content_html = ob_get_clean(); |
1239 | 1239 | if (trim($content_html) != '') |
1240 | - $content_html = '<div class="geodir-company_info geodir-details-sidebar-listing-info">' . $content_html . '</div>'; |
|
1241 | - if ((int)get_option('geodir_disable_listing_info_section') != 1) { |
|
1240 | + $content_html = '<div class="geodir-company_info geodir-details-sidebar-listing-info">'.$content_html.'</div>'; |
|
1241 | + if ((int) get_option('geodir_disable_listing_info_section') != 1) { |
|
1242 | 1242 | /** |
1243 | 1243 | * Filter the output html for function geodir_detail_page_more_info(). |
1244 | 1244 | * |
@@ -1336,7 +1336,7 @@ discard block |
||
1336 | 1336 | 'gd_allowed_img_types' => !empty($allowed_img_types) ? implode(',', $allowed_img_types) : '', |
1337 | 1337 | 'geodir_txt_form_wait' => __('Wait...', 'geodirectory'), |
1338 | 1338 | 'geodir_txt_form_searching' => __('Searching...', 'geodirectory'), |
1339 | - 'fa_rating' => (int)get_option('geodir_reviewrating_enable_font_awesome') == 1 ? 1 : '', |
|
1339 | + 'fa_rating' => (int) get_option('geodir_reviewrating_enable_font_awesome') == 1 ? 1 : '', |
|
1340 | 1340 | 'reviewrating' => defined('GEODIRREVIEWRATING_VERSION') ? 1 : '', |
1341 | 1341 | 'geodir_map_name' => geodir_map_name(), |
1342 | 1342 | ); |
@@ -1354,10 +1354,10 @@ discard block |
||
1354 | 1354 | foreach ($arr_alert_msg as $key => $value) { |
1355 | 1355 | if (!is_scalar($value)) |
1356 | 1356 | continue; |
1357 | - $arr_alert_msg[$key] = html_entity_decode((string)$value, ENT_QUOTES, 'UTF-8'); |
|
1357 | + $arr_alert_msg[$key] = html_entity_decode((string) $value, ENT_QUOTES, 'UTF-8'); |
|
1358 | 1358 | } |
1359 | 1359 | |
1360 | - $script = "var geodir_all_js_msg = " . json_encode($arr_alert_msg) . ';'; |
|
1360 | + $script = "var geodir_all_js_msg = ".json_encode($arr_alert_msg).';'; |
|
1361 | 1361 | echo '<script>'; |
1362 | 1362 | echo $script; |
1363 | 1363 | echo '</script>'; |
@@ -1530,7 +1530,7 @@ discard block |
||
1530 | 1530 | global $post; |
1531 | 1531 | $term_condition = ''; |
1532 | 1532 | if (isset($_REQUEST['backandedit'])) { |
1533 | - $post = (object)$gd_session->get('listing'); |
|
1533 | + $post = (object) $gd_session->get('listing'); |
|
1534 | 1534 | $term_condition = isset($post->geodir_accept_term_condition) ? $post->geodir_accept_term_condition : ''; |
1535 | 1535 | } |
1536 | 1536 | |
@@ -1544,7 +1544,7 @@ discard block |
||
1544 | 1544 | echo 'checked="checked"'; |
1545 | 1545 | } ?> field_type="checkbox" name="geodir_accept_term_condition" id="geodir_accept_term_condition" |
1546 | 1546 | class="geodir_textfield" value="1" |
1547 | - style="display:inline-block"/><a href="<?php $terms_page = get_option('geodir_term_condition_page'); if($terms_page){ echo get_permalink($terms_page);}?>" target="_blank"><?php _e('Please accept our terms and conditions', 'geodirectory'); ?></a> |
|
1547 | + style="display:inline-block"/><a href="<?php $terms_page = get_option('geodir_term_condition_page'); if ($terms_page) { echo get_permalink($terms_page); }?>" target="_blank"><?php _e('Please accept our terms and conditions', 'geodirectory'); ?></a> |
|
1548 | 1548 | </span> |
1549 | 1549 | </div> |
1550 | 1550 | <span class="geodir_message_error"><?php if (isset($required_msg)) { |
@@ -1584,7 +1584,7 @@ discard block |
||
1584 | 1584 | /** This action is documented in geodirectory_template_actions.php */ |
1585 | 1585 | $desc_limit = apply_filters('geodir_description_field_desc_limit', ''); |
1586 | 1586 | |
1587 | - if (!($desc_limit === '' || (int)$desc_limit > 0)) { |
|
1587 | + if (!($desc_limit === '' || (int) $desc_limit > 0)) { |
|
1588 | 1588 | $is_display = false; |
1589 | 1589 | } |
1590 | 1590 | } |
@@ -1632,16 +1632,16 @@ discard block |
||
1632 | 1632 | global $wpdb, $plugin_prefix; |
1633 | 1633 | |
1634 | 1634 | // Remove unused virtual page |
1635 | - $listings_page_id = (int)get_option('geodir_listing_page'); |
|
1635 | + $listings_page_id = (int) get_option('geodir_listing_page'); |
|
1636 | 1636 | if ($listings_page_id) { |
1637 | - $wpdb->query($wpdb->prepare("DELETE FROM " . $wpdb->posts . " WHERE ID=%d AND post_name = %s AND post_type=%s", array($listings_page_id, 'listings', 'page'))); |
|
1637 | + $wpdb->query($wpdb->prepare("DELETE FROM ".$wpdb->posts." WHERE ID=%d AND post_name = %s AND post_type=%s", array($listings_page_id, 'listings', 'page'))); |
|
1638 | 1638 | delete_option('geodir_listing_page'); |
1639 | 1639 | } |
1640 | 1640 | |
1641 | 1641 | if (!get_option('geodir_changes_in_custom_fields_table')) { |
1642 | 1642 | $wpdb->query( |
1643 | 1643 | $wpdb->prepare( |
1644 | - "UPDATE " . GEODIR_CUSTOM_FIELDS_TABLE . " SET is_default=%s, is_admin=%s WHERE is_default=%s", |
|
1644 | + "UPDATE ".GEODIR_CUSTOM_FIELDS_TABLE." SET is_default=%s, is_admin=%s WHERE is_default=%s", |
|
1645 | 1645 | array('1', '1', 'admin') |
1646 | 1646 | ) |
1647 | 1647 | ); |
@@ -1649,9 +1649,9 @@ discard block |
||
1649 | 1649 | |
1650 | 1650 | /* --- terms meta value set --- */ |
1651 | 1651 | |
1652 | - update_option('geodir_default_marker_icon', geodir_plugin_url() . '/geodirectory-functions/map-functions/icons/pin.png'); |
|
1652 | + update_option('geodir_default_marker_icon', geodir_plugin_url().'/geodirectory-functions/map-functions/icons/pin.png'); |
|
1653 | 1653 | |
1654 | - $options_data = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "options WHERE option_name LIKE %s", array('%tax_meta_%'))); |
|
1654 | + $options_data = $wpdb->get_results($wpdb->prepare("SELECT * FROM ".$wpdb->prefix."options WHERE option_name LIKE %s", array('%tax_meta_%'))); |
|
1655 | 1655 | |
1656 | 1656 | if (!empty($options_data)) { |
1657 | 1657 | |
@@ -1659,7 +1659,7 @@ discard block |
||
1659 | 1659 | |
1660 | 1660 | $option_val = str_replace('tax_meta_', '', $optobj->option_name); |
1661 | 1661 | |
1662 | - $taxonomies_data = $wpdb->get_results($wpdb->prepare("SELECT taxonomy FROM " . $wpdb->prefix . "term_taxonomy WHERE taxonomy LIKE %s AND term_id=%d", array('%category%', $option_val))); |
|
1662 | + $taxonomies_data = $wpdb->get_results($wpdb->prepare("SELECT taxonomy FROM ".$wpdb->prefix."term_taxonomy WHERE taxonomy LIKE %s AND term_id=%d", array('%category%', $option_val))); |
|
1663 | 1663 | |
1664 | 1664 | if (!empty($taxonomies_data)) { |
1665 | 1665 | |
@@ -1668,17 +1668,17 @@ discard block |
||
1668 | 1668 | $taxObject = get_taxonomy($taxobj->taxonomy); |
1669 | 1669 | $post_type = $taxObject->object_type[0]; |
1670 | 1670 | |
1671 | - $opt_value = 'tax_meta_' . $post_type . '_' . $option_val; |
|
1671 | + $opt_value = 'tax_meta_'.$post_type.'_'.$option_val; |
|
1672 | 1672 | |
1673 | - $duplicate_data = $wpdb->get_var($wpdb->prepare("SELECT option_id FROM " . $wpdb->prefix . "options WHERE option_name=%s", array('tax_meta_' . $option_val))); |
|
1673 | + $duplicate_data = $wpdb->get_var($wpdb->prepare("SELECT option_id FROM ".$wpdb->prefix."options WHERE option_name=%s", array('tax_meta_'.$option_val))); |
|
1674 | 1674 | |
1675 | 1675 | if ($duplicate_data) { |
1676 | 1676 | |
1677 | - $wpdb->query($wpdb->prepare("UPDATE " . $wpdb->prefix . "options SET option_name=%s WHERE option_id=%d", array($opt_value, $optobj->option_id))); |
|
1677 | + $wpdb->query($wpdb->prepare("UPDATE ".$wpdb->prefix."options SET option_name=%s WHERE option_id=%d", array($opt_value, $optobj->option_id))); |
|
1678 | 1678 | |
1679 | 1679 | } else { |
1680 | 1680 | |
1681 | - $wpdb->query($wpdb->prepare("INSERT INTO " . $wpdb->prefix . "options (option_name,option_value,autoload) VALUES (%s, %s, %s)", array($opt_value, $optobj->option_value, $optobj->autoload))); |
|
1681 | + $wpdb->query($wpdb->prepare("INSERT INTO ".$wpdb->prefix."options (option_name,option_value,autoload) VALUES (%s, %s, %s)", array($opt_value, $optobj->option_value, $optobj->autoload))); |
|
1682 | 1682 | |
1683 | 1683 | } |
1684 | 1684 | |
@@ -1712,14 +1712,14 @@ discard block |
||
1712 | 1712 | |
1713 | 1713 | global $wpdb, $table_prefix; |
1714 | 1714 | |
1715 | - $slug_exists = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($slug))); |
|
1715 | + $slug_exists = $wpdb->get_var($wpdb->prepare("SELECT slug FROM ".$table_prefix."terms WHERE slug=%s", array($slug))); |
|
1716 | 1716 | |
1717 | 1717 | if ($slug_exists) { |
1718 | 1718 | |
1719 | 1719 | $suffix = 1; |
1720 | 1720 | do { |
1721 | - $alt_location_name = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix"; |
|
1722 | - $location_slug_check = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($alt_location_name))); |
|
1721 | + $alt_location_name = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1))."-$suffix"; |
|
1722 | + $location_slug_check = $wpdb->get_var($wpdb->prepare("SELECT slug FROM ".$table_prefix."terms WHERE slug=%s", array($alt_location_name))); |
|
1723 | 1723 | $suffix++; |
1724 | 1724 | } while ($location_slug_check && $suffix < 100); |
1725 | 1725 | |
@@ -1773,7 +1773,7 @@ discard block |
||
1773 | 1773 | |
1774 | 1774 | $suffix = 1; |
1775 | 1775 | do { |
1776 | - $new_slug = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix"; |
|
1776 | + $new_slug = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1))."-$suffix"; |
|
1777 | 1777 | |
1778 | 1778 | /** This action is documented in geodirectory_hooks_actions.php */ |
1779 | 1779 | $term_slug_check = apply_filters('geodir_term_slug_is_exists', false, $new_slug, $term_id); |
@@ -1785,7 +1785,7 @@ discard block |
||
1785 | 1785 | |
1786 | 1786 | //wp_update_term( $term_id, $taxonomy, array('slug' => $slug) ); |
1787 | 1787 | |
1788 | - $wpdb->query($wpdb->prepare("UPDATE " . $table_prefix . "terms SET slug=%s WHERE term_id=%d", array($slug, $term_id))); |
|
1788 | + $wpdb->query($wpdb->prepare("UPDATE ".$table_prefix."terms SET slug=%s WHERE term_id=%d", array($slug, $term_id))); |
|
1789 | 1789 | |
1790 | 1790 | } |
1791 | 1791 | |
@@ -1794,18 +1794,18 @@ discard block |
||
1794 | 1794 | $post_type = !empty($taxonomy_obj) ? $taxonomy_obj->object_type[0] : NULL; |
1795 | 1795 | |
1796 | 1796 | $post_types = geodir_get_posttypes(); |
1797 | - if ($post_type && in_array($post_type, $post_types) && $post_type . '_tags' == $taxonomy) { |
|
1798 | - $posts_obj = $wpdb->get_results($wpdb->prepare("SELECT object_id FROM " . $wpdb->term_relationships . " WHERE term_taxonomy_id = %d", array($tt_id))); |
|
1797 | + if ($post_type && in_array($post_type, $post_types) && $post_type.'_tags' == $taxonomy) { |
|
1798 | + $posts_obj = $wpdb->get_results($wpdb->prepare("SELECT object_id FROM ".$wpdb->term_relationships." WHERE term_taxonomy_id = %d", array($tt_id))); |
|
1799 | 1799 | |
1800 | 1800 | if (!empty($posts_obj)) { |
1801 | 1801 | foreach ($posts_obj as $post_obj) { |
1802 | 1802 | $post_id = $post_obj->object_id; |
1803 | 1803 | |
1804 | - $raw_tags = wp_get_object_terms($post_id, $post_type . '_tags', array('fields' => 'names')); |
|
1804 | + $raw_tags = wp_get_object_terms($post_id, $post_type.'_tags', array('fields' => 'names')); |
|
1805 | 1805 | $post_tags = !empty($raw_tags) ? implode(',', $raw_tags) : ''; |
1806 | 1806 | |
1807 | - $listing_table = $plugin_prefix . $post_type . '_detail'; |
|
1808 | - $wpdb->query($wpdb->prepare("UPDATE " . $listing_table . " SET post_tags=%s WHERE post_id =%d", array($post_tags, $post_id))); |
|
1807 | + $listing_table = $plugin_prefix.$post_type.'_detail'; |
|
1808 | + $wpdb->query($wpdb->prepare("UPDATE ".$listing_table." SET post_tags=%s WHERE post_id =%d", array($post_tags, $post_id))); |
|
1809 | 1809 | } |
1810 | 1810 | } |
1811 | 1811 | } |
@@ -1839,7 +1839,7 @@ discard block |
||
1839 | 1839 | if ($country_slug == $slug || $region_slug == $slug || $city_slug == $slug) |
1840 | 1840 | return $slug_exists = true; |
1841 | 1841 | |
1842 | - if ($wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s AND term_id != %d", array($slug, $term_id)))) |
|
1842 | + if ($wpdb->get_var($wpdb->prepare("SELECT slug FROM ".$table_prefix."terms WHERE slug=%s AND term_id != %d", array($slug, $term_id)))) |
|
1843 | 1843 | return $slug_exists = true; |
1844 | 1844 | |
1845 | 1845 | return $slug_exists; |
@@ -1879,43 +1879,43 @@ discard block |
||
1879 | 1879 | |
1880 | 1880 | |
1881 | 1881 | $gd_page = ''; |
1882 | - if(geodir_is_page('home')){ |
|
1882 | + if (geodir_is_page('home')) { |
|
1883 | 1883 | $gd_page = 'home'; |
1884 | 1884 | $title = (get_option('geodir_meta_title_homepage')) ? get_option('geodir_meta_title_homepage') : $title; |
1885 | 1885 | } |
1886 | - elseif(geodir_is_page('detail')){ |
|
1886 | + elseif (geodir_is_page('detail')) { |
|
1887 | 1887 | $gd_page = 'detail'; |
1888 | 1888 | $title = (get_option('geodir_meta_title_detail')) ? get_option('geodir_meta_title_detail') : $title; |
1889 | 1889 | } |
1890 | - elseif(geodir_is_page('pt')){ |
|
1890 | + elseif (geodir_is_page('pt')) { |
|
1891 | 1891 | $gd_page = 'pt'; |
1892 | 1892 | $title = (get_option('geodir_meta_title_pt')) ? get_option('geodir_meta_title_pt') : $title; |
1893 | 1893 | } |
1894 | - elseif(geodir_is_page('listing')){ |
|
1894 | + elseif (geodir_is_page('listing')) { |
|
1895 | 1895 | $gd_page = 'listing'; |
1896 | 1896 | $title = (get_option('geodir_meta_title_listing')) ? get_option('geodir_meta_title_listing') : $title; |
1897 | 1897 | } |
1898 | - elseif(geodir_is_page('location')){ |
|
1898 | + elseif (geodir_is_page('location')) { |
|
1899 | 1899 | $gd_page = 'location'; |
1900 | 1900 | $title = (get_option('geodir_meta_title_location')) ? get_option('geodir_meta_title_location') : $title; |
1901 | 1901 | } |
1902 | - elseif(geodir_is_page('search')){ |
|
1902 | + elseif (geodir_is_page('search')) { |
|
1903 | 1903 | $gd_page = 'search'; |
1904 | 1904 | $title = (get_option('geodir_meta_title_search')) ? get_option('geodir_meta_title_search') : $title; |
1905 | 1905 | } |
1906 | - elseif(geodir_is_page('add-listing')){ |
|
1906 | + elseif (geodir_is_page('add-listing')) { |
|
1907 | 1907 | $gd_page = 'add-listing'; |
1908 | 1908 | $title = (get_option('geodir_meta_title_add-listing')) ? get_option('geodir_meta_title_add-listing') : $title; |
1909 | 1909 | } |
1910 | - elseif(geodir_is_page('author')){ |
|
1910 | + elseif (geodir_is_page('author')) { |
|
1911 | 1911 | $gd_page = 'author'; |
1912 | 1912 | $title = (get_option('geodir_meta_title_author')) ? get_option('geodir_meta_title_author') : $title; |
1913 | 1913 | } |
1914 | - elseif(geodir_is_page('login')){ |
|
1914 | + elseif (geodir_is_page('login')) { |
|
1915 | 1915 | $gd_page = 'login'; |
1916 | 1916 | $title = (get_option('geodir_meta_title_login')) ? get_option('geodir_meta_title_login') : $title; |
1917 | 1917 | } |
1918 | - elseif(geodir_is_page('listing-success')){ |
|
1918 | + elseif (geodir_is_page('listing-success')) { |
|
1919 | 1919 | $gd_page = 'listing-success'; |
1920 | 1920 | $title = (get_option('geodir_meta_title_listing-success')) ? get_option('geodir_meta_title_listing-success') : $title; |
1921 | 1921 | } |
@@ -1947,8 +1947,8 @@ discard block |
||
1947 | 1947 | |
1948 | 1948 | if (!get_option('geodir_set_post_attachments')) { |
1949 | 1949 | |
1950 | - require_once(ABSPATH . 'wp-admin/includes/image.php'); |
|
1951 | - require_once(ABSPATH . 'wp-admin/includes/file.php'); |
|
1950 | + require_once(ABSPATH.'wp-admin/includes/image.php'); |
|
1951 | + require_once(ABSPATH.'wp-admin/includes/file.php'); |
|
1952 | 1952 | |
1953 | 1953 | $all_postypes = geodir_get_posttypes(); |
1954 | 1954 | |
@@ -2149,7 +2149,7 @@ discard block |
||
2149 | 2149 | |
2150 | 2150 | if (array_key_exists('post_video', $tabs_arr)) { |
2151 | 2151 | |
2152 | - $field_title = $wpdb->get_var($wpdb->prepare("select site_title from " . GEODIR_CUSTOM_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s ", array('geodir_video', $post_type))); |
|
2152 | + $field_title = $wpdb->get_var($wpdb->prepare("select site_title from ".GEODIR_CUSTOM_FIELDS_TABLE." where htmlvar_name = %s and post_type = %s ", array('geodir_video', $post_type))); |
|
2153 | 2153 | |
2154 | 2154 | if (isset($tabs_arr['post_video']['heading_text']) && $field_title != '') |
2155 | 2155 | $tabs_arr['post_video']['heading_text'] = $field_title; |
@@ -2157,7 +2157,7 @@ discard block |
||
2157 | 2157 | |
2158 | 2158 | if (array_key_exists('special_offers', $tabs_arr)) { |
2159 | 2159 | |
2160 | - $field_title = $wpdb->get_var($wpdb->prepare("select site_title from " . GEODIR_CUSTOM_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s ", array('geodir_special_offers', $post_type))); |
|
2160 | + $field_title = $wpdb->get_var($wpdb->prepare("select site_title from ".GEODIR_CUSTOM_FIELDS_TABLE." where htmlvar_name = %s and post_type = %s ", array('geodir_special_offers', $post_type))); |
|
2161 | 2161 | |
2162 | 2162 | if (isset($tabs_arr['special_offers']['heading_text']) && $field_title != '') |
2163 | 2163 | $tabs_arr['special_offers']['heading_text'] = $field_title; |
@@ -2178,7 +2178,7 @@ discard block |
||
2178 | 2178 | */ |
2179 | 2179 | function geodir_remove_template_redirect_actions() |
2180 | 2180 | { |
2181 | - if (geodir_is_page('login')){ |
|
2181 | + if (geodir_is_page('login')) { |
|
2182 | 2182 | remove_all_actions('template_redirect'); |
2183 | 2183 | remove_action('init', 'avia_modify_front', 10); |
2184 | 2184 | } |
@@ -2225,25 +2225,25 @@ discard block |
||
2225 | 2225 | $split_img_file_path = isset($split_img_path[1]) ? $split_img_path[1] : ''; |
2226 | 2226 | |
2227 | 2227 | $wpdb->query( |
2228 | - $wpdb->prepare("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id = %d AND file=%s ", |
|
2228 | + $wpdb->prepare("DELETE FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id = %d AND file=%s ", |
|
2229 | 2229 | array($post_id, $split_img_file_path) |
2230 | 2230 | ) |
2231 | 2231 | ); |
2232 | 2232 | |
2233 | 2233 | $attachment_data = $wpdb->get_row( |
2234 | - $wpdb->prepare("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=%d", |
|
2234 | + $wpdb->prepare("SELECT ID, MIN(`menu_order`) FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id=%d", |
|
2235 | 2235 | array($post_id) |
2236 | 2236 | ) |
2237 | 2237 | ); |
2238 | 2238 | |
2239 | 2239 | if (!empty($attachment_data)) { |
2240 | - $wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID); |
|
2240 | + $wpdb->query("UPDATE ".GEODIR_ATTACHMENT_TABLE." SET menu_order=1 WHERE ID=".$attachment_data->ID); |
|
2241 | 2241 | } |
2242 | 2242 | |
2243 | 2243 | |
2244 | - $table_name = $plugin_prefix . $post_type . '_detail'; |
|
2244 | + $table_name = $plugin_prefix.$post_type.'_detail'; |
|
2245 | 2245 | |
2246 | - $wpdb->query("UPDATE " . $table_name . " SET featured_image='' WHERE post_id =" . $post_id); |
|
2246 | + $wpdb->query("UPDATE ".$table_name." SET featured_image='' WHERE post_id =".$post_id); |
|
2247 | 2247 | |
2248 | 2248 | geodir_set_wp_featured_image($post_id); |
2249 | 2249 | |
@@ -2271,9 +2271,9 @@ discard block |
||
2271 | 2271 | |
2272 | 2272 | foreach ($all_postypes as $posttype) { |
2273 | 2273 | |
2274 | - $tablename = $plugin_prefix . $posttype . '_detail'; |
|
2274 | + $tablename = $plugin_prefix.$posttype.'_detail'; |
|
2275 | 2275 | |
2276 | - $get_post_data = $wpdb->get_results("SELECT post_id FROM " . $tablename); |
|
2276 | + $get_post_data = $wpdb->get_results("SELECT post_id FROM ".$tablename); |
|
2277 | 2277 | |
2278 | 2278 | if (!empty($get_post_data)) { |
2279 | 2279 | |
@@ -2281,7 +2281,7 @@ discard block |
||
2281 | 2281 | |
2282 | 2282 | $post_id = $data->post_id; |
2283 | 2283 | |
2284 | - $attachment_data = $wpdb->get_results("SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id =" . $post_id . " AND file!=''"); |
|
2284 | + $attachment_data = $wpdb->get_results("SELECT * FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id =".$post_id." AND file!=''"); |
|
2285 | 2285 | |
2286 | 2286 | if (!empty($attachment_data)) { |
2287 | 2287 | |
@@ -2298,22 +2298,22 @@ discard block |
||
2298 | 2298 | |
2299 | 2299 | $file_name = $file_info['basename']; |
2300 | 2300 | |
2301 | - $img_arr['path'] = $uploads_path . $sub_dir . '/' . $file_name; |
|
2301 | + $img_arr['path'] = $uploads_path.$sub_dir.'/'.$file_name; |
|
2302 | 2302 | |
2303 | 2303 | if (!file_exists($img_arr['path'])) { |
2304 | 2304 | |
2305 | - $wpdb->query("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE ID=" . $attach->ID); |
|
2305 | + $wpdb->query("DELETE FROM ".GEODIR_ATTACHMENT_TABLE." WHERE ID=".$attach->ID); |
|
2306 | 2306 | |
2307 | 2307 | } |
2308 | 2308 | |
2309 | 2309 | } |
2310 | 2310 | |
2311 | - $attachment_data = $wpdb->get_row("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=" . $post_id . " GROUP BY post_id"); |
|
2311 | + $attachment_data = $wpdb->get_row("SELECT ID, MIN(`menu_order`) FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id=".$post_id." GROUP BY post_id"); |
|
2312 | 2312 | |
2313 | 2313 | if (!empty($attachment_data)) { |
2314 | 2314 | |
2315 | 2315 | if ($attachment_data->ID) |
2316 | - $wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID); |
|
2316 | + $wpdb->query("UPDATE ".GEODIR_ATTACHMENT_TABLE." SET menu_order=1 WHERE ID=".$attachment_data->ID); |
|
2317 | 2317 | |
2318 | 2318 | } else { |
2319 | 2319 | |
@@ -2327,7 +2327,7 @@ discard block |
||
2327 | 2327 | |
2328 | 2328 | } |
2329 | 2329 | |
2330 | - $wpdb->query("UPDATE " . $tablename . " SET featured_image='' WHERE post_id =" . $post_id); |
|
2330 | + $wpdb->query("UPDATE ".$tablename." SET featured_image='' WHERE post_id =".$post_id); |
|
2331 | 2331 | |
2332 | 2332 | geodir_set_wp_featured_image($post_id); |
2333 | 2333 | |
@@ -2356,7 +2356,7 @@ discard block |
||
2356 | 2356 | { |
2357 | 2357 | |
2358 | 2358 | if (!get_option('geodir_default_rating_star_icon')) { |
2359 | - update_option('geodir_default_rating_star_icon', geodir_plugin_url() . '/geodirectory-assets/images/stars.png'); |
|
2359 | + update_option('geodir_default_rating_star_icon', geodir_plugin_url().'/geodirectory-assets/images/stars.png'); |
|
2360 | 2360 | } |
2361 | 2361 | |
2362 | 2362 | } |
@@ -2373,10 +2373,10 @@ discard block |
||
2373 | 2373 | * @global string $plugin_prefix Geodirectory plugin table prefix. |
2374 | 2374 | * @return array User listing count for each post type. |
2375 | 2375 | */ |
2376 | -function geodir_user_post_listing_count($user_id=null) |
|
2376 | +function geodir_user_post_listing_count($user_id = null) |
|
2377 | 2377 | { |
2378 | 2378 | global $wpdb, $plugin_prefix, $current_user; |
2379 | - if(!$user_id){ |
|
2379 | + if (!$user_id) { |
|
2380 | 2380 | $user_id = $current_user->ID; |
2381 | 2381 | } |
2382 | 2382 | |
@@ -2387,7 +2387,7 @@ discard block |
||
2387 | 2387 | $user_listing = array(); |
2388 | 2388 | if (is_array($all_posts) && !empty($all_posts)) { |
2389 | 2389 | foreach ($all_posts as $ptype) { |
2390 | - $total_posts = $wpdb->get_var("SELECT count( ID ) FROM " . $wpdb->prefix . "posts WHERE post_author=" . $user_id . " AND post_type='" . $ptype . "' AND ( post_status = 'publish' OR post_status = 'draft' OR post_status = 'private' )"); |
|
2390 | + $total_posts = $wpdb->get_var("SELECT count( ID ) FROM ".$wpdb->prefix."posts WHERE post_author=".$user_id." AND post_type='".$ptype."' AND ( post_status = 'publish' OR post_status = 'draft' OR post_status = 'private' )"); |
|
2391 | 2391 | |
2392 | 2392 | if ($total_posts > 0) { |
2393 | 2393 | $user_listing[$ptype] = $total_posts; |
@@ -2488,9 +2488,9 @@ discard block |
||
2488 | 2488 | } |
2489 | 2489 | |
2490 | 2490 | if (strpos($type['field_icon'], 'http') !== false) { |
2491 | - $field_icon = ' background: url(' . $type['field_icon'] . ') no-repeat left center;background-size:18px 18px;padding-left: 21px;'; |
|
2491 | + $field_icon = ' background: url('.$type['field_icon'].') no-repeat left center;background-size:18px 18px;padding-left: 21px;'; |
|
2492 | 2492 | } elseif (strpos($type['field_icon'], 'fa fa-') !== false) { |
2493 | - $field_icon = '<i class="' . $type['field_icon'] . '"></i>'; |
|
2493 | + $field_icon = '<i class="'.$type['field_icon'].'"></i>'; |
|
2494 | 2494 | } |
2495 | 2495 | |
2496 | 2496 | switch ($type['type']) { |
@@ -2498,7 +2498,7 @@ discard block |
||
2498 | 2498 | $i = 0; |
2499 | 2499 | $fieldset_count++; |
2500 | 2500 | $field_set_start = 1; |
2501 | - $fieldset_arr[$fieldset_count]['htmlvar_name'] = 'gd_tab_' . $fieldset_count; |
|
2501 | + $fieldset_arr[$fieldset_count]['htmlvar_name'] = 'gd_tab_'.$fieldset_count; |
|
2502 | 2502 | $fieldset_arr[$fieldset_count]['label'] = $label; |
2503 | 2503 | } |
2504 | 2504 | break; |
@@ -2531,7 +2531,7 @@ discard block |
||
2531 | 2531 | // all search engines that use the nofollow value exclude links that use it from their ranking calculation |
2532 | 2532 | $rel = strpos($website, get_site_url()) !== false ? '' : 'rel="nofollow"'; |
2533 | 2533 | |
2534 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '"><span class="geodir-i-website" style="' . $field_icon . '">' . $field_icon_af . ' <a href="' . $website . '" target="_blank" ' . $rel . ' ><strong>' . |
|
2534 | + $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'"><span class="geodir-i-website" style="'.$field_icon.'">'.$field_icon_af.' <a href="'.$website.'" target="_blank" '.$rel.' ><strong>'. |
|
2535 | 2535 | /** |
2536 | 2536 | * Filer the custom field website name. |
2537 | 2537 | * |
@@ -2540,7 +2540,7 @@ discard block |
||
2540 | 2540 | * @param string $website The website address. |
2541 | 2541 | * @param int $post->ID The post ID. |
2542 | 2542 | */ |
2543 | - apply_filters('geodir_custom_field_website_name', $title, $website, $post->ID) . '</strong></a></span></div>'; |
|
2543 | + apply_filters('geodir_custom_field_website_name', $title, $website, $post->ID).'</strong></a></span></div>'; |
|
2544 | 2544 | } |
2545 | 2545 | break; |
2546 | 2546 | case 'phone': { |
@@ -2555,11 +2555,11 @@ discard block |
||
2555 | 2555 | |
2556 | 2556 | $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
2557 | 2557 | |
2558 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-contact" style="' . $field_icon . '">' . $field_icon_af; |
|
2558 | + $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-contact" style="'.$field_icon.'">'.$field_icon_af; |
|
2559 | 2559 | if ($field_set_start == 1 && $site_title != '') { |
2560 | - $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
2560 | + $html .= ' '.__($site_title, 'geodirectory').': '; |
|
2561 | 2561 | } |
2562 | - $html .= ' </span>' . stripslashes($post->{$type['htmlvar_name']}) . '</div>'; |
|
2562 | + $html .= ' </span>'.stripslashes($post->{$type['htmlvar_name']}).'</div>'; |
|
2563 | 2563 | } |
2564 | 2564 | break; |
2565 | 2565 | case 'time': { |
@@ -2578,11 +2578,11 @@ discard block |
||
2578 | 2578 | |
2579 | 2579 | $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
2580 | 2580 | |
2581 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-time" style="' . $field_icon . '">' . $field_icon_af; |
|
2581 | + $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-time" style="'.$field_icon.'">'.$field_icon_af; |
|
2582 | 2582 | if ($field_set_start == 1 && $site_title != '') { |
2583 | - $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
2583 | + $html .= ' '.__($site_title, 'geodirectory').': '; |
|
2584 | 2584 | } |
2585 | - $html .= ' </span>' . stripslashes($value) . '</div>'; |
|
2585 | + $html .= ' </span>'.stripslashes($value).'</div>'; |
|
2586 | 2586 | } |
2587 | 2587 | break; |
2588 | 2588 | case 'datepicker': { |
@@ -2592,8 +2592,8 @@ discard block |
||
2592 | 2592 | $date_format = $date_format['date_format']; |
2593 | 2593 | } |
2594 | 2594 | |
2595 | - $search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format |
|
2596 | - $replace = array('d','j','l','m','n','F','Y');//PHP date format |
|
2595 | + $search = array('dd', 'd', 'DD', 'mm', 'm', 'MM', 'yy'); //jQuery UI datepicker format |
|
2596 | + $replace = array('d', 'j', 'l', 'm', 'n', 'F', 'Y'); //PHP date format |
|
2597 | 2597 | |
2598 | 2598 | $date_format = str_replace($search, $replace, $date_format); |
2599 | 2599 | |
@@ -2614,11 +2614,11 @@ discard block |
||
2614 | 2614 | |
2615 | 2615 | $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
2616 | 2616 | |
2617 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-datepicker" style="' . $field_icon . '">' . $field_icon_af; |
|
2617 | + $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-datepicker" style="'.$field_icon.'">'.$field_icon_af; |
|
2618 | 2618 | if ($field_set_start == 1 && $site_title != '') { |
2619 | - $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
2619 | + $html .= ' '.__($site_title, 'geodirectory').': '; |
|
2620 | 2620 | } |
2621 | - $html .= ' </span>' . $value . '</div>'; |
|
2621 | + $html .= ' </span>'.$value.'</div>'; |
|
2622 | 2622 | } |
2623 | 2623 | break; |
2624 | 2624 | case 'text': { |
@@ -2633,11 +2633,11 @@ discard block |
||
2633 | 2633 | |
2634 | 2634 | $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
2635 | 2635 | |
2636 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af; |
|
2636 | + $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-text" style="'.$field_icon.'">'.$field_icon_af; |
|
2637 | 2637 | if ($field_set_start == 1 && $site_title != '') { |
2638 | - $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
2638 | + $html .= ' '.__($site_title, 'geodirectory').': '; |
|
2639 | 2639 | } |
2640 | - $html .= ' </span>' . stripslashes($post->{$type['htmlvar_name']}) . '</div>'; |
|
2640 | + $html .= ' </span>'.stripslashes($post->{$type['htmlvar_name']}).'</div>'; |
|
2641 | 2641 | } |
2642 | 2642 | break; |
2643 | 2643 | case 'radio': { |
@@ -2674,13 +2674,13 @@ discard block |
||
2674 | 2674 | |
2675 | 2675 | $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
2676 | 2676 | |
2677 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-radio" style="' . $field_icon . '">' . $field_icon_af; |
|
2677 | + $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-radio" style="'.$field_icon.'">'.$field_icon_af; |
|
2678 | 2678 | |
2679 | 2679 | if ($field_set_start == 1 && $site_title != '') { |
2680 | - $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
2680 | + $html .= ' '.__($site_title, 'geodirectory').': '; |
|
2681 | 2681 | } |
2682 | 2682 | |
2683 | - $html .= ' </span>' . $html_val . '</div>'; |
|
2683 | + $html .= ' </span>'.$html_val.'</div>'; |
|
2684 | 2684 | } |
2685 | 2685 | } |
2686 | 2686 | break; |
@@ -2688,7 +2688,7 @@ discard block |
||
2688 | 2688 | $html_var = $type['htmlvar_name']; |
2689 | 2689 | $html_val = $type['htmlvar_name']; |
2690 | 2690 | |
2691 | - if ((int)$post->{$html_var} == 1) { |
|
2691 | + if ((int) $post->{$html_var} == 1) { |
|
2692 | 2692 | |
2693 | 2693 | if ($post->{$type['htmlvar_name']} == '1') { |
2694 | 2694 | $html_val = __('Yes', 'geodirectory'); |
@@ -2707,13 +2707,13 @@ discard block |
||
2707 | 2707 | |
2708 | 2708 | $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
2709 | 2709 | |
2710 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-checkbox" style="' . $field_icon . '">' . $field_icon_af; |
|
2710 | + $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-checkbox" style="'.$field_icon.'">'.$field_icon_af; |
|
2711 | 2711 | |
2712 | 2712 | if ($field_set_start == 1 && $site_title != '') { |
2713 | - $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
2713 | + $html .= ' '.__($site_title, 'geodirectory').': '; |
|
2714 | 2714 | } |
2715 | 2715 | |
2716 | - $html .= ' </span>' . $html_val . '</div>'; |
|
2716 | + $html .= ' </span>'.$html_val.'</div>'; |
|
2717 | 2717 | } |
2718 | 2718 | } |
2719 | 2719 | break; |
@@ -2743,11 +2743,11 @@ discard block |
||
2743 | 2743 | |
2744 | 2744 | $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
2745 | 2745 | |
2746 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af; |
|
2746 | + $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-select" style="'.$field_icon.'">'.$field_icon_af; |
|
2747 | 2747 | if ($field_set_start == 1 && $site_title != '') { |
2748 | - $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
2748 | + $html .= ' '.__($site_title, 'geodirectory').': '; |
|
2749 | 2749 | } |
2750 | - $html .= ' </span>' . $field_value . '</div>'; |
|
2750 | + $html .= ' </span>'.$field_value.'</div>'; |
|
2751 | 2751 | } |
2752 | 2752 | break; |
2753 | 2753 | case 'multiselect': { |
@@ -2781,16 +2781,16 @@ discard block |
||
2781 | 2781 | |
2782 | 2782 | $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
2783 | 2783 | |
2784 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af; |
|
2784 | + $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-select" style="'.$field_icon.'">'.$field_icon_af; |
|
2785 | 2785 | if ($field_set_start == 1 && $site_title != '') { |
2786 | - $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
2786 | + $html .= ' '.__($site_title, 'geodirectory').': '; |
|
2787 | 2787 | } |
2788 | 2788 | $html .= ' </span>'; |
2789 | 2789 | |
2790 | 2790 | if (count($option_values) > 1) { |
2791 | 2791 | $html .= '<ul>'; |
2792 | 2792 | foreach ($option_values as $val) { |
2793 | - $html .= '<li>' . $val . '</li>'; |
|
2793 | + $html .= '<li>'.$val.'</li>'; |
|
2794 | 2794 | } |
2795 | 2795 | $html .= '</ul>'; |
2796 | 2796 | } else { |
@@ -2811,11 +2811,11 @@ discard block |
||
2811 | 2811 | |
2812 | 2812 | $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
2813 | 2813 | |
2814 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af; |
|
2814 | + $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-email" style="'.$field_icon.'">'.$field_icon_af; |
|
2815 | 2815 | if ($field_set_start == 1 && $site_title != '') { |
2816 | - $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
2816 | + $html .= ' '.__($site_title, 'geodirectory').': '; |
|
2817 | 2817 | } |
2818 | - $html .= ' </span>' . stripslashes($post->{$type['htmlvar_name']}) . '</div>'; |
|
2818 | + $html .= ' </span>'.stripslashes($post->{$type['htmlvar_name']}).'</div>'; |
|
2819 | 2819 | } |
2820 | 2820 | break; |
2821 | 2821 | case 'textarea': { |
@@ -2830,11 +2830,11 @@ discard block |
||
2830 | 2830 | |
2831 | 2831 | $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
2832 | 2832 | |
2833 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af; |
|
2833 | + $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-text" style="'.$field_icon.'">'.$field_icon_af; |
|
2834 | 2834 | if ($field_set_start == 1 && $site_title != '') { |
2835 | - $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
2835 | + $html .= ' '.__($site_title, 'geodirectory').': '; |
|
2836 | 2836 | } |
2837 | - $html .= '</span>' . wpautop(stripslashes($post->{$type['htmlvar_name']})) . '</div>'; |
|
2837 | + $html .= '</span>'.wpautop(stripslashes($post->{$type['htmlvar_name']})).'</div>'; |
|
2838 | 2838 | } |
2839 | 2839 | break; |
2840 | 2840 | case 'html': { |
@@ -2849,11 +2849,11 @@ discard block |
||
2849 | 2849 | |
2850 | 2850 | $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
2851 | 2851 | |
2852 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af; |
|
2852 | + $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-text" style="'.$field_icon.'">'.$field_icon_af; |
|
2853 | 2853 | if ($field_set_start == 1 && $site_title != '') { |
2854 | - $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
2854 | + $html .= ' '.__($site_title, 'geodirectory').': '; |
|
2855 | 2855 | } |
2856 | - $html .= ' </span>' . wpautop(stripslashes($post->{$type['htmlvar_name']})) . '</div>'; |
|
2856 | + $html .= ' </span>'.wpautop(stripslashes($post->{$type['htmlvar_name']})).'</div>'; |
|
2857 | 2857 | } |
2858 | 2858 | break; |
2859 | 2859 | case 'file': { |
@@ -2864,7 +2864,7 @@ discard block |
||
2864 | 2864 | |
2865 | 2865 | if (!empty($files)) { |
2866 | 2866 | $extra_fields = !empty($type['extra_fields']) ? maybe_unserialize($type['extra_fields']) : NULL; |
2867 | - $allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types'] ) ? $extra_fields['gd_file_types'] : ''; |
|
2867 | + $allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types']) ? $extra_fields['gd_file_types'] : ''; |
|
2868 | 2868 | |
2869 | 2869 | $file_paths = ''; |
2870 | 2870 | foreach ($files as $file) { |
@@ -2893,9 +2893,9 @@ discard block |
||
2893 | 2893 | $file_paths .= '</a>'; |
2894 | 2894 | $file_paths .= '</div>'; |
2895 | 2895 | } else { |
2896 | - $ext_path = '_' . $html_var . '_'; |
|
2896 | + $ext_path = '_'.$html_var.'_'; |
|
2897 | 2897 | $filename = explode($ext_path, $filename); |
2898 | - $file_paths .= '<a href="' . $file . '" target="_blank">' . $filename[count($filename) - 1] . '</a>'; |
|
2898 | + $file_paths .= '<a href="'.$file.'" target="_blank">'.$filename[count($filename) - 1].'</a>'; |
|
2899 | 2899 | } |
2900 | 2900 | } |
2901 | 2901 | } |
@@ -2912,13 +2912,13 @@ discard block |
||
2912 | 2912 | $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
2913 | 2913 | |
2914 | 2914 | |
2915 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . ' geodir-custom-file-box" style="clear:both;"><span class="geodir-i-file" style="display:inline-block;vertical-align:top;padding-right:14px;' . $field_icon . '">' . $field_icon_af; |
|
2915 | + $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].' geodir-custom-file-box" style="clear:both;"><span class="geodir-i-file" style="display:inline-block;vertical-align:top;padding-right:14px;'.$field_icon.'">'.$field_icon_af; |
|
2916 | 2916 | |
2917 | 2917 | if ($field_set_start == 1 && $site_title != '') { |
2918 | - $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
2918 | + $html .= ' '.__($site_title, 'geodirectory').': '; |
|
2919 | 2919 | } |
2920 | 2920 | |
2921 | - $html .= ' </span>' . $file_paths . '</div>'; |
|
2921 | + $html .= ' </span>'.$file_paths.'</div>'; |
|
2922 | 2922 | } |
2923 | 2923 | } |
2924 | 2924 | } |
@@ -2969,7 +2969,7 @@ discard block |
||
2969 | 2969 | * @param string $htmlvar_name The field HTML var name. |
2970 | 2970 | */ |
2971 | 2971 | 'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, $htmlvar_name), |
2972 | - 'tab_content' => '<div class="geodir-company_info field-group">' . $fieldset_html . '</html>' |
|
2972 | + 'tab_content' => '<div class="geodir-company_info field-group">'.$fieldset_html.'</html>' |
|
2973 | 2973 | ); |
2974 | 2974 | } |
2975 | 2975 | } else { |
@@ -3029,7 +3029,7 @@ discard block |
||
3029 | 3029 | } |
3030 | 3030 | $status .= ")</strong>"; |
3031 | 3031 | |
3032 | - $html = '<span class="geodir-post-status">' . $status_icon . ' <font class="geodir-status-label">' . __('Status: ', 'geodirectory') . '</font>' . $status . '</span>'; |
|
3032 | + $html = '<span class="geodir-post-status">'.$status_icon.' <font class="geodir-status-label">'.__('Status: ', 'geodirectory').'</font>'.$status.'</span>'; |
|
3033 | 3033 | } |
3034 | 3034 | } |
3035 | 3035 | |
@@ -3109,7 +3109,7 @@ discard block |
||
3109 | 3109 | function geodir_no_rating_comment_text($content, $comment = '') |
3110 | 3110 | { |
3111 | 3111 | if (!is_admin()) { |
3112 | - return '<div class="description">' . $content . '</div>'; |
|
3112 | + return '<div class="description">'.$content.'</div>'; |
|
3113 | 3113 | } else { |
3114 | 3114 | return $content; |
3115 | 3115 | } |
@@ -3187,7 +3187,7 @@ discard block |
||
3187 | 3187 | $classes[] = 'gd-no-rating'; |
3188 | 3188 | } |
3189 | 3189 | |
3190 | - $classes[] = 'gd-map-' . geodir_map_name(); |
|
3190 | + $classes[] = 'gd-map-'.geodir_map_name(); |
|
3191 | 3191 | |
3192 | 3192 | return $classes; |
3193 | 3193 | } |
@@ -3207,7 +3207,7 @@ discard block |
||
3207 | 3207 | $class .= ' gd-no-rating'; |
3208 | 3208 | } |
3209 | 3209 | |
3210 | - $class .= ' gd-map-' . geodir_map_name(); |
|
3210 | + $class .= ' gd-map-'.geodir_map_name(); |
|
3211 | 3211 | |
3212 | 3212 | return $class; |
3213 | 3213 | } |
@@ -3242,7 +3242,7 @@ discard block |
||
3242 | 3242 | * @return array Translation texts. |
3243 | 3243 | */ |
3244 | 3244 | function geodir_load_gd_options_text_translation($translation_texts = array()) { |
3245 | - $translation_texts = !empty( $translation_texts ) && is_array( $translation_texts ) ? $translation_texts : array(); |
|
3245 | + $translation_texts = !empty($translation_texts) && is_array($translation_texts) ? $translation_texts : array(); |
|
3246 | 3246 | |
3247 | 3247 | $gd_options = array('geodir_post_submited_success_email_subject_admin', 'geodir_post_submited_success_email_content_admin', 'geodir_post_submited_success_email_subject', 'geodir_post_submited_success_email_content', 'geodir_forgot_password_subject', 'geodir_forgot_password_content', 'geodir_registration_success_email_subject', 'geodir_registration_success_email_content', 'geodir_post_published_email_subject', 'geodir_post_published_email_content', 'geodir_email_friend_subject', 'geodir_email_friend_content', 'geodir_email_enquiry_subject', 'geodir_email_enquiry_content', 'geodir_post_added_success_msg_content', 'geodir_post_edited_email_subject_admin', 'geodir_post_edited_email_content_admin'); |
3248 | 3248 |
@@ -46,31 +46,31 @@ discard block |
||
46 | 46 | function geodir_admin_styles() |
47 | 47 | { |
48 | 48 | |
49 | - wp_register_style('geodirectory-admin-css', geodir_plugin_url() . '/geodirectory-assets/css/admin.css', array(), GEODIRECTORY_VERSION); |
|
49 | + wp_register_style('geodirectory-admin-css', geodir_plugin_url().'/geodirectory-assets/css/admin.css', array(), GEODIRECTORY_VERSION); |
|
50 | 50 | wp_enqueue_style('geodirectory-admin-css'); |
51 | 51 | |
52 | - wp_register_style('geodirectory-frontend-style', geodir_plugin_url() . '/geodirectory-assets/css/style.css', array(), GEODIRECTORY_VERSION); |
|
52 | + wp_register_style('geodirectory-frontend-style', geodir_plugin_url().'/geodirectory-assets/css/style.css', array(), GEODIRECTORY_VERSION); |
|
53 | 53 | wp_enqueue_style('geodirectory-frontend-style'); |
54 | 54 | |
55 | - wp_register_style('geodir-chosen-style', geodir_plugin_url() . '/geodirectory-assets/css/chosen.css', array(), GEODIRECTORY_VERSION); |
|
55 | + wp_register_style('geodir-chosen-style', geodir_plugin_url().'/geodirectory-assets/css/chosen.css', array(), GEODIRECTORY_VERSION); |
|
56 | 56 | wp_enqueue_style('geodir-chosen-style'); |
57 | 57 | |
58 | - wp_register_style('geodirectory-jquery-ui-timepicker-css', geodir_plugin_url() . '/geodirectory-assets/css/jquery.ui.timepicker.css', array(), GEODIRECTORY_VERSION); |
|
58 | + wp_register_style('geodirectory-jquery-ui-timepicker-css', geodir_plugin_url().'/geodirectory-assets/css/jquery.ui.timepicker.css', array(), GEODIRECTORY_VERSION); |
|
59 | 59 | wp_enqueue_style('geodirectory-jquery-ui-timepicker-css'); |
60 | 60 | |
61 | - wp_register_style('geodirectory-jquery-ui-css', geodir_plugin_url() . '/geodirectory-assets/css/jquery-ui.css', array(), GEODIRECTORY_VERSION); |
|
61 | + wp_register_style('geodirectory-jquery-ui-css', geodir_plugin_url().'/geodirectory-assets/css/jquery-ui.css', array(), GEODIRECTORY_VERSION); |
|
62 | 62 | wp_enqueue_style('geodirectory-jquery-ui-css'); |
63 | 63 | |
64 | - wp_register_style('geodirectory-custom-fields-css', geodir_plugin_url() . '/geodirectory-assets/css/custom_field.css', array(), GEODIRECTORY_VERSION); |
|
64 | + wp_register_style('geodirectory-custom-fields-css', geodir_plugin_url().'/geodirectory-assets/css/custom_field.css', array(), GEODIRECTORY_VERSION); |
|
65 | 65 | wp_enqueue_style('geodirectory-custom-fields-css'); |
66 | 66 | |
67 | - wp_register_style('geodirectory-pluplodar-css', geodir_plugin_url() . '/geodirectory-assets/css/pluploader.css', array(), GEODIRECTORY_VERSION); |
|
67 | + wp_register_style('geodirectory-pluplodar-css', geodir_plugin_url().'/geodirectory-assets/css/pluploader.css', array(), GEODIRECTORY_VERSION); |
|
68 | 68 | wp_enqueue_style('geodirectory-pluplodar-css'); |
69 | 69 | |
70 | - wp_register_style('geodir-rating-style', geodir_plugin_url() . '/geodirectory-assets/css/jRating.jquery.css', array(), GEODIRECTORY_VERSION); |
|
70 | + wp_register_style('geodir-rating-style', geodir_plugin_url().'/geodirectory-assets/css/jRating.jquery.css', array(), GEODIRECTORY_VERSION); |
|
71 | 71 | wp_enqueue_style('geodir-rating-style'); |
72 | 72 | |
73 | - wp_register_style('geodir-rtl-style', geodir_plugin_url() . '/geodirectory-assets/css/rtl.css', array(), GEODIRECTORY_VERSION); |
|
73 | + wp_register_style('geodir-rtl-style', geodir_plugin_url().'/geodirectory-assets/css/rtl.css', array(), GEODIRECTORY_VERSION); |
|
74 | 74 | wp_enqueue_style('geodir-rtl-style'); |
75 | 75 | |
76 | 76 | } |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | wp_register_style('geodirectory-font-awesome', '//netdna.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css', array(), GEODIRECTORY_VERSION); |
90 | 90 | wp_enqueue_style('geodirectory-font-awesome'); |
91 | 91 | |
92 | - wp_register_script('geodirectory-admin', geodir_plugin_url() . '/geodirectory-assets/js/admin-req.min.js', array('jquery'), GEODIRECTORY_VERSION); |
|
92 | + wp_register_script('geodirectory-admin', geodir_plugin_url().'/geodirectory-assets/js/admin-req.min.js', array('jquery'), GEODIRECTORY_VERSION); |
|
93 | 93 | wp_enqueue_script('geodirectory-admin'); |
94 | 94 | |
95 | 95 | } |
@@ -108,59 +108,59 @@ discard block |
||
108 | 108 | |
109 | 109 | wp_enqueue_script('jquery'); |
110 | 110 | |
111 | - 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); |
|
111 | + 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); |
|
112 | 112 | |
113 | - wp_register_script('chosen', geodir_plugin_url() . '/geodirectory-assets/js/chosen.jquery.js', array('jquery'), GEODIRECTORY_VERSION); |
|
113 | + wp_register_script('chosen', geodir_plugin_url().'/geodirectory-assets/js/chosen.jquery.js', array('jquery'), GEODIRECTORY_VERSION); |
|
114 | 114 | wp_enqueue_script('chosen'); |
115 | 115 | |
116 | - wp_register_script('geodirectory-choose-ajax', geodir_plugin_url() . '/geodirectory-assets/js/ajax-chosen.js', array(), GEODIRECTORY_VERSION); |
|
116 | + wp_register_script('geodirectory-choose-ajax', geodir_plugin_url().'/geodirectory-assets/js/ajax-chosen.js', array(), GEODIRECTORY_VERSION); |
|
117 | 117 | wp_enqueue_script('geodirectory-choose-ajax'); |
118 | 118 | |
119 | 119 | if (isset($_REQUEST['listing_type'])) { |
120 | - wp_register_script('geodirectory-custom-fields-script', geodir_plugin_url() . '/geodirectory-assets/js/custom_fields.js', array(), GEODIRECTORY_VERSION); |
|
120 | + wp_register_script('geodirectory-custom-fields-script', geodir_plugin_url().'/geodirectory-assets/js/custom_fields.js', array(), GEODIRECTORY_VERSION); |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | wp_enqueue_script('geodirectory-custom-fields-script'); |
124 | - $plugin_path = geodir_plugin_url() . '/geodirectory-functions/cat-meta-functions'; |
|
124 | + $plugin_path = geodir_plugin_url().'/geodirectory-functions/cat-meta-functions'; |
|
125 | 125 | |
126 | - wp_enqueue_script('tax-meta-clss', $plugin_path . '/js/tax-meta-clss.js', array('jquery'), null, true); |
|
126 | + wp_enqueue_script('tax-meta-clss', $plugin_path.'/js/tax-meta-clss.js', array('jquery'), null, true); |
|
127 | 127 | |
128 | 128 | if (in_array($geodir_map_name, array('auto', 'google'))) { |
129 | - $map_lang = "&language=" . geodir_get_map_default_language(); |
|
129 | + $map_lang = "&language=".geodir_get_map_default_language(); |
|
130 | 130 | /** This filter is documented in geodirectory_template_tags.php */ |
131 | 131 | $map_extra = apply_filters('geodir_googlemap_script_extra', ''); |
132 | - wp_enqueue_script('geodirectory-googlemap-script', '//maps.google.com/maps/api/js?' . $map_lang . $map_extra, '', NULL); |
|
132 | + wp_enqueue_script('geodirectory-googlemap-script', '//maps.google.com/maps/api/js?'.$map_lang.$map_extra, '', NULL); |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | if ($geodir_map_name == 'osm') { |
136 | 136 | // Leaflet OpenStreetMap |
137 | - wp_register_style('geodirectory-leaflet-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION); |
|
137 | + wp_register_style('geodirectory-leaflet-style', geodir_plugin_url().'/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION); |
|
138 | 138 | wp_enqueue_style('geodirectory-leaflet-style'); |
139 | 139 | |
140 | - wp_register_script('geodirectory-leaflet-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION); |
|
140 | + wp_register_script('geodirectory-leaflet-script', geodir_plugin_url().'/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION); |
|
141 | 141 | wp_enqueue_script('geodirectory-leaflet-script'); |
142 | 142 | |
143 | - wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/osm.geocode.js', array('geodirectory-leaflet-script'), GEODIRECTORY_VERSION); |
|
143 | + wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url().'/geodirectory-assets/leaflet/osm.geocode.js', array('geodirectory-leaflet-script'), GEODIRECTORY_VERSION); |
|
144 | 144 | wp_enqueue_script('geodirectory-leaflet-geo-script'); |
145 | 145 | } |
146 | - wp_enqueue_script( 'jquery-ui-autocomplete' ); |
|
146 | + wp_enqueue_script('jquery-ui-autocomplete'); |
|
147 | 147 | |
148 | - wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION,true); |
|
148 | + wp_register_script('geodirectory-goMap-script', geodir_plugin_url().'/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION, true); |
|
149 | 149 | wp_enqueue_script('geodirectory-goMap-script'); |
150 | 150 | |
151 | - wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.js', array(), GEODIRECTORY_VERSION); |
|
151 | + wp_register_script('geodirectory-goMap-script', geodir_plugin_url().'/geodirectory-assets/js/goMap.js', array(), GEODIRECTORY_VERSION); |
|
152 | 152 | wp_enqueue_script('geodirectory-goMap-script'); |
153 | 153 | |
154 | 154 | // font awesome rating script |
155 | 155 | if (get_option('geodir_reviewrating_enable_font_awesome')) { |
156 | - wp_register_script('geodir-barrating-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.barrating.min.js', array(), GEODIRECTORY_VERSION); |
|
156 | + wp_register_script('geodir-barrating-js', geodir_plugin_url().'/geodirectory-assets/js/jquery.barrating.min.js', array(), GEODIRECTORY_VERSION); |
|
157 | 157 | wp_enqueue_script('geodir-barrating-js'); |
158 | 158 | } else { // default rating script |
159 | - wp_register_script('geodir-jRating-js', geodir_plugin_url() . '/geodirectory-assets/js/jRating.jquery.js', array(), GEODIRECTORY_VERSION); |
|
159 | + wp_register_script('geodir-jRating-js', geodir_plugin_url().'/geodirectory-assets/js/jRating.jquery.js', array(), GEODIRECTORY_VERSION); |
|
160 | 160 | wp_enqueue_script('geodir-jRating-js'); |
161 | 161 | } |
162 | 162 | |
163 | - wp_register_script('geodir-on-document-load', geodir_plugin_url() . '/geodirectory-assets/js/on_document_load.js', array(), GEODIRECTORY_VERSION); |
|
163 | + wp_register_script('geodir-on-document-load', geodir_plugin_url().'/geodirectory-assets/js/on_document_load.js', array(), GEODIRECTORY_VERSION); |
|
164 | 164 | wp_enqueue_script('geodir-on-document-load'); |
165 | 165 | |
166 | 166 | |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | wp_enqueue_script('plupload-all'); |
169 | 169 | wp_enqueue_script('jquery-ui-sortable'); |
170 | 170 | |
171 | - wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.js', array(), GEODIRECTORY_VERSION); |
|
171 | + wp_register_script('geodirectory-plupload-script', geodir_plugin_url().'/geodirectory-assets/js/geodirectory-plupload.js', array(), GEODIRECTORY_VERSION); |
|
172 | 172 | wp_enqueue_script('geodirectory-plupload-script'); |
173 | 173 | |
174 | 174 | // SCRIPT FOR UPLOAD END |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | wp_localize_script('geodirectory-custom-fields-script', 'geodir_admin_ajax', $ajax_cons_data); |
223 | 223 | |
224 | 224 | |
225 | - wp_register_script('geodirectory-admin-script', geodir_plugin_url() . '/geodirectory-assets/js/admin.js', array(), GEODIRECTORY_VERSION); |
|
225 | + wp_register_script('geodirectory-admin-script', geodir_plugin_url().'/geodirectory-assets/js/admin.js', array(), GEODIRECTORY_VERSION); |
|
226 | 226 | wp_enqueue_script('geodirectory-admin-script'); |
227 | 227 | |
228 | 228 | wp_enqueue_style('farbtastic'); |
@@ -230,10 +230,10 @@ discard block |
||
230 | 230 | |
231 | 231 | $screen = get_current_screen(); |
232 | 232 | if ($screen->base == 'post' && in_array($screen->post_type, geodir_get_posttypes())) { |
233 | - wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url() . '/geodirectory-assets/js/listing_validation_admin.js'); |
|
233 | + wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url().'/geodirectory-assets/js/listing_validation_admin.js'); |
|
234 | 234 | } |
235 | 235 | |
236 | - $ajax_cons_data = array('url' => __(get_option('siteurl') . '?geodir_ajax=true')); |
|
236 | + $ajax_cons_data = array('url' => __(get_option('siteurl').'?geodir_ajax=true')); |
|
237 | 237 | wp_localize_script('geodirectory-admin-script', 'geodir_ajax', $ajax_cons_data); |
238 | 238 | |
239 | 239 | } |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | |
257 | 257 | if (current_user_can('manage_options')) $menu[] = array('', 'read', 'separator-geodirectory', '', 'wp-menu-separator geodirectory'); |
258 | 258 | |
259 | - add_menu_page(__('Geodirectory', 'geodirectory'), __('Geodirectory', 'geodirectory'), 'manage_options', 'geodirectory', 'geodir_admin_panel', geodir_plugin_url() . '/geodirectory-assets/images/favicon.ico', '55.1984'); |
|
259 | + add_menu_page(__('Geodirectory', 'geodirectory'), __('Geodirectory', 'geodirectory'), 'manage_options', 'geodirectory', 'geodir_admin_panel', geodir_plugin_url().'/geodirectory-assets/images/favicon.ico', '55.1984'); |
|
260 | 260 | |
261 | 261 | |
262 | 262 | } |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | $geodir_menu_order[] = 'separator-geodirectory'; |
291 | 291 | if (!empty($post_types)) { |
292 | 292 | foreach ($post_types as $post_type) { |
293 | - $geodir_menu_order[] = 'edit.php?post_type=' . $post_type; |
|
293 | + $geodir_menu_order[] = 'edit.php?post_type='.$post_type; |
|
294 | 294 | } |
295 | 295 | } |
296 | 296 | $geodir_menu_order[] = $item; |
@@ -333,8 +333,8 @@ discard block |
||
333 | 333 | { |
334 | 334 | if (isset($_REQUEST['installed']) && $_REQUEST['installed'] != '') { |
335 | 335 | echo '<div id="message" class="updated fade"> |
336 | - <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> |
|
337 | - <p><strong>' . __('Geodirectory has been installed and setup. Enjoy :)', 'geodirectory') . '</strong></p> |
|
336 | + <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> |
|
337 | + <p><strong>' . __('Geodirectory has been installed and setup. Enjoy :)', 'geodirectory').'</strong></p> |
|
338 | 338 | </div>'; |
339 | 339 | |
340 | 340 | } |
@@ -342,7 +342,7 @@ discard block |
||
342 | 342 | if (isset($_REQUEST['msg']) && $_REQUEST['msg'] != '') { |
343 | 343 | switch ($_REQUEST['msg']) { |
344 | 344 | case 'success': |
345 | - echo '<div id="message" class="updated fade"><p><strong>' . __('Your settings have been saved.', 'geodirectory') . '</strong></p></div>'; |
|
345 | + echo '<div id="message" class="updated fade"><p><strong>'.__('Your settings have been saved.', 'geodirectory').'</strong></p></div>'; |
|
346 | 346 | flush_rewrite_rules(false); |
347 | 347 | |
348 | 348 | break; |
@@ -350,20 +350,20 @@ discard block |
||
350 | 350 | $gderr = isset($_REQUEST['gderr']) ? $_REQUEST['gderr'] : ''; |
351 | 351 | |
352 | 352 | if ($gderr == 21) |
353 | - 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>'; |
|
353 | + 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>'; |
|
354 | 354 | else |
355 | - echo '<div id="message" class="error fade"><p><strong>' . __('Error: Your settings have not been saved, please try again.', 'geodirectory') . '</strong></p></div>'; |
|
355 | + echo '<div id="message" class="error fade"><p><strong>'.__('Error: Your settings have not been saved, please try again.', 'geodirectory').'</strong></p></div>'; |
|
356 | 356 | break; |
357 | 357 | } |
358 | 358 | } |
359 | 359 | |
360 | 360 | if (!geodir_is_default_location_set()) { |
361 | - 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>'; |
|
361 | + 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>'; |
|
362 | 362 | |
363 | 363 | } |
364 | 364 | |
365 | 365 | if (!function_exists('curl_init')) { |
366 | - 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>'; |
|
366 | + 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>'; |
|
367 | 367 | |
368 | 368 | } |
369 | 369 | } |
@@ -379,18 +379,18 @@ discard block |
||
379 | 379 | function geodir_handle_option_form_submit($current_tab) |
380 | 380 | { |
381 | 381 | global $geodir_settings; |
382 | - if (file_exists(dirname(__FILE__) . '/option-pages/' . $current_tab . '_array.php')) { |
|
382 | + if (file_exists(dirname(__FILE__).'/option-pages/'.$current_tab.'_array.php')) { |
|
383 | 383 | /** |
384 | 384 | * Contains settings array for current tab. |
385 | 385 | * |
386 | 386 | * @since 1.0.0 |
387 | 387 | * @package GeoDirectory |
388 | 388 | */ |
389 | - include_once('option-pages/' . $current_tab . '_array.php'); |
|
389 | + include_once('option-pages/'.$current_tab.'_array.php'); |
|
390 | 390 | } |
391 | 391 | if (isset($_POST) && $_POST && isset($_REQUEST['page']) && $_REQUEST['page'] == 'geodirectory') : |
392 | 392 | if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'geodir-settings')) die(__('Action failed. Please refresh the page and retry.', 'geodirectory')); |
393 | - if (!wp_verify_nonce($_REQUEST['_wpnonce-' . $current_tab], 'geodir-settings-' . $current_tab)) die(__('Action failed. Please refresh the page and retry.', 'geodirectory')); |
|
393 | + if (!wp_verify_nonce($_REQUEST['_wpnonce-'.$current_tab], 'geodir-settings-'.$current_tab)) die(__('Action failed. Please refresh the page and retry.', 'geodirectory')); |
|
394 | 394 | |
395 | 395 | /** |
396 | 396 | * Fires before updating geodirectory admin settings. |
@@ -423,13 +423,13 @@ discard block |
||
423 | 423 | * @param string $current_tab The current settings tab name. |
424 | 424 | * @param array $geodir_settings[$current_tab] The array of settings for the current settings tab. |
425 | 425 | */ |
426 | - do_action('geodir_update_options_' . $current_tab, $geodir_settings[$current_tab]); |
|
426 | + do_action('geodir_update_options_'.$current_tab, $geodir_settings[$current_tab]); |
|
427 | 427 | |
428 | 428 | flush_rewrite_rules(false); |
429 | 429 | |
430 | 430 | $current_tab = isset($_REQUEST['tab']) ? $_REQUEST['tab'] : ''; |
431 | 431 | |
432 | - $redirect_url = admin_url('admin.php?page=geodirectory&tab=' . $current_tab . '&active_tab=' . $_REQUEST['active_tab'] . '&msg=success'); |
|
432 | + $redirect_url = admin_url('admin.php?page=geodirectory&tab='.$current_tab.'&active_tab='.$_REQUEST['active_tab'].'&msg=success'); |
|
433 | 433 | |
434 | 434 | wp_redirect($redirect_url); |
435 | 435 | exit(); |
@@ -439,7 +439,7 @@ discard block |
||
439 | 439 | } |
440 | 440 | |
441 | 441 | |
442 | -if (!function_exists('geodir_autoinstall_admin_header') && (get_option('geodir_installed') || defined( 'GD_TESTING_MODE' ))) { |
|
442 | +if (!function_exists('geodir_autoinstall_admin_header') && (get_option('geodir_installed') || defined('GD_TESTING_MODE'))) { |
|
443 | 443 | /** |
444 | 444 | * GeoDirectory dummy data installation. |
445 | 445 | * |
@@ -455,18 +455,18 @@ discard block |
||
455 | 455 | global $wpdb, $plugin_prefix; |
456 | 456 | |
457 | 457 | if (!geodir_is_default_location_set()) { |
458 | - 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>'; |
|
458 | + 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>'; |
|
459 | 459 | } else { |
460 | 460 | |
461 | - $geodir_url = admin_url() . 'admin.php?page=geodirectory&tab=general_settings&active_tab='; |
|
461 | + $geodir_url = admin_url().'admin.php?page=geodirectory&tab=general_settings&active_tab='; |
|
462 | 462 | |
463 | - $post_counts = $wpdb->get_var("SELECT count(post_id) FROM " . $plugin_prefix . $post_type . "_detail WHERE post_dummy='1'"); |
|
463 | + $post_counts = $wpdb->get_var("SELECT count(post_id) FROM ".$plugin_prefix.$post_type."_detail WHERE post_dummy='1'"); |
|
464 | 464 | |
465 | 465 | if ($post_counts > 0) { |
466 | 466 | $nonce = wp_create_nonce('geodir_dummy_posts_delete_noncename'); |
467 | 467 | |
468 | - $dummy_msg = '<div id="" class="geodir_auto_install updated highlight fade"><p><b>' . SAMPLE_DATA_SHOW_MSG . '</b><br /><a id="geodir_dummy_delete" class="button_delete" onclick="geodir_autoinstall(this,\'geodir_dummy_delete\',\'' . $nonce . '\',\'' . $post_type . '\')" href="javascript:void(0);" redirect_to="' . $geodir_url . '" >' . DELETE_BTN_SAMPLE_MSG . '</a></p></div>'; |
|
469 | - $dummy_msg .= '<div id="" style="display:none;" class="geodir_show_progress updated highlight fade"><p><b>' . GEODIR_SAMPLE_DATA_DELETE_MSG . '</b><br><img src="' . geodir_plugin_url() . '/geodirectory-assets/images/loadingAnimation.gif" /></p></div>'; |
|
468 | + $dummy_msg = '<div id="" class="geodir_auto_install updated highlight fade"><p><b>'.SAMPLE_DATA_SHOW_MSG.'</b><br /><a id="geodir_dummy_delete" class="button_delete" onclick="geodir_autoinstall(this,\'geodir_dummy_delete\',\''.$nonce.'\',\''.$post_type.'\')" href="javascript:void(0);" redirect_to="'.$geodir_url.'" >'.DELETE_BTN_SAMPLE_MSG.'</a></p></div>'; |
|
469 | + $dummy_msg .= '<div id="" style="display:none;" class="geodir_show_progress updated highlight fade"><p><b>'.GEODIR_SAMPLE_DATA_DELETE_MSG.'</b><br><img src="'.geodir_plugin_url().'/geodirectory-assets/images/loadingAnimation.gif" /></p></div>'; |
|
470 | 470 | } else { |
471 | 471 | $options_list = ''; |
472 | 472 | for ($option = 1; $option <= 30; $option++) { |
@@ -474,13 +474,13 @@ discard block |
||
474 | 474 | if ($option == 10) |
475 | 475 | $selected = 'selected="selected"'; |
476 | 476 | |
477 | - $options_list .= '<option ' . $selected . ' value="' . $option . '">' . $option . '</option>'; |
|
477 | + $options_list .= '<option '.$selected.' value="'.$option.'">'.$option.'</option>'; |
|
478 | 478 | } |
479 | 479 | |
480 | 480 | $nonce = wp_create_nonce('geodir_dummy_posts_insert_noncename'); |
481 | 481 | |
482 | - $dummy_msg = '<div id="" class="geodir_auto_install updated highlight fade"><p><b>' . AUTO_INSATALL_MSG . '</b><br /><select class="selected_sample_data">' . $options_list . '</select><a id="geodir_dummy_insert" class="button_insert" href="javascript:void(0);" onclick="geodir_autoinstall(this,\'geodir_dummy_insert\',\'' . $nonce . '\',\'' . $post_type . '\')" redirect_to="' . $geodir_url . '" >' . INSERT_BTN_SAMPLE_MSG . '</a></p></div>'; |
|
483 | - $dummy_msg .= '<div id="" style="display:none;" class="geodir_show_progress updated highlight fade"><p><b>' . GEODIR_SAMPLE_DATA_IMPORT_MSG . '</b><br><img src="' . geodir_plugin_url() . '/geodirectory-assets/images/loadingAnimation.gif" /><br><span class="dummy_post_inserted"></span></div>'; |
|
482 | + $dummy_msg = '<div id="" class="geodir_auto_install updated highlight fade"><p><b>'.AUTO_INSATALL_MSG.'</b><br /><select class="selected_sample_data">'.$options_list.'</select><a id="geodir_dummy_insert" class="button_insert" href="javascript:void(0);" onclick="geodir_autoinstall(this,\'geodir_dummy_insert\',\''.$nonce.'\',\''.$post_type.'\')" redirect_to="'.$geodir_url.'" >'.INSERT_BTN_SAMPLE_MSG.'</a></p></div>'; |
|
483 | + $dummy_msg .= '<div id="" style="display:none;" class="geodir_show_progress updated highlight fade"><p><b>'.GEODIR_SAMPLE_DATA_IMPORT_MSG.'</b><br><img src="'.geodir_plugin_url().'/geodirectory-assets/images/loadingAnimation.gif" /><br><span class="dummy_post_inserted"></span></div>'; |
|
484 | 484 | |
485 | 485 | } |
486 | 486 | echo $dummy_msg; |
@@ -488,14 +488,14 @@ discard block |
||
488 | 488 | <script> |
489 | 489 | <?php |
490 | 490 | $default_location = geodir_get_default_location(); |
491 | - $city = isset($default_location->city) ? $default_location->city : ''; |
|
492 | - $region =isset($default_location->region) ? $default_location->region : ''; |
|
493 | - $country =isset($default_location->country) ? $default_location->country : ''; |
|
494 | - $city_latitude =isset($default_location->city_latitude) ? $default_location->city_latitude : ''; |
|
495 | - $city_longitude =isset($default_location->city_longitude) ? $default_location->city_longitude : ''; |
|
491 | + $city = isset($default_location->city) ? $default_location->city : ''; |
|
492 | + $region = isset($default_location->region) ? $default_location->region : ''; |
|
493 | + $country = isset($default_location->country) ? $default_location->country : ''; |
|
494 | + $city_latitude = isset($default_location->city_latitude) ? $default_location->city_latitude : ''; |
|
495 | + $city_longitude = isset($default_location->city_longitude) ? $default_location->city_longitude : ''; |
|
496 | 496 | ?> |
497 | 497 | var geocoder = window.gdMaps == 'google' ? new google.maps.Geocoder() : null; |
498 | - var CITY_ADDRESS = '<?php echo $city.','.$region.','.$country;?>'; |
|
498 | + var CITY_ADDRESS = '<?php echo $city.','.$region.','.$country; ?>'; |
|
499 | 499 | var bound_lat_lng; |
500 | 500 | var latlng = ['<?php echo $city_latitude; ?>', <?php echo $city_longitude; ?>]; |
501 | 501 | var lat = <?php echo $city_latitude; ?>; |
@@ -538,7 +538,7 @@ discard block |
||
538 | 538 | ); |
539 | 539 | |
540 | 540 | } else { |
541 | - alert("<?php _e('Geocode was not successful for the following reason:','geodirectory');?> " + status); |
|
541 | + alert("<?php _e('Geocode was not successful for the following reason:', 'geodirectory'); ?> " + status); |
|
542 | 542 | } |
543 | 543 | }); |
544 | 544 | } |
@@ -551,7 +551,7 @@ discard block |
||
551 | 551 | var total_dummy_post_count = jQuery('#sub_' + active_tab).find('.selected_sample_data').val(); |
552 | 552 | |
553 | 553 | if (id == 'geodir_dummy_delete') { |
554 | - if (confirm('<?php _e('Are you sure you want to delete dummy data?' , 'geodirectory'); ?>')) { |
|
554 | + if (confirm('<?php _e('Are you sure you want to delete dummy data?', 'geodirectory'); ?>')) { |
|
555 | 555 | jQuery('#sub_' + active_tab).find('.geodir_auto_install').hide(); |
556 | 556 | jQuery('#sub_' + active_tab).find('.geodir_show_progress').show(); |
557 | 557 | jQuery.post('<?php echo geodir_get_ajax_url(); ?>&geodir_autofill=' + id + '&posttype=' + posttype + '&_wpnonce=' + nonce, |
@@ -570,7 +570,7 @@ discard block |
||
570 | 570 | jQuery.post('<?php echo geodir_get_ajax_url(); ?>&geodir_autofill=' + id + '&posttype=' + posttype + '&insert_dummy_post_index=' + dummy_post_index + '&city_bound_lat1=' + bound_lat_lng[0] + '&city_bound_lng1=' + bound_lat_lng[1] + '&city_bound_lat2=' + bound_lat_lng[2] + '&city_bound_lng2=' + bound_lat_lng[3] + '&_wpnonce=' + nonce, |
571 | 571 | function (data) { |
572 | 572 | |
573 | - 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 + ''); |
|
573 | + 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 + ''); |
|
574 | 574 | dummy_post_index++; |
575 | 575 | if (dummy_post_index <= total_dummy_post_count) |
576 | 576 | geodir_autoinstall(obj, id, nonce, posttype); |
@@ -627,7 +627,7 @@ discard block |
||
627 | 627 | global $wpdb, $plugin_prefix; |
628 | 628 | |
629 | 629 | |
630 | - $post_ids = $wpdb->get_results("SELECT post_id FROM " . $plugin_prefix . "gd_place_detail WHERE post_dummy='1'"); |
|
630 | + $post_ids = $wpdb->get_results("SELECT post_id FROM ".$plugin_prefix."gd_place_detail WHERE post_dummy='1'"); |
|
631 | 631 | |
632 | 632 | |
633 | 633 | foreach ($post_ids as $post_ids_obj) { |
@@ -635,7 +635,7 @@ discard block |
||
635 | 635 | } |
636 | 636 | |
637 | 637 | //double check posts are deleted |
638 | - $wpdb->get_results("DELETE FROM " . $plugin_prefix . "gd_place_detail WHERE post_dummy='1'"); |
|
638 | + $wpdb->get_results("DELETE FROM ".$plugin_prefix."gd_place_detail WHERE post_dummy='1'"); |
|
639 | 639 | } |
640 | 640 | |
641 | 641 | /** |
@@ -673,14 +673,14 @@ discard block |
||
673 | 673 | |
674 | 674 | |
675 | 675 | if (geodir_dummy_folder_exists()) |
676 | - $dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy/cat_icon"; |
|
676 | + $dummy_image_url = geodir_plugin_url()."/geodirectory-admin/dummy/cat_icon"; |
|
677 | 677 | else |
678 | 678 | $dummy_image_url = 'http://www.wpgeodirectory.com/dummy/cat_icon'; |
679 | 679 | |
680 | 680 | $dummy_image_url = apply_filters('place_dummy_cat_image_url', $dummy_image_url); |
681 | 681 | |
682 | 682 | $catname = str_replace(' ', '_', $catname); |
683 | - $uploaded = (array)fetch_remote_file("$dummy_image_url/" . $catname . ".png"); |
|
683 | + $uploaded = (array) fetch_remote_file("$dummy_image_url/".$catname.".png"); |
|
684 | 684 | |
685 | 685 | if (empty($uploaded['error'])) { |
686 | 686 | $new_path = $uploaded['file']; |
@@ -690,7 +690,7 @@ discard block |
||
690 | 690 | $wp_filetype = wp_check_filetype(basename($new_path), null); |
691 | 691 | |
692 | 692 | $attachment = array( |
693 | - 'guid' => $uploads['baseurl'] . '/' . basename($new_path), |
|
693 | + 'guid' => $uploads['baseurl'].'/'.basename($new_path), |
|
694 | 694 | 'post_mime_type' => $wp_filetype['type'], |
695 | 695 | 'post_title' => preg_replace('/\.[^.]+$/', '', basename($new_path)), |
696 | 696 | 'post_content' => '', |
@@ -700,7 +700,7 @@ discard block |
||
700 | 700 | |
701 | 701 | // you must first include the image.php file |
702 | 702 | // for the function wp_generate_attachment_metadata() to work |
703 | - require_once(ABSPATH . 'wp-admin/includes/image.php'); |
|
703 | + require_once(ABSPATH.'wp-admin/includes/image.php'); |
|
704 | 704 | $attach_data = wp_generate_attachment_metadata($attach_id, $new_path); |
705 | 705 | wp_update_attachment_metadata($attach_id, $attach_data); |
706 | 706 | |
@@ -717,14 +717,14 @@ discard block |
||
717 | 717 | $last_catid = wp_insert_term($catname, 'gd_placecategory'); |
718 | 718 | |
719 | 719 | if (geodir_dummy_folder_exists()) |
720 | - $dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy/cat_icon"; |
|
720 | + $dummy_image_url = geodir_plugin_url()."/geodirectory-admin/dummy/cat_icon"; |
|
721 | 721 | else |
722 | 722 | $dummy_image_url = 'http://www.wpgeodirectory.com/dummy/cat_icon'; |
723 | 723 | |
724 | 724 | $dummy_image_url = apply_filters('place_dummy_cat_image_url', $dummy_image_url); |
725 | 725 | |
726 | 726 | $catname = str_replace(' ', '_', $catname); |
727 | - $uploaded = (array)fetch_remote_file("$dummy_image_url/" . $catname . ".png"); |
|
727 | + $uploaded = (array) fetch_remote_file("$dummy_image_url/".$catname.".png"); |
|
728 | 728 | |
729 | 729 | if (empty($uploaded['error'])) { |
730 | 730 | $new_path = $uploaded['file']; |
@@ -734,7 +734,7 @@ discard block |
||
734 | 734 | $wp_filetype = wp_check_filetype(basename($new_path), null); |
735 | 735 | |
736 | 736 | $attachment = array( |
737 | - 'guid' => $uploads['baseurl'] . '/' . basename($new_path), |
|
737 | + 'guid' => $uploads['baseurl'].'/'.basename($new_path), |
|
738 | 738 | 'post_mime_type' => $wp_filetype['type'], |
739 | 739 | 'post_title' => preg_replace('/\.[^.]+$/', '', basename($new_path)), |
740 | 740 | 'post_content' => '', |
@@ -746,7 +746,7 @@ discard block |
||
746 | 746 | |
747 | 747 | // you must first include the image.php file |
748 | 748 | // for the function wp_generate_attachment_metadata() to work |
749 | - require_once(ABSPATH . 'wp-admin/includes/image.php'); |
|
749 | + require_once(ABSPATH.'wp-admin/includes/image.php'); |
|
750 | 750 | $attach_data = wp_generate_attachment_metadata($attach_id, $new_path); |
751 | 751 | wp_update_attachment_metadata($attach_id, $attach_data); |
752 | 752 | |
@@ -788,18 +788,18 @@ discard block |
||
788 | 788 | |
789 | 789 | elseif (isset($value['type']) && $value['type'] == 'image_width') : |
790 | 790 | |
791 | - if (isset($value['id']) && isset($_POST[$value['id'] . '_width'])) { |
|
792 | - update_option($value['id'] . '_width', $_POST[$value['id'] . '_width']); |
|
793 | - update_option($value['id'] . '_height', $_POST[$value['id'] . '_height']); |
|
794 | - if (isset($_POST[$value['id'] . '_crop'])) : |
|
795 | - update_option($value['id'] . '_crop', 1); |
|
791 | + if (isset($value['id']) && isset($_POST[$value['id'].'_width'])) { |
|
792 | + update_option($value['id'].'_width', $_POST[$value['id'].'_width']); |
|
793 | + update_option($value['id'].'_height', $_POST[$value['id'].'_height']); |
|
794 | + if (isset($_POST[$value['id'].'_crop'])) : |
|
795 | + update_option($value['id'].'_crop', 1); |
|
796 | 796 | else : |
797 | - update_option($value['id'] . '_crop', 0); |
|
797 | + update_option($value['id'].'_crop', 0); |
|
798 | 798 | endif; |
799 | 799 | } else { |
800 | - update_option($value['id'] . '_width', $value['std']); |
|
801 | - update_option($value['id'] . '_height', $value['std']); |
|
802 | - update_option($value['id'] . '_crop', 1); |
|
800 | + update_option($value['id'].'_width', $value['std']); |
|
801 | + update_option($value['id'].'_height', $value['std']); |
|
802 | + update_option($value['id'].'_crop', 1); |
|
803 | 803 | } |
804 | 804 | |
805 | 805 | elseif (isset($value['type']) && $value['type'] == 'map') : |
@@ -841,12 +841,12 @@ discard block |
||
841 | 841 | elseif (isset($value['type']) && $value['type'] == 'file') : |
842 | 842 | |
843 | 843 | |
844 | - if (isset($_POST[$value['id'] . '_remove']) && $_POST[$value['id'] . '_remove']) {// if remove is set then remove the file |
|
844 | + if (isset($_POST[$value['id'].'_remove']) && $_POST[$value['id'].'_remove']) {// if remove is set then remove the file |
|
845 | 845 | |
846 | 846 | if (get_option($value['id'])) { |
847 | 847 | $image_name_arr = explode('/', get_option($value['id'])); |
848 | 848 | $noimg_name = end($image_name_arr); |
849 | - $img_path = $uploads['path'] . '/' . $noimg_name; |
|
849 | + $img_path = $uploads['path'].'/'.$noimg_name; |
|
850 | 850 | if (file_exists($img_path)) |
851 | 851 | unlink($img_path); |
852 | 852 | } |
@@ -874,7 +874,7 @@ discard block |
||
874 | 874 | if (get_option($value['id'])) { |
875 | 875 | $image_name_arr = explode('/', get_option($value['id'])); |
876 | 876 | $noimg_name = end($image_name_arr); |
877 | - $img_path = $uploads['path'] . '/' . $noimg_name; |
|
877 | + $img_path = $uploads['path'].'/'.$noimg_name; |
|
878 | 878 | if (file_exists($img_path)) |
879 | 879 | unlink($img_path); |
880 | 880 | } |
@@ -895,7 +895,7 @@ discard block |
||
895 | 895 | // same menu setting per theme. |
896 | 896 | if (isset($value['id']) && $value['id'] == 'geodir_theme_location_nav' && isset($_POST[$value['id']])) { |
897 | 897 | $theme = wp_get_theme(); |
898 | - update_option('geodir_theme_location_nav_' . $theme->name, $_POST[$value['id']]); |
|
898 | + update_option('geodir_theme_location_nav_'.$theme->name, $_POST[$value['id']]); |
|
899 | 899 | } |
900 | 900 | |
901 | 901 | if (isset($value['id']) && isset($_POST[$value['id']])) { |
@@ -965,8 +965,8 @@ discard block |
||
965 | 965 | |
966 | 966 | $listing_slug = $geodir_posttype_info['labels']['singular_name']; |
967 | 967 | |
968 | - $tabs[$geodir_post_type . '_fields_settings'] = array( |
|
969 | - 'label' => __(ucfirst($listing_slug) . ' Settings', 'geodirectory'), |
|
968 | + $tabs[$geodir_post_type.'_fields_settings'] = array( |
|
969 | + 'label' => __(ucfirst($listing_slug).' Settings', 'geodirectory'), |
|
970 | 970 | 'subtabs' => array( |
971 | 971 | array('subtab' => 'custom_fields', |
972 | 972 | 'label' => __('Custom Fields', 'geodirectory'), |
@@ -999,7 +999,7 @@ discard block |
||
999 | 999 | */ |
1000 | 1000 | function geodir_tools_setting_tab($tabs) |
1001 | 1001 | { |
1002 | - wp_enqueue_script( 'jquery-ui-progressbar' ); |
|
1002 | + wp_enqueue_script('jquery-ui-progressbar'); |
|
1003 | 1003 | $tabs['tools_settings'] = array('label' => __('GD Tools', 'geodirectory')); |
1004 | 1004 | return $tabs; |
1005 | 1005 | } |
@@ -1033,7 +1033,7 @@ discard block |
||
1033 | 1033 | */ |
1034 | 1034 | function geodir_extend_geodirectory_setting_tab($tabs) |
1035 | 1035 | { |
1036 | - $tabs['extend_geodirectory_settings'] = array('label' => __('Extend Geodirectory', 'geodirectory'). ' <i class="fa fa-plug"></i>', 'url' => 'http://wpgeodirectory.com', 'target' => '_blank'); |
|
1036 | + $tabs['extend_geodirectory_settings'] = array('label' => __('Extend Geodirectory', 'geodirectory').' <i class="fa fa-plug"></i>', 'url' => 'http://wpgeodirectory.com', 'target' => '_blank'); |
|
1037 | 1037 | return $tabs; |
1038 | 1038 | } |
1039 | 1039 | |
@@ -1093,8 +1093,8 @@ discard block |
||
1093 | 1093 | _e('Unknown', 'geodirectory'); |
1094 | 1094 | } else { |
1095 | 1095 | /* If there is a city id, append 'city name' to the text string. */ |
1096 | - $add_location_id = $location_id > 0 ? ' (' . $location_id . ')' : ''; |
|
1097 | - echo(__($location->country, 'geodirectory') . '-' . $location->region . '-' . $location->city . $add_location_id); |
|
1096 | + $add_location_id = $location_id > 0 ? ' ('.$location_id.')' : ''; |
|
1097 | + echo(__($location->country, 'geodirectory').'-'.$location->region.'-'.$location->city.$add_location_id); |
|
1098 | 1098 | } |
1099 | 1099 | break; |
1100 | 1100 | |
@@ -1112,14 +1112,14 @@ discard block |
||
1112 | 1112 | $expire_class = 'expire_over'; |
1113 | 1113 | } |
1114 | 1114 | $date_diff = round(abs(strtotime($d1) - strtotime($d2)) / 86400); // get the difference in days |
1115 | - $date_diff_text = '<br /><span class="' . $expire_class . '">(' . $date_diff . ' ' . $state . ')</span>'; |
|
1115 | + $date_diff_text = '<br /><span class="'.$expire_class.'">('.$date_diff.' '.$state.')</span>'; |
|
1116 | 1116 | } |
1117 | 1117 | /* If no expire_date is found, output a default message. */ |
1118 | 1118 | if (empty($expire_date)) |
1119 | 1119 | echo __('Unknown', 'geodirectory'); |
1120 | 1120 | /* If there is a expire_date, append 'days left' to the text string. */ |
1121 | 1121 | else |
1122 | - echo $expire_date . $date_diff_text; |
|
1122 | + echo $expire_date.$date_diff_text; |
|
1123 | 1123 | break; |
1124 | 1124 | |
1125 | 1125 | /* If displaying the 'categorys' column. */ |
@@ -1186,7 +1186,7 @@ discard block |
||
1186 | 1186 | function geodir_post_information_save($post_id, $post) { |
1187 | 1187 | global $wpdb, $current_user; |
1188 | 1188 | |
1189 | - if (isset($post->post_type) && ($post->post_type=='nav_menu_item' || $post->post_type=='page' || $post->post_type=='post')) { |
|
1189 | + if (isset($post->post_type) && ($post->post_type == 'nav_menu_item' || $post->post_type == 'page' || $post->post_type == 'post')) { |
|
1190 | 1190 | return; |
1191 | 1191 | } |
1192 | 1192 | |
@@ -1254,7 +1254,7 @@ discard block |
||
1254 | 1254 | $tab_id = $value['id']; |
1255 | 1255 | |
1256 | 1256 | if (isset($value['desc']) && $value['desc']) |
1257 | - $desc = '<span style=" text-transform:none;">:- ' . $value['desc'] . '</span>'; |
|
1257 | + $desc = '<span style=" text-transform:none;">:- '.$value['desc'].'</span>'; |
|
1258 | 1258 | |
1259 | 1259 | if (isset($value['name']) && $value['name']) { |
1260 | 1260 | if ($first_title === true) { |
@@ -1262,9 +1262,9 @@ discard block |
||
1262 | 1262 | } else { |
1263 | 1263 | echo '</div>'; |
1264 | 1264 | } |
1265 | - echo '<dd id="' . trim($tab_id) . '" class="geodir_option_tabs" ><a href="javascript:void(0);">' . $value['name'] . '</a></dd>'; |
|
1265 | + echo '<dd id="'.trim($tab_id).'" class="geodir_option_tabs" ><a href="javascript:void(0);">'.$value['name'].'</a></dd>'; |
|
1266 | 1266 | |
1267 | - echo '<div id="sub_' . trim($tab_id) . '" class="gd-content-heading" style=" margin-bottom:10px;" >'; |
|
1267 | + echo '<div id="sub_'.trim($tab_id).'" class="gd-content-heading" style=" margin-bottom:10px;" >'; |
|
1268 | 1268 | } |
1269 | 1269 | |
1270 | 1270 | /** |
@@ -1274,21 +1274,21 @@ discard block |
||
1274 | 1274 | * |
1275 | 1275 | * @since 1.0.0 |
1276 | 1276 | */ |
1277 | - do_action('geodir_settings_' . sanitize_title($value['id'])); |
|
1277 | + do_action('geodir_settings_'.sanitize_title($value['id'])); |
|
1278 | 1278 | break; |
1279 | 1279 | |
1280 | 1280 | case 'no_tabs': |
1281 | 1281 | |
1282 | 1282 | echo '<div class="inner_content_tab_main">'; |
1283 | - echo '<div id="sub_' . trim($tab_id) . '" class="gd-content-heading" style=" margin-bottom:10px;" >'; |
|
1283 | + echo '<div id="sub_'.trim($tab_id).'" class="gd-content-heading" style=" margin-bottom:10px;" >'; |
|
1284 | 1284 | |
1285 | 1285 | break; |
1286 | 1286 | |
1287 | 1287 | case 'sectionstart': |
1288 | 1288 | if (isset($value['desc']) && $value['desc']) |
1289 | - $desc = '<span style=" text-transform:none;"> - ' . $value['desc'] . '</span>'; |
|
1289 | + $desc = '<span style=" text-transform:none;"> - '.$value['desc'].'</span>'; |
|
1290 | 1290 | if (isset($value['name']) && $value['name']) |
1291 | - echo '<h3>' . $value['name'] . $desc . '</h3>'; |
|
1291 | + echo '<h3>'.$value['name'].$desc.'</h3>'; |
|
1292 | 1292 | /** |
1293 | 1293 | * Called after a GeoDirectory settings sectionstart is output in the GD settings page. |
1294 | 1294 | * |
@@ -1296,8 +1296,8 @@ discard block |
||
1296 | 1296 | * |
1297 | 1297 | * @since 1.0.0 |
1298 | 1298 | */ |
1299 | - if (isset($value['id']) && $value['id']) do_action('geodir_settings_' . sanitize_title($value['id']) . '_start'); |
|
1300 | - echo '<table class="form-table">' . "\n\n"; |
|
1299 | + if (isset($value['id']) && $value['id']) do_action('geodir_settings_'.sanitize_title($value['id']).'_start'); |
|
1300 | + echo '<table class="form-table">'."\n\n"; |
|
1301 | 1301 | |
1302 | 1302 | break; |
1303 | 1303 | case 'sectionend': |
@@ -1308,7 +1308,7 @@ discard block |
||
1308 | 1308 | * |
1309 | 1309 | * @since 1.0.0 |
1310 | 1310 | */ |
1311 | - if (isset($value['id']) && $value['id']) do_action('geodir_settings_' . sanitize_title($value['id']) . '_end'); |
|
1311 | + if (isset($value['id']) && $value['id']) do_action('geodir_settings_'.sanitize_title($value['id']).'_end'); |
|
1312 | 1312 | echo '</table>'; |
1313 | 1313 | /** |
1314 | 1314 | * Called after a GeoDirectory settings sectionend is output in the GD settings page. |
@@ -1317,7 +1317,7 @@ discard block |
||
1317 | 1317 | * |
1318 | 1318 | * @since 1.0.0 |
1319 | 1319 | */ |
1320 | - if (isset($value['id']) && $value['id']) do_action('geodir_settings_' . sanitize_title($value['id']) . '_after'); |
|
1320 | + if (isset($value['id']) && $value['id']) do_action('geodir_settings_'.sanitize_title($value['id']).'_after'); |
|
1321 | 1321 | break; |
1322 | 1322 | case 'text': |
1323 | 1323 | ?> |
@@ -1326,7 +1326,7 @@ discard block |
||
1326 | 1326 | <td class="forminp"><input name="<?php echo esc_attr($value['id']); ?>" |
1327 | 1327 | id="<?php echo esc_attr($value['id']); ?>" |
1328 | 1328 | type="<?php echo esc_attr($value['type']); ?>" |
1329 | - <?php if(isset($value['placeholder'])){?>placeholder="<?php echo esc_attr($value['placeholder']); ?>"<?php }?> |
|
1329 | + <?php if (isset($value['placeholder'])) {?>placeholder="<?php echo esc_attr($value['placeholder']); ?>"<?php }?> |
|
1330 | 1330 | style=" <?php echo esc_attr($value['css']); ?>" |
1331 | 1331 | value="<?php if (get_option($value['id']) !== false && get_option($value['id']) !== null) { |
1332 | 1332 | echo esc_attr(stripslashes(get_option($value['id']))); |
@@ -1343,7 +1343,7 @@ discard block |
||
1343 | 1343 | <td class="forminp"><input name="<?php echo esc_attr($value['id']); ?>" |
1344 | 1344 | id="<?php echo esc_attr($value['id']); ?>" |
1345 | 1345 | type="<?php echo esc_attr($value['type']); ?>" |
1346 | - <?php if(isset($value['placeholder'])){?>placeholder="<?php echo esc_attr($value['placeholder']); ?>"<?php }?> |
|
1346 | + <?php if (isset($value['placeholder'])) {?>placeholder="<?php echo esc_attr($value['placeholder']); ?>"<?php }?> |
|
1347 | 1347 | style="<?php echo esc_attr($value['css']); ?>" |
1348 | 1348 | value="<?php if (get_option($value['id']) !== false && get_option($value['id']) !== null) { |
1349 | 1349 | echo esc_attr(stripslashes(get_option($value['id']))); |
@@ -1389,17 +1389,17 @@ discard block |
||
1389 | 1389 | <?php _e('Width', 'geodirectory'); ?> <input |
1390 | 1390 | name="<?php echo esc_attr($value['id']); ?>_width" |
1391 | 1391 | id="<?php echo esc_attr($value['id']); ?>_width" type="text" size="3" |
1392 | - value="<?php if ($size = get_option($value['id'] . '_width')) echo stripslashes($size); else echo $value['std']; ?>"/> |
|
1392 | + value="<?php if ($size = get_option($value['id'].'_width')) echo stripslashes($size); else echo $value['std']; ?>"/> |
|
1393 | 1393 | |
1394 | 1394 | <?php _e('Height', 'geodirectory'); ?> <input |
1395 | 1395 | name="<?php echo esc_attr($value['id']); ?>_height" |
1396 | 1396 | id="<?php echo esc_attr($value['id']); ?>_height" type="text" size="3" |
1397 | - value="<?php if ($size = get_option($value['id'] . '_height')) echo stripslashes($size); else echo $value['std']; ?>"/> |
|
1397 | + value="<?php if ($size = get_option($value['id'].'_height')) echo stripslashes($size); else echo $value['std']; ?>"/> |
|
1398 | 1398 | |
1399 | 1399 | <label><?php _e('Hard Crop', 'geodirectory'); ?> <input |
1400 | 1400 | name="<?php echo esc_attr($value['id']); ?>_crop" |
1401 | 1401 | id="<?php echo esc_attr($value['id']); ?>_crop" |
1402 | - type="checkbox" <?php if (get_option($value['id'] . '_crop') != '') checked(get_option($value['id'] . '_crop'), 1); else checked(1); ?> /></label> |
|
1402 | + type="checkbox" <?php if (get_option($value['id'].'_crop') != '') checked(get_option($value['id'].'_crop'), 1); else checked(1); ?> /></label> |
|
1403 | 1403 | |
1404 | 1404 | <span class="description"><?php echo $value['desc'] ?></span></td> |
1405 | 1405 | </tr><?php |
@@ -1449,7 +1449,7 @@ discard block |
||
1449 | 1449 | id="<?php echo esc_attr($value['id']); ?>" |
1450 | 1450 | style="<?php echo esc_attr($value['css']); ?>" |
1451 | 1451 | class="<?php if (isset($value['class'])) echo $value['class']; ?>" |
1452 | - data-placeholder="<?php if (isset($value['placeholder_text'])) echo $value['placeholder_text'];?>" |
|
1452 | + data-placeholder="<?php if (isset($value['placeholder_text'])) echo $value['placeholder_text']; ?>" |
|
1453 | 1453 | option-ajaxchosen="false"> |
1454 | 1454 | <?php |
1455 | 1455 | foreach ($value['options'] as $key => $val) { |
@@ -1460,7 +1460,7 @@ discard block |
||
1460 | 1460 | } else { |
1461 | 1461 | ?> |
1462 | 1462 | <option |
1463 | - value="<?php echo esc_attr($key); ?>" <?php selected(true, (is_array($option_values) && in_array($key, $option_values)));?>><?php echo ucfirst($val) ?></option> |
|
1463 | + value="<?php echo esc_attr($key); ?>" <?php selected(true, (is_array($option_values) && in_array($key, $option_values))); ?>><?php echo ucfirst($val) ?></option> |
|
1464 | 1464 | <?php |
1465 | 1465 | } |
1466 | 1466 | } |
@@ -1495,7 +1495,7 @@ discard block |
||
1495 | 1495 | ?> |
1496 | 1496 | |
1497 | 1497 | <tr valign="top"> |
1498 | - <th class="titledesc" width="40%"><?php _e('Default map language', 'geodirectory');?></th> |
|
1498 | + <th class="titledesc" width="40%"><?php _e('Default map language', 'geodirectory'); ?></th> |
|
1499 | 1499 | <td width="60%"> |
1500 | 1500 | <select name="geodir_default_map_language" style="width:60%"> |
1501 | 1501 | <?php |
@@ -1577,7 +1577,7 @@ discard block |
||
1577 | 1577 | |
1578 | 1578 | <tr valign="top"> |
1579 | 1579 | <th class="titledesc" |
1580 | - width="40%"><?php _e('Default post type search on map', 'geodirectory');?></th> |
|
1580 | + width="40%"><?php _e('Default post type search on map', 'geodirectory'); ?></th> |
|
1581 | 1581 | <td width="60%"> |
1582 | 1582 | <select name="geodir_default_map_search_pt" style="width:60%"> |
1583 | 1583 | <?php |
@@ -1618,7 +1618,7 @@ discard block |
||
1618 | 1618 | $cat_display = 'checkbox'; |
1619 | 1619 | $gd_post_types = get_option('geodir_exclude_post_type_on_map'); |
1620 | 1620 | $gd_cats = get_option('geodir_exclude_cat_on_map'); |
1621 | - $gd_cats_upgrade = (int)get_option('geodir_exclude_cat_on_map_upgrade'); |
|
1621 | + $gd_cats_upgrade = (int) get_option('geodir_exclude_cat_on_map_upgrade'); |
|
1622 | 1622 | $count = 1; |
1623 | 1623 | ?> |
1624 | 1624 | <table width="70%" class="widefat"> |
@@ -1647,7 +1647,7 @@ discard block |
||
1647 | 1647 | name="home_map_post_types[]" |
1648 | 1648 | id="<?php echo esc_attr($value['id']); ?>" |
1649 | 1649 | value="<?php echo $key; ?>" |
1650 | - class="map_post_type" <?php echo $checked;?> /> |
|
1650 | + class="map_post_type" <?php echo $checked; ?> /> |
|
1651 | 1651 | <?php echo $post_types_obj->labels->singular_name; ?></td> |
1652 | 1652 | <td width="40%"> |
1653 | 1653 | <div class="home_map_category" style="overflow:auto;width:200px;height:100px;" |
@@ -1705,12 +1705,12 @@ discard block |
||
1705 | 1705 | ?> |
1706 | 1706 | <fieldset> |
1707 | 1707 | <legend class="screen-reader-text"><span><?php echo $value['name'] ?></span></legend> |
1708 | - <label for="<?php echo $value['id'];?>"> |
|
1708 | + <label for="<?php echo $value['id']; ?>"> |
|
1709 | 1709 | <input name="<?php echo esc_attr($value['id']); ?>" |
1710 | - id="<?php echo esc_attr($value['id'] . $value['value']); ?>" type="radio" |
|
1710 | + id="<?php echo esc_attr($value['id'].$value['value']); ?>" type="radio" |
|
1711 | 1711 | value="<?php echo $value['value'] ?>" <?php if (get_option($value['id']) == $value['value']) { |
1712 | 1712 | echo 'checked="checked"'; |
1713 | - }elseif(get_option($value['id'])=='' && $value['std']==$value['value']){echo 'checked="checked"';} ?> /> |
|
1713 | + }elseif (get_option($value['id']) == '' && $value['std'] == $value['value']) {echo 'checked="checked"'; } ?> /> |
|
1714 | 1714 | <?php echo $value['desc']; ?></label><br> |
1715 | 1715 | </fieldset> |
1716 | 1716 | <?php |
@@ -1730,9 +1730,9 @@ discard block |
||
1730 | 1730 | <th scope="row" class="titledesc"><?php echo $value['name'] ?></th> |
1731 | 1731 | <td class="forminp"> |
1732 | 1732 | <textarea |
1733 | - <?php if (isset($value['args'])) echo $value['args'] . ' '; ?>name="<?php echo esc_attr($value['id']); ?>" |
|
1733 | + <?php if (isset($value['args'])) echo $value['args'].' '; ?>name="<?php echo esc_attr($value['id']); ?>" |
|
1734 | 1734 | id="<?php echo esc_attr($value['id']); ?>" |
1735 | - <?php if(isset($value['placeholder'])){?>placeholder="<?php echo esc_attr($value['placeholder']); ?>"<?php }?> |
|
1735 | + <?php if (isset($value['placeholder'])) {?>placeholder="<?php echo esc_attr($value['placeholder']); ?>"<?php }?> |
|
1736 | 1736 | 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 |
1737 | 1737 | class="description"><?php echo $value['desc'] ?></span> |
1738 | 1738 | |
@@ -1777,7 +1777,7 @@ discard block |
||
1777 | 1777 | } |
1778 | 1778 | } |
1779 | 1779 | // |
1780 | - $page_setting = (int)get_option($value['id']); |
|
1780 | + $page_setting = (int) get_option($value['id']); |
|
1781 | 1781 | |
1782 | 1782 | $args = array('name' => $value['id'], |
1783 | 1783 | 'id' => $value['id'], |
@@ -1794,7 +1794,7 @@ discard block |
||
1794 | 1794 | <tr valign="top" class="single_select_page"> |
1795 | 1795 | <th scope="row" class="titledesc"><?php echo $value['name'] ?></th> |
1796 | 1796 | <td class="forminp"> |
1797 | - <?php echo str_replace(' id=', " data-placeholder='" . __('Select a page...', 'geodirectory') . "' style='" . $value['css'] . "' class='" . $value['class'] . "' " . $disabled . " id=", wp_dropdown_pages($args)); ?> |
|
1797 | + <?php echo str_replace(' id=', " data-placeholder='".__('Select a page...', 'geodirectory')."' style='".$value['css']."' class='".$value['class']."' ".$disabled." id=", wp_dropdown_pages($args)); ?> |
|
1798 | 1798 | <span class="description"><?php echo $value['desc'] ?></span> |
1799 | 1799 | </td> |
1800 | 1800 | </tr><?php |
@@ -1803,7 +1803,7 @@ discard block |
||
1803 | 1803 | } |
1804 | 1804 | break; |
1805 | 1805 | case 'single_select_country' : |
1806 | - $country_setting = (string)get_option($value['id']); |
|
1806 | + $country_setting = (string) get_option($value['id']); |
|
1807 | 1807 | if (strstr($country_setting, ':')) : |
1808 | 1808 | $country = current(explode(':', $country_setting)); |
1809 | 1809 | $state = end(explode(':', $country_setting)); |
@@ -1826,7 +1826,7 @@ discard block |
||
1826 | 1826 | case 'multi_select_countries' : |
1827 | 1827 | $countries = $geodirectory->countries->countries; |
1828 | 1828 | asort($countries); |
1829 | - $selections = (array)get_option($value['id']); |
|
1829 | + $selections = (array) get_option($value['id']); |
|
1830 | 1830 | ?> |
1831 | 1831 | <tr valign="top"> |
1832 | 1832 | <th scope="row" class="titledesc"><?php echo $value['name'] ?></th> |
@@ -1836,7 +1836,7 @@ discard block |
||
1836 | 1836 | title="Country" class="chosen_select"> |
1837 | 1837 | <?php |
1838 | 1838 | if ($countries) foreach ($countries as $key => $val) : |
1839 | - echo '<option value="' . $key . '" ' . selected(in_array($key, $selections), true, false) . '>' . $val . '</option>'; |
|
1839 | + echo '<option value="'.$key.'" '.selected(in_array($key, $selections), true, false).'>'.$val.'</option>'; |
|
1840 | 1840 | endforeach; |
1841 | 1841 | ?> |
1842 | 1842 | </select> |
@@ -1848,8 +1848,8 @@ discard block |
||
1848 | 1848 | break; |
1849 | 1849 | |
1850 | 1850 | case 'google_analytics' : |
1851 | - $selections = (array)get_option($value['id']); |
|
1852 | - if(get_option('geodir_ga_client_id') && get_option('geodir_ga_client_secret') ) { |
|
1851 | + $selections = (array) get_option($value['id']); |
|
1852 | + if (get_option('geodir_ga_client_id') && get_option('geodir_ga_client_secret')) { |
|
1853 | 1853 | ?> |
1854 | 1854 | <tr valign="top"> |
1855 | 1855 | <th scope="row" class="titledesc"><?php echo $value['name'] ?></th> |
@@ -1860,20 +1860,20 @@ discard block |
||
1860 | 1860 | |
1861 | 1861 | $oAuthURL = "https://accounts.google.com/o/oauth2/auth?"; |
1862 | 1862 | $scope = "scope=https://www.googleapis.com/auth/analytics.readonly"; |
1863 | - $state = "&state=123";//any string |
|
1864 | - $redirect_uri = "&redirect_uri=" . admin_url('admin-ajax.php') . "?action=geodir_ga_callback"; |
|
1863 | + $state = "&state=123"; //any string |
|
1864 | + $redirect_uri = "&redirect_uri=".admin_url('admin-ajax.php')."?action=geodir_ga_callback"; |
|
1865 | 1865 | $response_type = "&response_type=code"; |
1866 | 1866 | $client_id = "&client_id=".get_option('geodir_ga_client_id'); |
1867 | 1867 | $access_type = "&access_type=offline"; |
1868 | 1868 | $approval_prompt = "&approval_prompt=force"; |
1869 | 1869 | |
1870 | - $auth_url = $oAuthURL . $scope . $state . $redirect_uri . $response_type . $client_id . $access_type . $approval_prompt; |
|
1870 | + $auth_url = $oAuthURL.$scope.$state.$redirect_uri.$response_type.$client_id.$access_type.$approval_prompt; |
|
1871 | 1871 | |
1872 | 1872 | |
1873 | 1873 | ?> |
1874 | 1874 | <script> |
1875 | 1875 | function gd_ga_popup() { |
1876 | - var win = window.open("<?php echo $auth_url;?>", "Google Analytics", ""); |
|
1876 | + var win = window.open("<?php echo $auth_url; ?>", "Google Analytics", ""); |
|
1877 | 1877 | var pollTimer = window.setInterval(function () { |
1878 | 1878 | if (win.closed !== false) { // !== is required for compatibility with Opera |
1879 | 1879 | window.clearInterval(pollTimer); |
@@ -1895,7 +1895,7 @@ discard block |
||
1895 | 1895 | } else { |
1896 | 1896 | ?> |
1897 | 1897 | <span class="button-primary" |
1898 | - onclick="gd_ga_popup();"><?php _e('Authorize', 'geodirectory');?></span> |
|
1898 | + onclick="gd_ga_popup();"><?php _e('Authorize', 'geodirectory'); ?></span> |
|
1899 | 1899 | <?php |
1900 | 1900 | } |
1901 | 1901 | ?> |
@@ -1966,9 +1966,9 @@ discard block |
||
1966 | 1966 | |
1967 | 1967 | <?php if (isset($_REQUEST['active_tab']) && $_REQUEST['active_tab'] != '') { ?> |
1968 | 1968 | jQuery('.geodir_option_tabs').removeClass('gd-tab-active'); |
1969 | - jQuery('#<?php echo sanitize_text_field($_REQUEST['active_tab']);?>').addClass('gd-tab-active'); |
|
1969 | + jQuery('#<?php echo sanitize_text_field($_REQUEST['active_tab']); ?>').addClass('gd-tab-active'); |
|
1970 | 1970 | jQuery('.gd-content-heading').hide(); |
1971 | - jQuery('#sub_<?php echo sanitize_text_field($_REQUEST['active_tab']);?>').show(); |
|
1971 | + jQuery('#sub_<?php echo sanitize_text_field($_REQUEST['active_tab']); ?>').show(); |
|
1972 | 1972 | <?php } ?> |
1973 | 1973 | }); |
1974 | 1974 | </script> |
@@ -2054,7 +2054,7 @@ discard block |
||
2054 | 2054 | wp_nonce_field(plugin_basename(__FILE__), 'geodir_post_attachments_noncename'); |
2055 | 2055 | |
2056 | 2056 | if (geodir_get_featured_image($post_id, 'thumbnail')) { |
2057 | - echo '<h4>' . __('Featured Image', 'geodirectory') . '</h4>'; |
|
2057 | + echo '<h4>'.__('Featured Image', 'geodirectory').'</h4>'; |
|
2058 | 2058 | geodir_show_featured_image($post_id, 'thumbnail'); |
2059 | 2059 | } |
2060 | 2060 | |
@@ -2065,13 +2065,13 @@ discard block |
||
2065 | 2065 | |
2066 | 2066 | <h5 class="form_title"> |
2067 | 2067 | <?php if ($image_limit != 0 && $image_limit == 1) { |
2068 | - echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>'; |
|
2068 | + echo '<br /><small>('.__('You can upload', 'geodirectory').' '.$image_limit.' '.__('image with this package', 'geodirectory').')</small>'; |
|
2069 | 2069 | } ?> |
2070 | 2070 | <?php if ($image_limit != 0 && $image_limit > 1) { |
2071 | - echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>'; |
|
2071 | + echo '<br /><small>('.__('You can upload', 'geodirectory').' '.$image_limit.' '.__('images with this package', 'geodirectory').')</small>'; |
|
2072 | 2072 | } ?> |
2073 | 2073 | <?php if ($image_limit == 0) { |
2074 | - echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>'; |
|
2074 | + echo '<br /><small>('.__('You can upload unlimited images with this package', 'geodirectory').')</small>'; |
|
2075 | 2075 | } ?> |
2076 | 2076 | </h5> |
2077 | 2077 | |
@@ -2110,10 +2110,10 @@ discard block |
||
2110 | 2110 | <div |
2111 | 2111 | class="plupload-upload-uic hide-if-no-js <?php if ($multiple): ?>plupload-upload-uic-multiple<?php endif; ?>" |
2112 | 2112 | id="<?php echo $id; ?>plupload-upload-ui"> |
2113 | - <h4><?php _e('Drop files to upload', 'geodirectory');?></h4> |
|
2113 | + <h4><?php _e('Drop files to upload', 'geodirectory'); ?></h4> |
|
2114 | 2114 | <input id="<?php echo $id; ?>plupload-browse-button" type="button" |
2115 | 2115 | value="<?php _e('Select Files', 'geodirectory'); ?>" class="button"/> |
2116 | - <span class="ajaxnonceplu" id="ajaxnonceplu<?php echo wp_create_nonce($id . 'pluploadan'); ?>"></span> |
|
2116 | + <span class="ajaxnonceplu" id="ajaxnonceplu<?php echo wp_create_nonce($id.'pluploadan'); ?>"></span> |
|
2117 | 2117 | <?php if ($width && $height): ?> |
2118 | 2118 | <span class="plupload-resize"></span> |
2119 | 2119 | <span class="plupload-width" id="plupload-width<?php echo $width; ?>"></span> |
@@ -2125,7 +2125,7 @@ discard block |
||
2125 | 2125 | id="<?php echo $id; ?>plupload-thumbs" style="border-top:1px solid #ccc; padding-top:10px;"> |
2126 | 2126 | </div> |
2127 | 2127 | <span |
2128 | - id="upload-msg"><?php _e('Please drag & drop the images to rearrange the order', 'geodirectory');?></span> |
|
2128 | + id="upload-msg"><?php _e('Please drag & drop the images to rearrange the order', 'geodirectory'); ?></span> |
|
2129 | 2129 | <span id="<?php echo $id; ?>upload-error" style="display:none"></span> |
2130 | 2130 | </div> |
2131 | 2131 | |
@@ -2335,9 +2335,9 @@ discard block |
||
2335 | 2335 | $plugin = 'avada-nag'; |
2336 | 2336 | $timestamp = 'avada-nag1234'; |
2337 | 2337 | $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'); |
2338 | - echo '<div id="' . $timestamp . '" class="error">'; |
|
2339 | - echo '<span class="gd-remove-noti" onclick="gdRemoveANotification(\'' . $plugin . '\',\'' . $timestamp . '\');" ><i class="fa fa-times"></i></span>'; |
|
2340 | - echo "<img class='gd-icon-noti' src='" . plugin_dir_url('') . "geodirectory/geodirectory-assets/images/favicon.ico' > "; |
|
2338 | + echo '<div id="'.$timestamp.'" class="error">'; |
|
2339 | + echo '<span class="gd-remove-noti" onclick="gdRemoveANotification(\''.$plugin.'\',\''.$timestamp.'\');" ><i class="fa fa-times"></i></span>'; |
|
2340 | + echo "<img class='gd-icon-noti' src='".plugin_dir_url('')."geodirectory/geodirectory-assets/images/favicon.ico' > "; |
|
2341 | 2341 | echo "<p>$message</p>"; |
2342 | 2342 | echo "</div>"; |
2343 | 2343 | |
@@ -2470,7 +2470,7 @@ discard block |
||
2470 | 2470 | |
2471 | 2471 | // Don't allow same slug url for listing and location |
2472 | 2472 | if (geodir_strtolower($listing_prefix) == geodir_strtolower($location_prefix)) { |
2473 | - $redirect_url = admin_url('admin.php?page=geodirectory&tab=' . $current_tab . '&active_tab=' . $active_tab . '&msg=fail&gderr=21'); |
|
2473 | + $redirect_url = admin_url('admin.php?page=geodirectory&tab='.$current_tab.'&active_tab='.$active_tab.'&msg=fail&gderr=21'); |
|
2474 | 2474 | wp_redirect($redirect_url); |
2475 | 2475 | exit; |
2476 | 2476 | } |
@@ -2482,7 +2482,7 @@ discard block |
||
2482 | 2482 | $default_language = $sitepress->get_default_language(); |
2483 | 2483 | |
2484 | 2484 | if ($current_language != 'all' && $current_language != $default_language) { |
2485 | - $redirect_url = admin_url('admin.php?page=geodirectory&tab=' . $current_tab . '&active_tab=' . $active_tab); |
|
2485 | + $redirect_url = admin_url('admin.php?page=geodirectory&tab='.$current_tab.'&active_tab='.$active_tab); |
|
2486 | 2486 | wp_redirect($redirect_url); |
2487 | 2487 | exit; |
2488 | 2488 | } |
@@ -2503,11 +2503,11 @@ discard block |
||
2503 | 2503 | function geodir_hide_admin_preview_button() { |
2504 | 2504 | global $post_type; |
2505 | 2505 | $post_types = geodir_get_posttypes(); |
2506 | - if(in_array($post_type, $post_types)) |
|
2506 | + if (in_array($post_type, $post_types)) |
|
2507 | 2507 | echo '<style type="text/css">#post-preview, #view-post-btn{display: none;}</style>'; |
2508 | 2508 | } |
2509 | -add_action( 'admin_head-post-new.php', 'geodir_hide_admin_preview_button' ); |
|
2510 | -add_action( 'admin_head-post.php', 'geodir_hide_admin_preview_button' ); |
|
2509 | +add_action('admin_head-post-new.php', 'geodir_hide_admin_preview_button'); |
|
2510 | +add_action('admin_head-post.php', 'geodir_hide_admin_preview_button'); |
|
2511 | 2511 | |
2512 | 2512 | /** |
2513 | 2513 | * Add the tab in left sidebar menu fro import & export page. |
@@ -2517,8 +2517,8 @@ discard block |
||
2517 | 2517 | * |
2518 | 2518 | * @return array Array of tab data. |
2519 | 2519 | */ |
2520 | -function geodir_import_export_tab( $tabs ) { |
|
2521 | - $tabs['import_export'] = array( 'label' => __( 'Import & Export', 'geodirectory' ) ); |
|
2520 | +function geodir_import_export_tab($tabs) { |
|
2521 | + $tabs['import_export'] = array('label' => __('Import & Export', 'geodirectory')); |
|
2522 | 2522 | return $tabs; |
2523 | 2523 | } |
2524 | 2524 | |
@@ -2532,8 +2532,8 @@ discard block |
||
2532 | 2532 | * @return string Html content. |
2533 | 2533 | */ |
2534 | 2534 | function geodir_import_export_page() { |
2535 | - $nonce = wp_create_nonce( 'geodir_import_export_nonce' ); |
|
2536 | - $gd_cats_sample_csv = geodir_plugin_url() . '/geodirectory-assets/gd_sample_categories.csv'; |
|
2535 | + $nonce = wp_create_nonce('geodir_import_export_nonce'); |
|
2536 | + $gd_cats_sample_csv = geodir_plugin_url().'/geodirectory-assets/gd_sample_categories.csv'; |
|
2537 | 2537 | /** |
2538 | 2538 | * Filter sample category data csv file url. |
2539 | 2539 | * |
@@ -2542,9 +2542,9 @@ discard block |
||
2542 | 2542 | * |
2543 | 2543 | * @param string $gd_cats_sample_csv Sample category data csv file url. |
2544 | 2544 | */ |
2545 | - $gd_cats_sample_csv = apply_filters( 'geodir_export_cats_sample_csv', $gd_cats_sample_csv ); |
|
2545 | + $gd_cats_sample_csv = apply_filters('geodir_export_cats_sample_csv', $gd_cats_sample_csv); |
|
2546 | 2546 | |
2547 | - $gd_posts_sample_csv = geodir_plugin_url() . '/geodirectory-assets/place_listing.csv'; |
|
2547 | + $gd_posts_sample_csv = geodir_plugin_url().'/geodirectory-assets/place_listing.csv'; |
|
2548 | 2548 | /** |
2549 | 2549 | * Filter sample post data csv file url. |
2550 | 2550 | * |
@@ -2553,15 +2553,15 @@ discard block |
||
2553 | 2553 | * |
2554 | 2554 | * @param string $gd_posts_sample_csv Sample post data csv file url. |
2555 | 2555 | */ |
2556 | - $gd_posts_sample_csv = apply_filters( 'geodir_export_posts_sample_csv', $gd_posts_sample_csv ); |
|
2556 | + $gd_posts_sample_csv = apply_filters('geodir_export_posts_sample_csv', $gd_posts_sample_csv); |
|
2557 | 2557 | |
2558 | - $gd_posttypes = geodir_get_posttypes( 'array' ); |
|
2558 | + $gd_posttypes = geodir_get_posttypes('array'); |
|
2559 | 2559 | |
2560 | 2560 | $gd_posttypes_option = ''; |
2561 | - foreach ( $gd_posttypes as $gd_posttype => $row ) { |
|
2562 | - $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>'; |
|
2561 | + foreach ($gd_posttypes as $gd_posttype => $row) { |
|
2562 | + $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>'; |
|
2563 | 2563 | } |
2564 | - wp_enqueue_script( 'jquery-ui-progressbar' ); |
|
2564 | + wp_enqueue_script('jquery-ui-progressbar'); |
|
2565 | 2565 | |
2566 | 2566 | $gd_chunksize_options = array(); |
2567 | 2567 | $gd_chunksize_options[100] = 100; |
@@ -2583,49 +2583,49 @@ discard block |
||
2583 | 2583 | * |
2584 | 2584 | * @param string $gd_chunksize_options Entries options. |
2585 | 2585 | */ |
2586 | - $gd_chunksize_options = apply_filters( 'geodir_export_csv_chunksize_options', $gd_chunksize_options ); |
|
2586 | + $gd_chunksize_options = apply_filters('geodir_export_csv_chunksize_options', $gd_chunksize_options); |
|
2587 | 2587 | |
2588 | 2588 | $gd_chunksize_option = ''; |
2589 | 2589 | foreach ($gd_chunksize_options as $value => $title) { |
2590 | - $gd_chunksize_option .= '<option value="' . $value . '" ' . selected($value, 5000, false) . '>' . $title . '</option>'; |
|
2590 | + $gd_chunksize_option .= '<option value="'.$value.'" '.selected($value, 5000, false).'>'.$title.'</option>'; |
|
2591 | 2591 | } |
2592 | 2592 | |
2593 | 2593 | $uploads = wp_upload_dir(); |
2594 | 2594 | ?> |
2595 | 2595 | </form> |
2596 | 2596 | <div class="inner_content_tab_main gd-import-export"> |
2597 | - <h3><?php _e( 'GD Import & Export CSV', 'geodirectory' ) ;?></h3> |
|
2598 | - <span class="description"><?php _e( 'Import & export csv for GD listings & categories.', 'geodirectory' ) ;?></span> |
|
2597 | + <h3><?php _e('GD Import & Export CSV', 'geodirectory'); ?></h3> |
|
2598 | + <span class="description"><?php _e('Import & export csv for GD listings & categories.', 'geodirectory'); ?></span> |
|
2599 | 2599 | <div class="gd-content-heading"> |
2600 | 2600 | |
2601 | 2601 | <?php |
2602 | 2602 | ini_set('max_execution_time', 999999); |
2603 | - $ini_max_execution_time_check = @ini_get( 'max_execution_time' ); |
|
2603 | + $ini_max_execution_time_check = @ini_get('max_execution_time'); |
|
2604 | 2604 | ini_restore('max_execution_time'); |
2605 | 2605 | |
2606 | - if($ini_max_execution_time_check != 999999){ // only show these setting to the user if we can't change the ini setting |
|
2606 | + if ($ini_max_execution_time_check != 999999) { // only show these setting to the user if we can't change the ini setting |
|
2607 | 2607 | ?> |
2608 | 2608 | <div id="gd_ie_reqs" class="metabox-holder"> |
2609 | 2609 | <div class="meta-box-sortables ui-sortable"> |
2610 | 2610 | <div class="postbox"> |
2611 | - <h3 class="hndle"><span style='vertical-align:top;'><?php echo __( 'PHP Requirements for GD Import & Export CSV', 'geodirectory' );?></span></h3> |
|
2611 | + <h3 class="hndle"><span style='vertical-align:top;'><?php echo __('PHP Requirements for GD Import & Export CSV', 'geodirectory'); ?></span></h3> |
|
2612 | 2612 | <div class="inside"> |
2613 | - <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> |
|
2613 | + <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> |
|
2614 | 2614 | <table class="form-table"> |
2615 | 2615 | <thead> |
2616 | 2616 | <tr> |
2617 | - <th><?php _e( 'PHP Settings', 'geodirectory' );?></th><th><?php _e( 'Current Value', 'geodirectory' );?></th><th><?php _e( 'Recommended Value', 'geodirectory' );?></th> |
|
2617 | + <th><?php _e('PHP Settings', 'geodirectory'); ?></th><th><?php _e('Current Value', 'geodirectory'); ?></th><th><?php _e('Recommended Value', 'geodirectory'); ?></th> |
|
2618 | 2618 | </tr> |
2619 | 2619 | </thead> |
2620 | 2620 | <tbody> |
2621 | 2621 | <tr> |
2622 | - <td>max_input_time</td><td><?php echo @ini_get( 'max_input_time' );?></td><td>3000</td> |
|
2622 | + <td>max_input_time</td><td><?php echo @ini_get('max_input_time'); ?></td><td>3000</td> |
|
2623 | 2623 | </tr> |
2624 | 2624 | <tr> |
2625 | - <td>max_execution_time</td><td><?php echo @ini_get( 'max_execution_time' );?></td><td>3000</td> |
|
2625 | + <td>max_execution_time</td><td><?php echo @ini_get('max_execution_time'); ?></td><td>3000</td> |
|
2626 | 2626 | </tr> |
2627 | 2627 | <tr> |
2628 | - <td>memory_limit</td><td><?php echo @ini_get( 'memory_limit' );?></td><td>256M</td> |
|
2628 | + <td>memory_limit</td><td><?php echo @ini_get('memory_limit'); ?></td><td>256M</td> |
|
2629 | 2629 | </tr> |
2630 | 2630 | </tbody> |
2631 | 2631 | </table> |
@@ -2637,21 +2637,21 @@ discard block |
||
2637 | 2637 | <div id="gd_ie_imposts" class="metabox-holder"> |
2638 | 2638 | <div class="meta-box-sortables ui-sortable"> |
2639 | 2639 | <div id="gd_ie_im_posts" class="postbox gd-hndle-pbox"> |
2640 | - <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> |
|
2641 | - <h3 class="hndle gd-hndle-click"><span style='vertical-align:top;'><?php echo __( 'GD Listings: Import CSV', 'geodirectory' );?></span></h3> |
|
2640 | + <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> |
|
2641 | + <h3 class="hndle gd-hndle-click"><span style='vertical-align:top;'><?php echo __('GD Listings: Import CSV', 'geodirectory'); ?></span></h3> |
|
2642 | 2642 | <div class="inside"> |
2643 | 2643 | <table class="form-table"> |
2644 | 2644 | <tbody> |
2645 | 2645 | <tr> |
2646 | 2646 | <td class="gd-imex-box"> |
2647 | 2647 | <div class="gd-im-choices"> |
2648 | - <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> |
|
2649 | - <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> |
|
2648 | + <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> |
|
2649 | + <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> |
|
2650 | 2650 | </div> |
2651 | 2651 | <div class="plupload-upload-uic hide-if-no-js" id="gd_im_postplupload-upload-ui"> |
2652 | 2652 | <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');" /> |
2653 | - <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"> |
|
2654 | - <input type="hidden" id="gd_ie_imposts_csv" value="<?php echo $gd_posts_sample_csv;?>" /> |
|
2653 | + <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"> |
|
2654 | + <input type="hidden" id="gd_ie_imposts_csv" value="<?php echo $gd_posts_sample_csv; ?>" /> |
|
2655 | 2655 | <?php |
2656 | 2656 | /** |
2657 | 2657 | * Called just after the sample CSV download link. |
@@ -2660,7 +2660,7 @@ discard block |
||
2660 | 2660 | */ |
2661 | 2661 | do_action('geodir_sample_csv_download_link'); |
2662 | 2662 | ?> |
2663 | - <span class="ajaxnonceplu" id="ajaxnonceplu<?php echo wp_create_nonce( 'gd_im_postpluploadan' ); ?>"></span> |
|
2663 | + <span class="ajaxnonceplu" id="ajaxnonceplu<?php echo wp_create_nonce('gd_im_postpluploadan'); ?>"></span> |
|
2664 | 2664 | <div class="filelist"></div> |
2665 | 2665 | </div> |
2666 | 2666 | <span id="gd_im_catupload-error" style="display:none"></span> |
@@ -2678,7 +2678,7 @@ discard block |
||
2678 | 2678 | <input type="hidden" id="gd_terminateaction" value="continue"/> |
2679 | 2679 | </div> |
2680 | 2680 | <div class="gd-import-progress" id="gd-import-progress" style="display:none"> |
2681 | - <div class="gd-import-file"><b><?php _e("Import Data Status :", 'geodirectory');?> </b><font |
|
2681 | + <div class="gd-import-file"><b><?php _e("Import Data Status :", 'geodirectory'); ?> </b><font |
|
2682 | 2682 | id="gd-import-done">0</font> / <font id="gd-import-total">0</font> ( <font |
2683 | 2683 | id="gd-import-perc">0%</font> ) |
2684 | 2684 | <div class="gd-fileprogress"></div> |
@@ -2690,10 +2690,10 @@ discard block |
||
2690 | 2690 | <div class="gd-imex-btns" style="display:none;"> |
2691 | 2691 | <input type="hidden" class="geodir_import_file" name="geodir_import_file" value="save"/> |
2692 | 2692 | <input onclick="gd_imex_PrepareImport(this, 'post')" type="button" value="<?php echo CSV_IMPORT_DATA; ?>" id="gd_import_data" class="button-primary" /> |
2693 | - <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"/> |
|
2694 | - <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')"/> |
|
2693 | + <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"/> |
|
2694 | + <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')"/> |
|
2695 | 2695 | <div id="gd_process_data" style="display:none"> |
2696 | - <span class="spinner is-active" style="display:inline-block;margin:0 5px 0 5px;float:left"></span><?php _e("Wait, processing import data...", 'geodirectory');?> |
|
2696 | + <span class="spinner is-active" style="display:inline-block;margin:0 5px 0 5px;float:left"></span><?php _e("Wait, processing import data...", 'geodirectory'); ?> |
|
2697 | 2697 | </div> |
2698 | 2698 | </div> |
2699 | 2699 | </td> |
@@ -2707,26 +2707,26 @@ discard block |
||
2707 | 2707 | <div id="gd_ie_excategs" class="metabox-holder"> |
2708 | 2708 | <div class="meta-box-sortables ui-sortable"> |
2709 | 2709 | <div id="gd_ie_ex_posts" class="postbox gd-hndle-pbox"> |
2710 | - <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> |
|
2711 | - <h3 class="hndle gd-hndle-click"><span style='vertical-align:top;'><?php echo __( 'GD Listings: Export CSV', 'geodirectory' );?></span></h3> |
|
2710 | + <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> |
|
2711 | + <h3 class="hndle gd-hndle-click"><span style='vertical-align:top;'><?php echo __('GD Listings: Export CSV', 'geodirectory'); ?></span></h3> |
|
2712 | 2712 | <div class="inside"> |
2713 | 2713 | <table class="form-table"> |
2714 | 2714 | <tbody> |
2715 | 2715 | <tr> |
2716 | 2716 | <td class="fld"><label for="gd_post_type"> |
2717 | - <?php _e( 'Post Type:', 'geodirectory' );?> |
|
2717 | + <?php _e('Post Type:', 'geodirectory'); ?> |
|
2718 | 2718 | </label></td> |
2719 | 2719 | <td><select name="gd_post_type" id="gd_post_type" style="min-width:140px"> |
2720 | - <?php echo $gd_posttypes_option;?> |
|
2720 | + <?php echo $gd_posttypes_option; ?> |
|
2721 | 2721 | </select></td> |
2722 | 2722 | </tr> |
2723 | 2723 | <tr> |
2724 | - <td class="fld" style="vertical-align:top"><label for="gd_chunk_size"><?php _e( 'Max entries per csv file:', 'geodirectory' );?></label></td> |
|
2725 | - <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> |
|
2724 | + <td class="fld" style="vertical-align:top"><label for="gd_chunk_size"><?php _e('Max entries per csv file:', 'geodirectory'); ?></label></td> |
|
2725 | + <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> |
|
2726 | 2726 | </tr> |
2727 | 2727 | <tr> |
2728 | 2728 | <td class="fld" style="vertical-align:top"><label> |
2729 | - <?php _e( 'Progress:', 'geodirectory' );?> |
|
2729 | + <?php _e('Progress:', 'geodirectory'); ?> |
|
2730 | 2730 | </label></td> |
2731 | 2731 | <td><div id='gd_progressbar_box'> |
2732 | 2732 | <div id="gd_progressbar" class="gd_progressbar"> |
@@ -2734,13 +2734,13 @@ discard block |
||
2734 | 2734 | </div> |
2735 | 2735 | </div> |
2736 | 2736 | <p style="display:inline-block"> |
2737 | - <?php _e( 'Elapsed Time:', 'geodirectory' );?> |
|
2737 | + <?php _e('Elapsed Time:', 'geodirectory'); ?> |
|
2738 | 2738 | </p> |
2739 | 2739 | |
2740 | 2740 | <p id="gd_timer" class="gd_timer">00:00:00</p></td> |
2741 | 2741 | </tr> |
2742 | 2742 | <tr class="gd-ie-actions"> |
2743 | - <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"> |
|
2743 | + <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"> |
|
2744 | 2744 | </td> |
2745 | 2745 | <td id="gd_ie_ex_files" class="gd-ie-files"></td> |
2746 | 2746 | </tr> |
@@ -2753,21 +2753,21 @@ discard block |
||
2753 | 2753 | <div id="gd_ie_imcategs" class="metabox-holder"> |
2754 | 2754 | <div class="meta-box-sortables ui-sortable"> |
2755 | 2755 | <div id="gd_ie_imcats" class="postbox gd-hndle-pbox"> |
2756 | - <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> |
|
2757 | - <h3 class="hndle gd-hndle-click"><span style='vertical-align:top;'><?php echo __( 'GD Categories: Import CSV', 'geodirectory' );?></span></h3> |
|
2756 | + <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> |
|
2757 | + <h3 class="hndle gd-hndle-click"><span style='vertical-align:top;'><?php echo __('GD Categories: Import CSV', 'geodirectory'); ?></span></h3> |
|
2758 | 2758 | <div class="inside"> |
2759 | 2759 | <table class="form-table"> |
2760 | 2760 | <tbody> |
2761 | 2761 | <tr> |
2762 | 2762 | <td class="gd-imex-box"> |
2763 | 2763 | <div class="gd-im-choices"> |
2764 | - <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> |
|
2765 | - <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> |
|
2764 | + <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> |
|
2765 | + <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> |
|
2766 | 2766 | </div> |
2767 | 2767 | <div class="plupload-upload-uic hide-if-no-js" id="gd_im_catplupload-upload-ui"> |
2768 | 2768 | <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');" /> |
2769 | - <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"> |
|
2770 | - <input type="hidden" id="gd_ie_imcats_csv" value="<?php echo $gd_cats_sample_csv;?>" /> |
|
2769 | + <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"> |
|
2770 | + <input type="hidden" id="gd_ie_imcats_csv" value="<?php echo $gd_cats_sample_csv; ?>" /> |
|
2771 | 2771 | <?php |
2772 | 2772 | /** |
2773 | 2773 | * Called just after the sample CSV download link. |
@@ -2777,7 +2777,7 @@ discard block |
||
2777 | 2777 | */ |
2778 | 2778 | do_action('geodir_sample_cats_csv_download_link'); |
2779 | 2779 | ?> |
2780 | - <span class="ajaxnonceplu" id="ajaxnonceplu<?php echo wp_create_nonce( 'gd_im_catpluploadan' ); ?>"></span> |
|
2780 | + <span class="ajaxnonceplu" id="ajaxnonceplu<?php echo wp_create_nonce('gd_im_catpluploadan'); ?>"></span> |
|
2781 | 2781 | <div class="filelist"></div> |
2782 | 2782 | </div> |
2783 | 2783 | <span id="gd_im_catupload-error" style="display:none"></span> |
@@ -2794,7 +2794,7 @@ discard block |
||
2794 | 2794 | <input type="hidden" id="gd_terminateaction" value="continue"/> |
2795 | 2795 | </div> |
2796 | 2796 | <div class="gd-import-progress" id="gd-import-progress" style="display:none"> |
2797 | - <div class="gd-import-file"><b><?php _e("Import Data Status :", 'geodirectory');?> </b><font |
|
2797 | + <div class="gd-import-file"><b><?php _e("Import Data Status :", 'geodirectory'); ?> </b><font |
|
2798 | 2798 | id="gd-import-done">0</font> / <font id="gd-import-total">0</font> ( <font |
2799 | 2799 | id="gd-import-perc">0%</font> ) |
2800 | 2800 | <div class="gd-fileprogress"></div> |
@@ -2806,10 +2806,10 @@ discard block |
||
2806 | 2806 | <div class="gd-imex-btns" style="display:none;"> |
2807 | 2807 | <input type="hidden" class="geodir_import_file" name="geodir_import_file" value="save"/> |
2808 | 2808 | <input onclick="gd_imex_PrepareImport(this, 'cat')" type="button" value="<?php echo CSV_IMPORT_DATA; ?>" id="gd_import_data" class="button-primary" /> |
2809 | - <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"/> |
|
2810 | - <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')"/> |
|
2809 | + <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"/> |
|
2810 | + <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')"/> |
|
2811 | 2811 | <div id="gd_process_data" style="display:none"> |
2812 | - <span class="spinner is-active" style="display:inline-block;margin:0 5px 0 5px;float:left"></span><?php _e("Wait, processing import data...", 'geodirectory');?> |
|
2812 | + <span class="spinner is-active" style="display:inline-block;margin:0 5px 0 5px;float:left"></span><?php _e("Wait, processing import data...", 'geodirectory'); ?> |
|
2813 | 2813 | </div> |
2814 | 2814 | </div> |
2815 | 2815 | </td> |
@@ -2823,26 +2823,26 @@ discard block |
||
2823 | 2823 | <div id="gd_ie_excategs" class="metabox-holder"> |
2824 | 2824 | <div class="meta-box-sortables ui-sortable"> |
2825 | 2825 | <div id="gd_ie_ex_cats" class="postbox gd-hndle-pbox"> |
2826 | - <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> |
|
2827 | - <h3 class="hndle gd-hndle-click"><span style='vertical-align:top;'><?php echo __( 'GD Categories: Export CSV', 'geodirectory' );?></span></h3> |
|
2826 | + <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> |
|
2827 | + <h3 class="hndle gd-hndle-click"><span style='vertical-align:top;'><?php echo __('GD Categories: Export CSV', 'geodirectory'); ?></span></h3> |
|
2828 | 2828 | <div class="inside"> |
2829 | 2829 | <table class="form-table"> |
2830 | 2830 | <tbody> |
2831 | 2831 | <tr> |
2832 | - <td class="fld"><label for="gd_post_type"><?php _e( 'Post Type:', 'geodirectory' );?></label></td> |
|
2833 | - <td><select name="gd_post_type" id="gd_post_type" style="min-width:140px"><?php echo $gd_posttypes_option;?></select></td> |
|
2832 | + <td class="fld"><label for="gd_post_type"><?php _e('Post Type:', 'geodirectory'); ?></label></td> |
|
2833 | + <td><select name="gd_post_type" id="gd_post_type" style="min-width:140px"><?php echo $gd_posttypes_option; ?></select></td> |
|
2834 | 2834 | </tr> |
2835 | 2835 | <tr> |
2836 | - <td class="fld" style="vertical-align:top"><label for="gd_chunk_size"><?php _e( 'Max entries per csv file:', 'geodirectory' );?></label></td> |
|
2837 | - <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> |
|
2836 | + <td class="fld" style="vertical-align:top"><label for="gd_chunk_size"><?php _e('Max entries per csv file:', 'geodirectory'); ?></label></td> |
|
2837 | + <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> |
|
2838 | 2838 | </tr> |
2839 | 2839 | <tr> |
2840 | - <td class="fld" style="vertical-align:top"><label><?php _e( 'Progress:', 'geodirectory' );?></label></td> |
|
2841 | - <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> |
|
2840 | + <td class="fld" style="vertical-align:top"><label><?php _e('Progress:', 'geodirectory'); ?></label></td> |
|
2841 | + <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> |
|
2842 | 2842 | </tr> |
2843 | 2843 | <tr class="gd-ie-actions"> |
2844 | 2844 | <td style="vertical-align:top"> |
2845 | - <input type="submit" value="<?php echo esc_attr( __( 'Export CSV', 'geodirectory' ) );?>" class="button-primary" name="gd_ie_excats_submit" id="gd_ie_excats_submit"> |
|
2845 | + <input type="submit" value="<?php echo esc_attr(__('Export CSV', 'geodirectory')); ?>" class="button-primary" name="gd_ie_excats_submit" id="gd_ie_excats_submit"> |
|
2846 | 2846 | </td> |
2847 | 2847 | <td id="gd_ie_ex_files" class="gd-ie-files"></td> |
2848 | 2848 | </tr> |
@@ -2864,7 +2864,7 @@ discard block |
||
2864 | 2864 | * @param array $gd_chunksize_options File chunk size options. |
2865 | 2865 | * @param string $nonce Wordpress security token for GD import & export. |
2866 | 2866 | */ |
2867 | - do_action( 'geodir_import_export', $gd_posttypes, $gd_chunksize_options, $nonce ); |
|
2867 | + do_action('geodir_import_export', $gd_posttypes, $gd_chunksize_options, $nonce); |
|
2868 | 2868 | ?> |
2869 | 2869 | </div> |
2870 | 2870 | </div> |
@@ -2883,7 +2883,7 @@ discard block |
||
2883 | 2883 | jQuery.ajax({ |
2884 | 2884 | url: ajaxurl, |
2885 | 2885 | type: "POST", |
2886 | - data: 'action=geodir_import_export&task=prepare_import&_pt=' + type + '&_file=' + uploadedFile + '&_nonce=<?php echo $nonce;?>', |
|
2886 | + data: 'action=geodir_import_export&task=prepare_import&_pt=' + type + '&_file=' + uploadedFile + '&_nonce=<?php echo $nonce; ?>', |
|
2887 | 2887 | dataType: 'json', |
2888 | 2888 | cache: false, |
2889 | 2889 | success: function(data) { |
@@ -2935,7 +2935,7 @@ discard block |
||
2935 | 2935 | |
2936 | 2936 | jQuery(cont).find('.filelist .file').remove(); |
2937 | 2937 | |
2938 | - jQuery('#gd-import-msg', cont).find('#message').removeClass('updated').addClass('error').html("<p><?php echo esc_attr( PLZ_SELECT_CSV_FILE );?></p>"); |
|
2938 | + jQuery('#gd-import-msg', cont).find('#message').removeClass('updated').addClass('error').html("<p><?php echo esc_attr(PLZ_SELECT_CSV_FILE); ?></p>"); |
|
2939 | 2939 | jQuery('#gd-import-msg', cont).show(); |
2940 | 2940 | |
2941 | 2941 | return false; |
@@ -2994,7 +2994,7 @@ discard block |
||
2994 | 2994 | jQuery.ajax({ |
2995 | 2995 | url: ajaxurl, |
2996 | 2996 | type: "POST", |
2997 | - data: 'action=geodir_import_export&task=import_' + type + '&_pt=' + type + '&_file=' + uploadedFile + gddata + '&_ch=' + choice + '&_nonce=<?php echo $nonce;?>', |
|
2997 | + data: 'action=geodir_import_export&task=import_' + type + '&_pt=' + type + '&_file=' + uploadedFile + gddata + '&_ch=' + choice + '&_nonce=<?php echo $nonce; ?>', |
|
2998 | 2998 | dataType : 'json', |
2999 | 2999 | cache: false, |
3000 | 3000 | success: function (data) { |
@@ -3183,27 +3183,27 @@ discard block |
||
3183 | 3183 | |
3184 | 3184 | var gdMsg = '<p></p>'; |
3185 | 3185 | if ( processed > 0 ) { |
3186 | - var msgParse = '<p><?php echo addslashes( sprintf( __( 'Total %s item(s) found.', 'geodirectory' ), '%s' ) );?></p>'; |
|
3186 | + var msgParse = '<p><?php echo addslashes(sprintf(__('Total %s item(s) found.', 'geodirectory'), '%s')); ?></p>'; |
|
3187 | 3187 | msgParse = msgParse.replace("%s", processed); |
3188 | 3188 | gdMsg += msgParse; |
3189 | 3189 | } |
3190 | 3190 | |
3191 | 3191 | if ( updated > 0 ) { |
3192 | - var msgParse = '<p><?php echo addslashes( sprintf( __( '%s / %s item(s) updated.', 'geodirectory' ), '%s', '%d' ) );?></p>'; |
|
3192 | + var msgParse = '<p><?php echo addslashes(sprintf(__('%s / %s item(s) updated.', 'geodirectory'), '%s', '%d')); ?></p>'; |
|
3193 | 3193 | msgParse = msgParse.replace("%s", updated); |
3194 | 3194 | msgParse = msgParse.replace("%d", processed); |
3195 | 3195 | gdMsg += msgParse; |
3196 | 3196 | } |
3197 | 3197 | |
3198 | 3198 | if ( created > 0 ) { |
3199 | - var msgParse = '<p><?php echo addslashes( sprintf( __( '%s / %s item(s) added.', 'geodirectory' ), '%s', '%d' ) );?></p>'; |
|
3199 | + var msgParse = '<p><?php echo addslashes(sprintf(__('%s / %s item(s) added.', 'geodirectory'), '%s', '%d')); ?></p>'; |
|
3200 | 3200 | msgParse = msgParse.replace("%s", created); |
3201 | 3201 | msgParse = msgParse.replace("%d", processed); |
3202 | 3202 | gdMsg += msgParse; |
3203 | 3203 | } |
3204 | 3204 | |
3205 | 3205 | if ( skipped > 0 ) { |
3206 | - var msgParse = '<p><?php echo addslashes( sprintf( __( '%s / %s item(s) ignored due to already exists.', 'geodirectory' ), '%s', '%d' ) );?></p>'; |
|
3206 | + var msgParse = '<p><?php echo addslashes(sprintf(__('%s / %s item(s) ignored due to already exists.', 'geodirectory'), '%s', '%d')); ?></p>'; |
|
3207 | 3207 | msgParse = msgParse.replace("%s", skipped); |
3208 | 3208 | msgParse = msgParse.replace("%d", processed); |
3209 | 3209 | gdMsg += msgParse; |
@@ -3213,17 +3213,17 @@ discard block |
||
3213 | 3213 | if (type=='loc') { |
3214 | 3214 | invalid_addr = invalid; |
3215 | 3215 | } |
3216 | - 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>'; |
|
3216 | + 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>'; |
|
3217 | 3217 | msgParse = msgParse.replace("%s", invalid_addr); |
3218 | 3218 | msgParse = msgParse.replace("%d", total); |
3219 | 3219 | gdMsg += msgParse; |
3220 | 3220 | } |
3221 | 3221 | |
3222 | 3222 | if (invalid > 0 && type!='loc') { |
3223 | - 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>'; |
|
3223 | + 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>'; |
|
3224 | 3224 | |
3225 | 3225 | if (type=='hood') { |
3226 | - 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>'; |
|
3226 | + 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>'; |
|
3227 | 3227 | } |
3228 | 3228 | msgParse = msgParse.replace("%s", invalid); |
3229 | 3229 | msgParse = msgParse.replace("%d", total); |
@@ -3231,7 +3231,7 @@ discard block |
||
3231 | 3231 | } |
3232 | 3232 | |
3233 | 3233 | if (images > 0) { |
3234 | - gdMsg += '<p><?php echo addslashes( sprintf( CSV_TRANSFER_IMG_FOLDER, $uploads['subdir'] ) );?></p>'; |
|
3234 | + gdMsg += '<p><?php echo addslashes(sprintf(CSV_TRANSFER_IMG_FOLDER, $uploads['subdir'])); ?></p>'; |
|
3235 | 3235 | } |
3236 | 3236 | gdMsg += '<p></p>'; |
3237 | 3237 | jQuery('#gd-import-msg', cont).find('#message').removeClass('error').addClass('updated').html(gdMsg); |
@@ -3380,7 +3380,7 @@ discard block |
||
3380 | 3380 | |
3381 | 3381 | function gd_process_export_posts(el, post_type, total_posts, chunk_size, pages, page) { |
3382 | 3382 | if (page < 2) { |
3383 | - gd_progressbar(el, 0, '0% (0 / ' + total_posts + ') <i class="fa fa-refresh fa-spin"></i><?php echo esc_attr( __( 'Exporting...', 'geodirectory' ) );?>'); |
|
3383 | + gd_progressbar(el, 0, '0% (0 / ' + total_posts + ') <i class="fa fa-refresh fa-spin"></i><?php echo esc_attr(__('Exporting...', 'geodirectory')); ?>'); |
|
3384 | 3384 | jQuery(el).find('#gd_timer').text('00:00:01'); |
3385 | 3385 | jQuery('#gd_ie_ex_files', el).html(''); |
3386 | 3386 | } |
@@ -3388,7 +3388,7 @@ discard block |
||
3388 | 3388 | jQuery.ajax({ |
3389 | 3389 | url: ajaxurl, |
3390 | 3390 | type: "POST", |
3391 | - data: 'action=geodir_import_export&task=export_posts&_pt=' + post_type + '&_n=' + chunk_size + '&_nonce=<?php echo $nonce;?>&_p=' + page, |
|
3391 | + data: 'action=geodir_import_export&task=export_posts&_pt=' + post_type + '&_n=' + chunk_size + '&_nonce=<?php echo $nonce; ?>&_p=' + page, |
|
3392 | 3392 | dataType : 'json', |
3393 | 3393 | cache: false, |
3394 | 3394 | beforeSend: function (jqXHR, settings) {}, |
@@ -3402,11 +3402,11 @@ discard block |
||
3402 | 3402 | } else { |
3403 | 3403 | if (pages < page || pages == page) { |
3404 | 3404 | window.clearInterval(timer_posts); |
3405 | - gd_progressbar(el, 100, '100% (' + total_posts + ' / ' + total_posts + ') <i class="fa fa-check"></i><?php echo esc_attr( __( 'Complete!', 'geodirectory' ) );?>'); |
|
3405 | + gd_progressbar(el, 100, '100% (' + total_posts + ' / ' + total_posts + ') <i class="fa fa-check"></i><?php echo esc_attr(__('Complete!', 'geodirectory')); ?>'); |
|
3406 | 3406 | } else { |
3407 | 3407 | var percentage = Math.round(((page * chunk_size) / total_posts) * 100); |
3408 | 3408 | percentage = percentage > 100 ? 100 : percentage; |
3409 | - gd_progressbar(el, percentage, '' + percentage + '% (' + ( page * chunk_size ) + ' / ' + total_posts + ') <i class="fa fa-refresh fa-spin"></i><?php echo esc_attr( __( 'Exporting...', 'geodirectory' ) );?>'); |
|
3409 | + gd_progressbar(el, percentage, '' + percentage + '% (' + ( page * chunk_size ) + ' / ' + total_posts + ') <i class="fa fa-refresh fa-spin"></i><?php echo esc_attr(__('Exporting...', 'geodirectory')); ?>'); |
|
3410 | 3410 | } |
3411 | 3411 | if (typeof data.files != 'undefined' && jQuery(data.files).length ) { |
3412 | 3412 | var obj_files = data.files; |
@@ -3436,7 +3436,7 @@ discard block |
||
3436 | 3436 | |
3437 | 3437 | function gd_process_export_cats(el, post_type, total_cats, chunk_size, pages, page) { |
3438 | 3438 | if (page < 2) { |
3439 | - gd_progressbar(el, 0, '0% (0 / ' + total_cats + ') <i class="fa fa-refresh fa-spin"></i><?php echo esc_attr( __( 'Exporting...', 'geodirectory' ) );?>'); |
|
3439 | + gd_progressbar(el, 0, '0% (0 / ' + total_cats + ') <i class="fa fa-refresh fa-spin"></i><?php echo esc_attr(__('Exporting...', 'geodirectory')); ?>'); |
|
3440 | 3440 | jQuery(el).find('#gd_timer').text('00:00:01'); |
3441 | 3441 | jQuery('#gd_ie_ex_files', el).html(''); |
3442 | 3442 | } |
@@ -3444,7 +3444,7 @@ discard block |
||
3444 | 3444 | jQuery.ajax({ |
3445 | 3445 | url: ajaxurl, |
3446 | 3446 | type: "POST", |
3447 | - data: 'action=geodir_import_export&task=export_cats&_pt=' + post_type + '&_n=' + chunk_size + '&_nonce=<?php echo $nonce;?>&_p=' + page, |
|
3447 | + data: 'action=geodir_import_export&task=export_cats&_pt=' + post_type + '&_n=' + chunk_size + '&_nonce=<?php echo $nonce; ?>&_p=' + page, |
|
3448 | 3448 | dataType : 'json', |
3449 | 3449 | cache: false, |
3450 | 3450 | beforeSend: function (jqXHR, settings) {}, |
@@ -3458,11 +3458,11 @@ discard block |
||
3458 | 3458 | } else { |
3459 | 3459 | if (pages < page || pages == page) { |
3460 | 3460 | window.clearInterval(timer_cats); |
3461 | - gd_progressbar(el, 100, '100% (' + total_cats + ' / ' + total_cats + ') <i class="fa fa-check"></i><?php echo esc_attr( __( 'Complete!', 'geodirectory' ) );?>'); |
|
3461 | + gd_progressbar(el, 100, '100% (' + total_cats + ' / ' + total_cats + ') <i class="fa fa-check"></i><?php echo esc_attr(__('Complete!', 'geodirectory')); ?>'); |
|
3462 | 3462 | } else { |
3463 | 3463 | var percentage = Math.round(((page * chunk_size) / total_cats) * 100); |
3464 | 3464 | percentage = percentage > 100 ? 100 : percentage; |
3465 | - gd_progressbar(el, percentage, '' + percentage + '% (' + ( page * chunk_size ) + ' / ' + total_cats + ') <i class="fa fa-refresh fa-spin"></i><?php esc_attr_e( 'Exporting...', 'geodirectory' );?>'); |
|
3465 | + gd_progressbar(el, percentage, '' + percentage + '% (' + ( page * chunk_size ) + ' / ' + total_cats + ') <i class="fa fa-refresh fa-spin"></i><?php esc_attr_e('Exporting...', 'geodirectory'); ?>'); |
|
3466 | 3466 | } |
3467 | 3467 | if (typeof data.files != 'undefined' && jQuery(data.files).length ) { |
3468 | 3468 | var obj_files = data.files; |
@@ -3519,13 +3519,13 @@ discard block |
||
3519 | 3519 | function geodir_init_filesystem() |
3520 | 3520 | { |
3521 | 3521 | |
3522 | - if(!function_exists('get_filesystem_method')){ |
|
3522 | + if (!function_exists('get_filesystem_method')) { |
|
3523 | 3523 | require_once(ABSPATH."/wp-admin/includes/file.php"); |
3524 | 3524 | } |
3525 | 3525 | $access_type = get_filesystem_method(); |
3526 | 3526 | if ($access_type === 'direct') { |
3527 | 3527 | /* you can safely run request_filesystem_credentials() without any issues and don't need to worry about passing in a URL */ |
3528 | - $creds = request_filesystem_credentials(trailingslashit(site_url()) . 'wp-admin/', '', false, false, array()); |
|
3528 | + $creds = request_filesystem_credentials(trailingslashit(site_url()).'wp-admin/', '', false, false, array()); |
|
3529 | 3529 | |
3530 | 3530 | /* initialize the API */ |
3531 | 3531 | if (!WP_Filesystem($creds)) { |
@@ -3538,7 +3538,7 @@ discard block |
||
3538 | 3538 | return $wp_filesystem; |
3539 | 3539 | /* do our file manipulations below */ |
3540 | 3540 | } elseif (defined('FTP_USER')) { |
3541 | - $creds = request_filesystem_credentials(trailingslashit(site_url()) . 'wp-admin/', '', false, false, array()); |
|
3541 | + $creds = request_filesystem_credentials(trailingslashit(site_url()).'wp-admin/', '', false, false, array()); |
|
3542 | 3542 | |
3543 | 3543 | /* initialize the API */ |
3544 | 3544 | if (!WP_Filesystem($creds)) { |
@@ -3573,7 +3573,7 @@ discard block |
||
3573 | 3573 | * @package GeoDirectory |
3574 | 3574 | */ |
3575 | 3575 | function geodir_filesystem_notice() |
3576 | -{ if ( defined( 'DOING_AJAX' ) ){return;} |
|
3576 | +{ if (defined('DOING_AJAX')) {return; } |
|
3577 | 3577 | $access_type = get_filesystem_method(); |
3578 | 3578 | if ($access_type === 'direct') { |
3579 | 3579 | } elseif (!defined('FTP_USER')) { |
@@ -3610,64 +3610,64 @@ discard block |
||
3610 | 3610 | // try to set higher limits for import |
3611 | 3611 | $max_input_time = ini_get('max_input_time'); |
3612 | 3612 | $max_execution_time = ini_get('max_execution_time'); |
3613 | - $memory_limit= ini_get('memory_limit'); |
|
3613 | + $memory_limit = ini_get('memory_limit'); |
|
3614 | 3614 | |
3615 | - if(!$max_input_time || $max_input_time<3000){ |
|
3615 | + if (!$max_input_time || $max_input_time < 3000) { |
|
3616 | 3616 | ini_set('max_input_time', 3000); |
3617 | 3617 | } |
3618 | 3618 | |
3619 | - if(!$max_execution_time || $max_execution_time<3000){ |
|
3619 | + if (!$max_execution_time || $max_execution_time < 3000) { |
|
3620 | 3620 | ini_set('max_execution_time', 3000); |
3621 | 3621 | } |
3622 | 3622 | |
3623 | - if($memory_limit && str_replace('M','',$memory_limit)){ |
|
3624 | - if(str_replace('M','',$memory_limit)<256){ |
|
3623 | + if ($memory_limit && str_replace('M', '', $memory_limit)) { |
|
3624 | + if (str_replace('M', '', $memory_limit) < 256) { |
|
3625 | 3625 | ini_set('memory_limit', '256M'); |
3626 | 3626 | } |
3627 | 3627 | } |
3628 | 3628 | |
3629 | 3629 | $json = array(); |
3630 | 3630 | |
3631 | - if ( !current_user_can( 'manage_options' ) ) { |
|
3632 | - wp_send_json( $json ); |
|
3631 | + if (!current_user_can('manage_options')) { |
|
3632 | + wp_send_json($json); |
|
3633 | 3633 | } |
3634 | 3634 | |
3635 | - $task = isset( $_REQUEST['task'] ) ? $_REQUEST['task'] : NULL; |
|
3636 | - $nonce = isset( $_REQUEST['_nonce'] ) ? $_REQUEST['_nonce'] : NULL; |
|
3637 | - $stat = isset( $_REQUEST['_st'] ) ? $_REQUEST['_st'] : false; |
|
3635 | + $task = isset($_REQUEST['task']) ? $_REQUEST['task'] : NULL; |
|
3636 | + $nonce = isset($_REQUEST['_nonce']) ? $_REQUEST['_nonce'] : NULL; |
|
3637 | + $stat = isset($_REQUEST['_st']) ? $_REQUEST['_st'] : false; |
|
3638 | 3638 | |
3639 | - if ( !wp_verify_nonce( $nonce, 'geodir_import_export_nonce' ) ) { |
|
3640 | - wp_send_json( $json ); |
|
3639 | + if (!wp_verify_nonce($nonce, 'geodir_import_export_nonce')) { |
|
3640 | + wp_send_json($json); |
|
3641 | 3641 | } |
3642 | 3642 | |
3643 | - $post_type = isset( $_REQUEST['_pt'] ) ? $_REQUEST['_pt'] : NULL; |
|
3644 | - $chunk_per_page = isset( $_REQUEST['_n'] ) ? absint($_REQUEST['_n']) : NULL; |
|
3643 | + $post_type = isset($_REQUEST['_pt']) ? $_REQUEST['_pt'] : NULL; |
|
3644 | + $chunk_per_page = isset($_REQUEST['_n']) ? absint($_REQUEST['_n']) : NULL; |
|
3645 | 3645 | $chunk_per_page = $chunk_per_page < 50 || $chunk_per_page > 100000 ? 5000 : $chunk_per_page; |
3646 | - $chunk_page_no = isset( $_REQUEST['_p'] ) ? absint($_REQUEST['_p']) : 1; |
|
3646 | + $chunk_page_no = isset($_REQUEST['_p']) ? absint($_REQUEST['_p']) : 1; |
|
3647 | 3647 | |
3648 | 3648 | $wp_filesystem = geodir_init_filesystem(); |
3649 | 3649 | if (!$wp_filesystem) { |
3650 | - $json['error'] = __( 'Filesystem ERROR: Could not access filesystem.', 'geodirectory' ); |
|
3651 | - wp_send_json( $json ); |
|
3650 | + $json['error'] = __('Filesystem ERROR: Could not access filesystem.', 'geodirectory'); |
|
3651 | + wp_send_json($json); |
|
3652 | 3652 | } |
3653 | 3653 | |
3654 | 3654 | if (!empty($wp_filesystem) && isset($wp_filesystem->errors) && is_wp_error($wp_filesystem->errors) && $wp_filesystem->errors->get_error_code()) { |
3655 | - $json['error'] = __( 'Filesystem ERROR: ' . $wp_filesystem->errors->get_error_message(), 'geodirectory' ); |
|
3656 | - wp_send_json( $json ); |
|
3655 | + $json['error'] = __('Filesystem ERROR: '.$wp_filesystem->errors->get_error_message(), 'geodirectory'); |
|
3656 | + wp_send_json($json); |
|
3657 | 3657 | } |
3658 | 3658 | |
3659 | - $csv_file_dir = geodir_path_import_export( false ); |
|
3660 | - if ( !$wp_filesystem->is_dir( $csv_file_dir ) ) { |
|
3661 | - if ( !$wp_filesystem->mkdir( $csv_file_dir, FS_CHMOD_DIR ) ) { |
|
3662 | - $json['error'] = __( 'ERROR: Could not create cache directory. This is usually due to inconsistent file permissions.', 'geodirectory' ); |
|
3663 | - wp_send_json( $json ); |
|
3659 | + $csv_file_dir = geodir_path_import_export(false); |
|
3660 | + if (!$wp_filesystem->is_dir($csv_file_dir)) { |
|
3661 | + if (!$wp_filesystem->mkdir($csv_file_dir, FS_CHMOD_DIR)) { |
|
3662 | + $json['error'] = __('ERROR: Could not create cache directory. This is usually due to inconsistent file permissions.', 'geodirectory'); |
|
3663 | + wp_send_json($json); |
|
3664 | 3664 | } |
3665 | 3665 | } |
3666 | 3666 | |
3667 | 3667 | $location_manager = function_exists('geodir_location_plugin_activated') ? true : false; // Check location manager installed & active. |
3668 | 3668 | $neighbourhood_active = $location_manager && get_option('location_neighbourhoods') ? true : false; |
3669 | 3669 | |
3670 | - switch ( $task ) { |
|
3670 | + switch ($task) { |
|
3671 | 3671 | case 'export_posts': { |
3672 | 3672 | // WPML |
3673 | 3673 | $is_wpml = geodir_is_wpml(); |
@@ -3678,22 +3678,22 @@ discard block |
||
3678 | 3678 | $sitepress->switch_lang('all', true); |
3679 | 3679 | } |
3680 | 3680 | // WPML |
3681 | - if ( $post_type == 'gd_event' ) { |
|
3682 | - add_filter( 'geodir_imex_export_posts_query', 'geodir_imex_get_events_query', 10, 2 ); |
|
3681 | + if ($post_type == 'gd_event') { |
|
3682 | + add_filter('geodir_imex_export_posts_query', 'geodir_imex_get_events_query', 10, 2); |
|
3683 | 3683 | } |
3684 | - $file_name = $post_type . '_' . date( 'dmyHi' ); |
|
3685 | - $posts_count = geodir_get_posts_count( $post_type ); |
|
3686 | - $file_url_base = geodir_path_import_export() . '/'; |
|
3687 | - $file_url = $file_url_base . $file_name . '.csv'; |
|
3688 | - $file_path = $csv_file_dir . '/' . $file_name . '.csv'; |
|
3689 | - $file_path_temp = $csv_file_dir . '/' . $post_type . '_' . $nonce . '.csv'; |
|
3684 | + $file_name = $post_type.'_'.date('dmyHi'); |
|
3685 | + $posts_count = geodir_get_posts_count($post_type); |
|
3686 | + $file_url_base = geodir_path_import_export().'/'; |
|
3687 | + $file_url = $file_url_base.$file_name.'.csv'; |
|
3688 | + $file_path = $csv_file_dir.'/'.$file_name.'.csv'; |
|
3689 | + $file_path_temp = $csv_file_dir.'/'.$post_type.'_'.$nonce.'.csv'; |
|
3690 | 3690 | |
3691 | 3691 | $chunk_file_paths = array(); |
3692 | 3692 | |
3693 | - if ( isset( $_REQUEST['_st'] ) ) { |
|
3694 | - $line_count = (int)geodir_import_export_line_count( $file_path_temp ); |
|
3695 | - $percentage = count( $posts_count ) > 0 && $line_count > 0 ? ceil( $line_count / $posts_count ) * 100 : 0; |
|
3696 | - $percentage = min( $percentage, 100 ); |
|
3693 | + if (isset($_REQUEST['_st'])) { |
|
3694 | + $line_count = (int) geodir_import_export_line_count($file_path_temp); |
|
3695 | + $percentage = count($posts_count) > 0 && $line_count > 0 ? ceil($line_count / $posts_count) * 100 : 0; |
|
3696 | + $percentage = min($percentage, 100); |
|
3697 | 3697 | |
3698 | 3698 | $json['percentage'] = $percentage; |
3699 | 3699 | // WPML |
@@ -3701,45 +3701,45 @@ discard block |
||
3701 | 3701 | $sitepress->switch_lang($active_lang, true); |
3702 | 3702 | } |
3703 | 3703 | // WPML |
3704 | - wp_send_json( $json ); |
|
3704 | + wp_send_json($json); |
|
3705 | 3705 | gd_die(); |
3706 | 3706 | } else { |
3707 | - if ( !$posts_count > 0 ) { |
|
3708 | - $json['error'] = __( 'No records to export.', 'geodirectory' ); |
|
3707 | + if (!$posts_count > 0) { |
|
3708 | + $json['error'] = __('No records to export.', 'geodirectory'); |
|
3709 | 3709 | } else { |
3710 | 3710 | $total_posts = $posts_count; |
3711 | 3711 | if ($chunk_per_page > $total_posts) { |
3712 | 3712 | $chunk_per_page = $total_posts; |
3713 | 3713 | } |
3714 | - $chunk_total_pages = ceil( $total_posts / $chunk_per_page ); |
|
3714 | + $chunk_total_pages = ceil($total_posts / $chunk_per_page); |
|
3715 | 3715 | |
3716 | 3716 | $j = $chunk_page_no; |
3717 | - $chunk_save_posts = geodir_imex_get_posts( $post_type, $chunk_per_page, $j ); |
|
3717 | + $chunk_save_posts = geodir_imex_get_posts($post_type, $chunk_per_page, $j); |
|
3718 | 3718 | |
3719 | 3719 | $per_page = 500; |
3720 | 3720 | if ($per_page > $chunk_per_page) { |
3721 | 3721 | $per_page = $chunk_per_page; |
3722 | 3722 | } |
3723 | - $total_pages = ceil( $chunk_per_page / $per_page ); |
|
3723 | + $total_pages = ceil($chunk_per_page / $per_page); |
|
3724 | 3724 | |
3725 | - for ( $i = 0; $i <= $total_pages; $i++ ) { |
|
3726 | - $save_posts = array_slice( $chunk_save_posts , ( $i * $per_page ), $per_page ); |
|
3725 | + for ($i = 0; $i <= $total_pages; $i++) { |
|
3726 | + $save_posts = array_slice($chunk_save_posts, ($i * $per_page), $per_page); |
|
3727 | 3727 | |
3728 | 3728 | $clear = $i == 0 ? true : false; |
3729 | - geodir_save_csv_data( $file_path_temp, $save_posts, $clear ); |
|
3729 | + geodir_save_csv_data($file_path_temp, $save_posts, $clear); |
|
3730 | 3730 | } |
3731 | 3731 | |
3732 | - if ( $wp_filesystem->exists( $file_path_temp ) ) { |
|
3733 | - $chunk_page_no = $chunk_total_pages > 1 ? '-' . $j : ''; |
|
3734 | - $chunk_file_name = $file_name . $chunk_page_no . '.csv'; |
|
3735 | - $file_path = $csv_file_dir . '/' . $chunk_file_name; |
|
3736 | - $wp_filesystem->move( $file_path_temp, $file_path, true ); |
|
3732 | + if ($wp_filesystem->exists($file_path_temp)) { |
|
3733 | + $chunk_page_no = $chunk_total_pages > 1 ? '-'.$j : ''; |
|
3734 | + $chunk_file_name = $file_name.$chunk_page_no.'.csv'; |
|
3735 | + $file_path = $csv_file_dir.'/'.$chunk_file_name; |
|
3736 | + $wp_filesystem->move($file_path_temp, $file_path, true); |
|
3737 | 3737 | |
3738 | - $file_url = $file_url_base . $chunk_file_name; |
|
3739 | - $chunk_file_paths[] = array('i' => $j . '.', 'u' => $file_url, 's' => size_format(filesize($file_path), 2)); |
|
3738 | + $file_url = $file_url_base.$chunk_file_name; |
|
3739 | + $chunk_file_paths[] = array('i' => $j.'.', 'u' => $file_url, 's' => size_format(filesize($file_path), 2)); |
|
3740 | 3740 | } |
3741 | 3741 | |
3742 | - if ( !empty($chunk_file_paths) ) { |
|
3742 | + if (!empty($chunk_file_paths)) { |
|
3743 | 3743 | $json['total'] = $posts_count; |
3744 | 3744 | $json['files'] = $chunk_file_paths; |
3745 | 3745 | } else { |
@@ -3747,7 +3747,7 @@ discard block |
||
3747 | 3747 | $json['total'] = $posts_count; |
3748 | 3748 | $json['files'] = array(); |
3749 | 3749 | } else { |
3750 | - $json['error'] = __( 'ERROR: Could not create csv file. This is usually due to inconsistent file permissions.', 'geodirectory' ); |
|
3750 | + $json['error'] = __('ERROR: Could not create csv file. This is usually due to inconsistent file permissions.', 'geodirectory'); |
|
3751 | 3751 | } |
3752 | 3752 | } |
3753 | 3753 | } |
@@ -3756,7 +3756,7 @@ discard block |
||
3756 | 3756 | $sitepress->switch_lang($active_lang, true); |
3757 | 3757 | } |
3758 | 3758 | // WPML |
3759 | - wp_send_json( $json ); |
|
3759 | + wp_send_json($json); |
|
3760 | 3760 | } |
3761 | 3761 | } |
3762 | 3762 | break; |
@@ -3770,20 +3770,20 @@ discard block |
||
3770 | 3770 | $sitepress->switch_lang('all', true); |
3771 | 3771 | } |
3772 | 3772 | // WPML |
3773 | - $file_name = $post_type . 'category_' . date( 'dmyHi' ); |
|
3773 | + $file_name = $post_type.'category_'.date('dmyHi'); |
|
3774 | 3774 | |
3775 | - $terms_count = geodir_get_terms_count( $post_type ); |
|
3776 | - $file_url_base = geodir_path_import_export() . '/'; |
|
3777 | - $file_url = $file_url_base . $file_name . '.csv'; |
|
3778 | - $file_path = $csv_file_dir . '/' . $file_name . '.csv'; |
|
3779 | - $file_path_temp = $csv_file_dir . '/' . $post_type . 'category_' . $nonce . '.csv'; |
|
3775 | + $terms_count = geodir_get_terms_count($post_type); |
|
3776 | + $file_url_base = geodir_path_import_export().'/'; |
|
3777 | + $file_url = $file_url_base.$file_name.'.csv'; |
|
3778 | + $file_path = $csv_file_dir.'/'.$file_name.'.csv'; |
|
3779 | + $file_path_temp = $csv_file_dir.'/'.$post_type.'category_'.$nonce.'.csv'; |
|
3780 | 3780 | |
3781 | 3781 | $chunk_file_paths = array(); |
3782 | 3782 | |
3783 | - if ( isset( $_REQUEST['_st'] ) ) { |
|
3784 | - $line_count = (int)geodir_import_export_line_count( $file_path_temp ); |
|
3785 | - $percentage = count( $terms_count ) > 0 && $line_count > 0 ? ceil( $line_count / $terms_count ) * 100 : 0; |
|
3786 | - $percentage = min( $percentage, 100 ); |
|
3783 | + if (isset($_REQUEST['_st'])) { |
|
3784 | + $line_count = (int) geodir_import_export_line_count($file_path_temp); |
|
3785 | + $percentage = count($terms_count) > 0 && $line_count > 0 ? ceil($line_count / $terms_count) * 100 : 0; |
|
3786 | + $percentage = min($percentage, 100); |
|
3787 | 3787 | |
3788 | 3788 | $json['percentage'] = $percentage; |
3789 | 3789 | // WPML |
@@ -3791,48 +3791,48 @@ discard block |
||
3791 | 3791 | $sitepress->switch_lang($active_lang, true); |
3792 | 3792 | } |
3793 | 3793 | // WPML |
3794 | - wp_send_json( $json ); |
|
3794 | + wp_send_json($json); |
|
3795 | 3795 | } else { |
3796 | - if ( !$terms_count > 0 ) { |
|
3797 | - $json['error'] = __( 'No records to export.', 'geodirectory' ); |
|
3796 | + if (!$terms_count > 0) { |
|
3797 | + $json['error'] = __('No records to export.', 'geodirectory'); |
|
3798 | 3798 | } else { |
3799 | 3799 | $total_terms = $terms_count; |
3800 | 3800 | if ($chunk_per_page > $terms_count) { |
3801 | 3801 | $chunk_per_page = $terms_count; |
3802 | 3802 | } |
3803 | - $chunk_total_pages = ceil( $total_terms / $chunk_per_page ); |
|
3803 | + $chunk_total_pages = ceil($total_terms / $chunk_per_page); |
|
3804 | 3804 | |
3805 | 3805 | $j = $chunk_page_no; |
3806 | - $chunk_save_terms = geodir_imex_get_terms( $post_type, $chunk_per_page, $j ); |
|
3806 | + $chunk_save_terms = geodir_imex_get_terms($post_type, $chunk_per_page, $j); |
|
3807 | 3807 | |
3808 | 3808 | $per_page = 500; |
3809 | 3809 | if ($per_page > $chunk_per_page) { |
3810 | 3810 | $per_page = $chunk_per_page; |
3811 | 3811 | } |
3812 | - $total_pages = ceil( $chunk_per_page / $per_page ); |
|
3812 | + $total_pages = ceil($chunk_per_page / $per_page); |
|
3813 | 3813 | |
3814 | - for ( $i = 0; $i <= $total_pages; $i++ ) { |
|
3815 | - $save_terms = array_slice( $chunk_save_terms , ( $i * $per_page ), $per_page ); |
|
3814 | + for ($i = 0; $i <= $total_pages; $i++) { |
|
3815 | + $save_terms = array_slice($chunk_save_terms, ($i * $per_page), $per_page); |
|
3816 | 3816 | |
3817 | 3817 | $clear = $i == 0 ? true : false; |
3818 | - geodir_save_csv_data( $file_path_temp, $save_terms, $clear ); |
|
3818 | + geodir_save_csv_data($file_path_temp, $save_terms, $clear); |
|
3819 | 3819 | } |
3820 | 3820 | |
3821 | - if ( $wp_filesystem->exists( $file_path_temp ) ) { |
|
3822 | - $chunk_page_no = $chunk_total_pages > 1 ? '-' . $j : ''; |
|
3823 | - $chunk_file_name = $file_name . $chunk_page_no . '.csv'; |
|
3824 | - $file_path = $csv_file_dir . '/' . $chunk_file_name; |
|
3825 | - $wp_filesystem->move( $file_path_temp, $file_path, true ); |
|
3821 | + if ($wp_filesystem->exists($file_path_temp)) { |
|
3822 | + $chunk_page_no = $chunk_total_pages > 1 ? '-'.$j : ''; |
|
3823 | + $chunk_file_name = $file_name.$chunk_page_no.'.csv'; |
|
3824 | + $file_path = $csv_file_dir.'/'.$chunk_file_name; |
|
3825 | + $wp_filesystem->move($file_path_temp, $file_path, true); |
|
3826 | 3826 | |
3827 | - $file_url = $file_url_base . $chunk_file_name; |
|
3828 | - $chunk_file_paths[] = array('i' => $j . '.', 'u' => $file_url, 's' => size_format(filesize($file_path), 2)); |
|
3827 | + $file_url = $file_url_base.$chunk_file_name; |
|
3828 | + $chunk_file_paths[] = array('i' => $j.'.', 'u' => $file_url, 's' => size_format(filesize($file_path), 2)); |
|
3829 | 3829 | } |
3830 | 3830 | |
3831 | - if ( !empty($chunk_file_paths) ) { |
|
3831 | + if (!empty($chunk_file_paths)) { |
|
3832 | 3832 | $json['total'] = $terms_count; |
3833 | 3833 | $json['files'] = $chunk_file_paths; |
3834 | 3834 | } else { |
3835 | - $json['error'] = __( 'ERROR: Could not create csv file. This is usually due to inconsistent file permissions.', 'geodirectory' ); |
|
3835 | + $json['error'] = __('ERROR: Could not create csv file. This is usually due to inconsistent file permissions.', 'geodirectory'); |
|
3836 | 3836 | } |
3837 | 3837 | } |
3838 | 3838 | // WPML |
@@ -3840,127 +3840,127 @@ discard block |
||
3840 | 3840 | $sitepress->switch_lang($active_lang, true); |
3841 | 3841 | } |
3842 | 3842 | // WPML |
3843 | - wp_send_json( $json ); |
|
3843 | + wp_send_json($json); |
|
3844 | 3844 | } |
3845 | 3845 | } |
3846 | 3846 | break; |
3847 | 3847 | case 'export_locations': { |
3848 | - $file_url_base = geodir_path_import_export() . '/'; |
|
3849 | - $file_name = 'gd_locations_' . date( 'dmyHi' ); |
|
3850 | - $file_url = $file_url_base . $file_name . '.csv'; |
|
3851 | - $file_path = $csv_file_dir . '/' . $file_name . '.csv'; |
|
3852 | - $file_path_temp = $csv_file_dir . '/gd_locations_' . $nonce . '.csv'; |
|
3848 | + $file_url_base = geodir_path_import_export().'/'; |
|
3849 | + $file_name = 'gd_locations_'.date('dmyHi'); |
|
3850 | + $file_url = $file_url_base.$file_name.'.csv'; |
|
3851 | + $file_path = $csv_file_dir.'/'.$file_name.'.csv'; |
|
3852 | + $file_path_temp = $csv_file_dir.'/gd_locations_'.$nonce.'.csv'; |
|
3853 | 3853 | |
3854 | - $items_count = (int)geodir_location_imex_count_locations(); |
|
3854 | + $items_count = (int) geodir_location_imex_count_locations(); |
|
3855 | 3855 | |
3856 | - if ( isset( $_REQUEST['_st'] ) ) { |
|
3857 | - $line_count = (int)geodir_import_export_line_count( $file_path_temp ); |
|
3858 | - $percentage = count( $items_count ) > 0 && $line_count > 0 ? ceil( $line_count / $items_count ) * 100 : 0; |
|
3859 | - $percentage = min( $percentage, 100 ); |
|
3856 | + if (isset($_REQUEST['_st'])) { |
|
3857 | + $line_count = (int) geodir_import_export_line_count($file_path_temp); |
|
3858 | + $percentage = count($items_count) > 0 && $line_count > 0 ? ceil($line_count / $items_count) * 100 : 0; |
|
3859 | + $percentage = min($percentage, 100); |
|
3860 | 3860 | |
3861 | 3861 | $json['percentage'] = $percentage; |
3862 | - wp_send_json( $json ); |
|
3862 | + wp_send_json($json); |
|
3863 | 3863 | } else { |
3864 | 3864 | $chunk_file_paths = array(); |
3865 | 3865 | |
3866 | - if ( !$items_count > 0 ) { |
|
3867 | - $json['error'] = __( 'No records to export.', 'geodirectory' ); |
|
3866 | + if (!$items_count > 0) { |
|
3867 | + $json['error'] = __('No records to export.', 'geodirectory'); |
|
3868 | 3868 | } else { |
3869 | - $chunk_per_page = min( $chunk_per_page, $items_count ); |
|
3870 | - $chunk_total_pages = ceil( $items_count / $chunk_per_page ); |
|
3869 | + $chunk_per_page = min($chunk_per_page, $items_count); |
|
3870 | + $chunk_total_pages = ceil($items_count / $chunk_per_page); |
|
3871 | 3871 | |
3872 | 3872 | $j = $chunk_page_no; |
3873 | - $chunk_save_items = geodir_location_imex_locations_data( $chunk_per_page, $j ); |
|
3873 | + $chunk_save_items = geodir_location_imex_locations_data($chunk_per_page, $j); |
|
3874 | 3874 | |
3875 | 3875 | $per_page = 500; |
3876 | - $per_page = min( $per_page, $chunk_per_page ); |
|
3877 | - $total_pages = ceil( $chunk_per_page / $per_page ); |
|
3876 | + $per_page = min($per_page, $chunk_per_page); |
|
3877 | + $total_pages = ceil($chunk_per_page / $per_page); |
|
3878 | 3878 | |
3879 | - for ( $i = 0; $i <= $total_pages; $i++ ) { |
|
3880 | - $save_items = array_slice( $chunk_save_items , ( $i * $per_page ), $per_page ); |
|
3879 | + for ($i = 0; $i <= $total_pages; $i++) { |
|
3880 | + $save_items = array_slice($chunk_save_items, ($i * $per_page), $per_page); |
|
3881 | 3881 | |
3882 | 3882 | $clear = $i == 0 ? true : false; |
3883 | - geodir_save_csv_data( $file_path_temp, $save_items, $clear ); |
|
3883 | + geodir_save_csv_data($file_path_temp, $save_items, $clear); |
|
3884 | 3884 | } |
3885 | 3885 | |
3886 | - if ( $wp_filesystem->exists( $file_path_temp ) ) { |
|
3887 | - $chunk_page_no = $chunk_total_pages > 1 ? '-' . $j : ''; |
|
3888 | - $chunk_file_name = $file_name . $chunk_page_no . '.csv'; |
|
3889 | - $file_path = $csv_file_dir . '/' . $chunk_file_name; |
|
3890 | - $wp_filesystem->move( $file_path_temp, $file_path, true ); |
|
3886 | + if ($wp_filesystem->exists($file_path_temp)) { |
|
3887 | + $chunk_page_no = $chunk_total_pages > 1 ? '-'.$j : ''; |
|
3888 | + $chunk_file_name = $file_name.$chunk_page_no.'.csv'; |
|
3889 | + $file_path = $csv_file_dir.'/'.$chunk_file_name; |
|
3890 | + $wp_filesystem->move($file_path_temp, $file_path, true); |
|
3891 | 3891 | |
3892 | - $file_url = $file_url_base . $chunk_file_name; |
|
3893 | - $chunk_file_paths[] = array('i' => $j . '.', 'u' => $file_url, 's' => size_format(filesize($file_path), 2)); |
|
3892 | + $file_url = $file_url_base.$chunk_file_name; |
|
3893 | + $chunk_file_paths[] = array('i' => $j.'.', 'u' => $file_url, 's' => size_format(filesize($file_path), 2)); |
|
3894 | 3894 | } |
3895 | 3895 | |
3896 | - if ( !empty($chunk_file_paths) ) { |
|
3896 | + if (!empty($chunk_file_paths)) { |
|
3897 | 3897 | $json['total'] = $items_count; |
3898 | 3898 | $json['files'] = $chunk_file_paths; |
3899 | 3899 | } else { |
3900 | - $json['error'] = __( 'Fail, something wrong to create csv file.', 'geodirectory' ); |
|
3900 | + $json['error'] = __('Fail, something wrong to create csv file.', 'geodirectory'); |
|
3901 | 3901 | } |
3902 | 3902 | } |
3903 | - wp_send_json( $json ); |
|
3903 | + wp_send_json($json); |
|
3904 | 3904 | } |
3905 | 3905 | } |
3906 | 3906 | break; |
3907 | 3907 | case 'export_hoods': { |
3908 | - $file_url_base = geodir_path_import_export() . '/'; |
|
3909 | - $file_name = 'gd_neighbourhoods_' . date( 'dmyHi' ); |
|
3910 | - $file_url = $file_url_base . $file_name . '.csv'; |
|
3911 | - $file_path = $csv_file_dir . '/' . $file_name . '.csv'; |
|
3912 | - $file_path_temp = $csv_file_dir . '/gd_neighbourhoods_' . $nonce . '.csv'; |
|
3908 | + $file_url_base = geodir_path_import_export().'/'; |
|
3909 | + $file_name = 'gd_neighbourhoods_'.date('dmyHi'); |
|
3910 | + $file_url = $file_url_base.$file_name.'.csv'; |
|
3911 | + $file_path = $csv_file_dir.'/'.$file_name.'.csv'; |
|
3912 | + $file_path_temp = $csv_file_dir.'/gd_neighbourhoods_'.$nonce.'.csv'; |
|
3913 | 3913 | |
3914 | - $items_count = (int)geodir_location_imex_count_neighbourhoods(); |
|
3914 | + $items_count = (int) geodir_location_imex_count_neighbourhoods(); |
|
3915 | 3915 | |
3916 | - if ( isset( $_REQUEST['_st'] ) ) { |
|
3917 | - $line_count = (int)geodir_import_export_line_count( $file_path_temp ); |
|
3918 | - $percentage = count( $items_count ) > 0 && $line_count > 0 ? ceil( $line_count / $items_count ) * 100 : 0; |
|
3919 | - $percentage = min( $percentage, 100 ); |
|
3916 | + if (isset($_REQUEST['_st'])) { |
|
3917 | + $line_count = (int) geodir_import_export_line_count($file_path_temp); |
|
3918 | + $percentage = count($items_count) > 0 && $line_count > 0 ? ceil($line_count / $items_count) * 100 : 0; |
|
3919 | + $percentage = min($percentage, 100); |
|
3920 | 3920 | |
3921 | 3921 | $json['percentage'] = $percentage; |
3922 | - wp_send_json( $json ); |
|
3922 | + wp_send_json($json); |
|
3923 | 3923 | } else { |
3924 | 3924 | $chunk_file_paths = array(); |
3925 | 3925 | |
3926 | - if ( !$items_count > 0 ) { |
|
3927 | - $json['error'] = __( 'No records to export.', 'geodirectory' ); |
|
3926 | + if (!$items_count > 0) { |
|
3927 | + $json['error'] = __('No records to export.', 'geodirectory'); |
|
3928 | 3928 | } else { |
3929 | - $chunk_per_page = min( $chunk_per_page, $items_count ); |
|
3930 | - $chunk_total_pages = ceil( $items_count / $chunk_per_page ); |
|
3929 | + $chunk_per_page = min($chunk_per_page, $items_count); |
|
3930 | + $chunk_total_pages = ceil($items_count / $chunk_per_page); |
|
3931 | 3931 | |
3932 | 3932 | $j = $chunk_page_no; |
3933 | - $chunk_save_items = geodir_location_imex_neighbourhoods_data( $chunk_per_page, $j ); |
|
3933 | + $chunk_save_items = geodir_location_imex_neighbourhoods_data($chunk_per_page, $j); |
|
3934 | 3934 | |
3935 | 3935 | $per_page = 500; |
3936 | - $per_page = min( $per_page, $chunk_per_page ); |
|
3937 | - $total_pages = ceil( $chunk_per_page / $per_page ); |
|
3936 | + $per_page = min($per_page, $chunk_per_page); |
|
3937 | + $total_pages = ceil($chunk_per_page / $per_page); |
|
3938 | 3938 | |
3939 | - for ( $i = 0; $i <= $total_pages; $i++ ) { |
|
3940 | - $save_items = array_slice( $chunk_save_items , ( $i * $per_page ), $per_page ); |
|
3939 | + for ($i = 0; $i <= $total_pages; $i++) { |
|
3940 | + $save_items = array_slice($chunk_save_items, ($i * $per_page), $per_page); |
|
3941 | 3941 | |
3942 | 3942 | $clear = $i == 0 ? true : false; |
3943 | - geodir_save_csv_data( $file_path_temp, $save_items, $clear ); |
|
3943 | + geodir_save_csv_data($file_path_temp, $save_items, $clear); |
|
3944 | 3944 | } |
3945 | 3945 | |
3946 | - if ( $wp_filesystem->exists( $file_path_temp ) ) { |
|
3947 | - $chunk_page_no = $chunk_total_pages > 1 ? '-' . $j : ''; |
|
3948 | - $chunk_file_name = $file_name . $chunk_page_no . '.csv'; |
|
3949 | - $file_path = $csv_file_dir . '/' . $chunk_file_name; |
|
3950 | - $wp_filesystem->move( $file_path_temp, $file_path, true ); |
|
3946 | + if ($wp_filesystem->exists($file_path_temp)) { |
|
3947 | + $chunk_page_no = $chunk_total_pages > 1 ? '-'.$j : ''; |
|
3948 | + $chunk_file_name = $file_name.$chunk_page_no.'.csv'; |
|
3949 | + $file_path = $csv_file_dir.'/'.$chunk_file_name; |
|
3950 | + $wp_filesystem->move($file_path_temp, $file_path, true); |
|
3951 | 3951 | |
3952 | - $file_url = $file_url_base . $chunk_file_name; |
|
3953 | - $chunk_file_paths[] = array('i' => $j . '.', 'u' => $file_url, 's' => size_format(filesize($file_path), 2)); |
|
3952 | + $file_url = $file_url_base.$chunk_file_name; |
|
3953 | + $chunk_file_paths[] = array('i' => $j.'.', 'u' => $file_url, 's' => size_format(filesize($file_path), 2)); |
|
3954 | 3954 | } |
3955 | 3955 | |
3956 | - if ( !empty($chunk_file_paths) ) { |
|
3956 | + if (!empty($chunk_file_paths)) { |
|
3957 | 3957 | $json['total'] = $items_count; |
3958 | 3958 | $json['files'] = $chunk_file_paths; |
3959 | 3959 | } else { |
3960 | - $json['error'] = __( 'Fail, something wrong to create csv file.', 'geodirectory' ); |
|
3960 | + $json['error'] = __('Fail, something wrong to create csv file.', 'geodirectory'); |
|
3961 | 3961 | } |
3962 | 3962 | } |
3963 | - wp_send_json( $json ); |
|
3963 | + wp_send_json($json); |
|
3964 | 3964 | } |
3965 | 3965 | } |
3966 | 3966 | break; |
@@ -3977,33 +3977,33 @@ discard block |
||
3977 | 3977 | } |
3978 | 3978 | // WPML |
3979 | 3979 | |
3980 | - ini_set( 'auto_detect_line_endings', true ); |
|
3980 | + ini_set('auto_detect_line_endings', true); |
|
3981 | 3981 | |
3982 | 3982 | $uploads = wp_upload_dir(); |
3983 | 3983 | $uploads_dir = $uploads['path']; |
3984 | 3984 | $uploads_subdir = $uploads['subdir']; |
3985 | 3985 | |
3986 | - $csv_file = isset( $_POST['_file'] ) ? $_POST['_file'] : NULL; |
|
3987 | - $import_choice = isset( $_REQUEST['_ch'] ) ? $_REQUEST['_ch'] : 'skip'; |
|
3986 | + $csv_file = isset($_POST['_file']) ? $_POST['_file'] : NULL; |
|
3987 | + $import_choice = isset($_REQUEST['_ch']) ? $_REQUEST['_ch'] : 'skip'; |
|
3988 | 3988 | |
3989 | - $csv_file_arr = explode( '/', $csv_file ); |
|
3990 | - $csv_filename = end( $csv_file_arr ); |
|
3991 | - $target_path = $uploads_dir . '/temp_' . $current_user->data->ID . '/' . $csv_filename; |
|
3989 | + $csv_file_arr = explode('/', $csv_file); |
|
3990 | + $csv_filename = end($csv_file_arr); |
|
3991 | + $target_path = $uploads_dir.'/temp_'.$current_user->data->ID.'/'.$csv_filename; |
|
3992 | 3992 | |
3993 | 3993 | $json['file'] = $csv_file; |
3994 | - $json['error'] = __( 'The uploaded file is not a valid csv file. Please try again.', 'geodirectory' ); |
|
3994 | + $json['error'] = __('The uploaded file is not a valid csv file. Please try again.', 'geodirectory'); |
|
3995 | 3995 | $file = array(); |
3996 | 3996 | |
3997 | - if ( $csv_file && $wp_filesystem->is_file( $target_path ) && $wp_filesystem->exists( $target_path ) ) { |
|
3998 | - $wp_filetype = wp_check_filetype_and_ext( $target_path, $csv_filename ); |
|
3997 | + if ($csv_file && $wp_filesystem->is_file($target_path) && $wp_filesystem->exists($target_path)) { |
|
3998 | + $wp_filetype = wp_check_filetype_and_ext($target_path, $csv_filename); |
|
3999 | 3999 | |
4000 | 4000 | if (!empty($wp_filetype) && isset($wp_filetype['ext']) && geodir_strtolower($wp_filetype['ext']) == 'csv') { |
4001 | 4001 | $json['error'] = NULL; |
4002 | 4002 | $json['rows'] = 0; |
4003 | 4003 | |
4004 | - if ( ( $handle = fopen($target_path, "r" ) ) !== FALSE ) { |
|
4005 | - while ( ( $data = fgetcsv( $handle, 100000, "," ) ) !== FALSE ) { |
|
4006 | - if ( !empty( $data ) ) { |
|
4004 | + if (($handle = fopen($target_path, "r")) !== FALSE) { |
|
4005 | + while (($data = fgetcsv($handle, 100000, ",")) !== FALSE) { |
|
4006 | + if (!empty($data)) { |
|
4007 | 4007 | $file[] = $data; |
4008 | 4008 | } |
4009 | 4009 | } |
@@ -4016,19 +4016,19 @@ discard block |
||
4016 | 4016 | $json['error'] = __('No data found in csv file.', 'geodirectory'); |
4017 | 4017 | } |
4018 | 4018 | } else { |
4019 | - wp_send_json( $json ); |
|
4019 | + wp_send_json($json); |
|
4020 | 4020 | } |
4021 | 4021 | } else { |
4022 | - wp_send_json( $json ); |
|
4022 | + wp_send_json($json); |
|
4023 | 4023 | } |
4024 | 4024 | |
4025 | - if ( $task == 'prepare_import' || !empty( $json['error'] ) ) { |
|
4026 | - wp_send_json( $json ); |
|
4025 | + if ($task == 'prepare_import' || !empty($json['error'])) { |
|
4026 | + wp_send_json($json); |
|
4027 | 4027 | } |
4028 | 4028 | |
4029 | 4029 | $total = $json['rows']; |
4030 | - $limit = isset($_POST['limit']) ? (int)$_POST['limit'] : 1; |
|
4031 | - $processed = isset($_POST['processed']) ? (int)$_POST['processed'] : 0; |
|
4030 | + $limit = isset($_POST['limit']) ? (int) $_POST['limit'] : 1; |
|
4031 | + $processed = isset($_POST['processed']) ? (int) $_POST['processed'] : 0; |
|
4032 | 4032 | |
4033 | 4033 | $count = $limit; |
4034 | 4034 | |
@@ -4053,13 +4053,13 @@ discard block |
||
4053 | 4053 | |
4054 | 4054 | $post_types = geodir_get_posttypes(); |
4055 | 4055 | |
4056 | - if ( $task == 'import_cat' ) { |
|
4056 | + if ($task == 'import_cat') { |
|
4057 | 4057 | if (!empty($file)) { |
4058 | 4058 | $columns = isset($file[0]) ? $file[0] : NULL; |
4059 | 4059 | |
4060 | 4060 | if (empty($columns) || (!empty($columns) && $columns[0] == '')) { |
4061 | 4061 | $json['error'] = CSV_INVAILD_FILE; |
4062 | - wp_send_json( $json ); |
|
4062 | + wp_send_json($json); |
|
4063 | 4063 | exit; |
4064 | 4064 | } |
4065 | 4065 | |
@@ -4070,7 +4070,7 @@ discard block |
||
4070 | 4070 | |
4071 | 4071 | if (isset($file[$index])) { |
4072 | 4072 | $row = $file[$index]; |
4073 | - $row = array_map( 'trim', $row ); |
|
4073 | + $row = array_map('trim', $row); |
|
4074 | 4074 | //$row = array_map( 'utf8_encode', $row ); |
4075 | 4075 | |
4076 | 4076 | $cat_id = ''; |
@@ -4087,42 +4087,42 @@ discard block |
||
4087 | 4087 | $cat_id_original = ''; |
4088 | 4088 | |
4089 | 4089 | $c = 0; |
4090 | - foreach ($columns as $column ) { |
|
4091 | - if ( $column == 'cat_id' ) { |
|
4092 | - $cat_id = (int)$row[$c]; |
|
4093 | - } else if ( $column == 'cat_name' ) { |
|
4090 | + foreach ($columns as $column) { |
|
4091 | + if ($column == 'cat_id') { |
|
4092 | + $cat_id = (int) $row[$c]; |
|
4093 | + } else if ($column == 'cat_name') { |
|
4094 | 4094 | $cat_name = $row[$c]; |
4095 | - } else if ( $column == 'cat_slug' ) { |
|
4095 | + } else if ($column == 'cat_slug') { |
|
4096 | 4096 | $cat_slug = $row[$c]; |
4097 | - } else if ( $column == 'cat_posttype' ) { |
|
4097 | + } else if ($column == 'cat_posttype') { |
|
4098 | 4098 | $cat_posttype = $row[$c]; |
4099 | - } else if ( $column == 'cat_parent' ) { |
|
4099 | + } else if ($column == 'cat_parent') { |
|
4100 | 4100 | $cat_parent = trim($row[$c]); |
4101 | - } else if ( $column == 'cat_schema' && $row[$c] != '' ) { |
|
4101 | + } else if ($column == 'cat_schema' && $row[$c] != '') { |
|
4102 | 4102 | $cat_schema = $row[$c]; |
4103 | - } else if ( $column == 'cat_description' ) { |
|
4103 | + } else if ($column == 'cat_description') { |
|
4104 | 4104 | $cat_description = $row[$c]; |
4105 | - } else if ( $column == 'cat_top_description' ) { |
|
4105 | + } else if ($column == 'cat_top_description') { |
|
4106 | 4106 | $cat_top_description = $row[$c]; |
4107 | - } else if ( $column == 'cat_image' ) { |
|
4107 | + } else if ($column == 'cat_image') { |
|
4108 | 4108 | $cat_image = $row[$c]; |
4109 | - } else if ( $column == 'cat_icon' ) { |
|
4109 | + } else if ($column == 'cat_icon') { |
|
4110 | 4110 | $cat_icon = $row[$c]; |
4111 | 4111 | } |
4112 | 4112 | // WPML |
4113 | - if ( $is_wpml ) { |
|
4114 | - if ( $column == 'cat_language' ) { |
|
4115 | - $cat_language = geodir_strtolower( trim( $row[$c] ) ); |
|
4116 | - } else if ( $column == 'cat_id_original' ) { |
|
4117 | - $cat_id_original = (int)$row[$c]; |
|
4113 | + if ($is_wpml) { |
|
4114 | + if ($column == 'cat_language') { |
|
4115 | + $cat_language = geodir_strtolower(trim($row[$c])); |
|
4116 | + } else if ($column == 'cat_id_original') { |
|
4117 | + $cat_id_original = (int) $row[$c]; |
|
4118 | 4118 | } |
4119 | 4119 | } |
4120 | 4120 | // WPML |
4121 | 4121 | $c++; |
4122 | 4122 | } |
4123 | 4123 | |
4124 | - if ( $cat_name == '' || !in_array( $cat_posttype, $post_types ) ) { |
|
4125 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . __( 'Could not be added due to blank title/invalid post type', 'geodirectory' ) ); |
|
4124 | + if ($cat_name == '' || !in_array($cat_posttype, $post_types)) { |
|
4125 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.__('Could not be added due to blank title/invalid post type', 'geodirectory')); |
|
4126 | 4126 | |
4127 | 4127 | $invalid++; |
4128 | 4128 | continue; |
@@ -4140,24 +4140,24 @@ discard block |
||
4140 | 4140 | $term_data['description'] = $cat_description; |
4141 | 4141 | $term_data['cat_schema'] = $cat_schema; |
4142 | 4142 | $term_data['top_description'] = $cat_top_description; |
4143 | - $term_data['image'] = $cat_image != '' ? basename( $cat_image ) : ''; |
|
4144 | - $term_data['icon'] = $cat_icon != '' ? basename( $cat_icon ) : ''; |
|
4143 | + $term_data['image'] = $cat_image != '' ? basename($cat_image) : ''; |
|
4144 | + $term_data['icon'] = $cat_icon != '' ? basename($cat_icon) : ''; |
|
4145 | 4145 | |
4146 | 4146 | //$term_data = array_map( 'utf8_encode', $term_data ); |
4147 | 4147 | |
4148 | - $taxonomy = $cat_posttype . 'category'; |
|
4148 | + $taxonomy = $cat_posttype.'category'; |
|
4149 | 4149 | |
4150 | 4150 | $term_data['taxonomy'] = $taxonomy; |
4151 | 4151 | |
4152 | 4152 | $term_parent_id = 0; |
4153 | - if ($cat_parent != "" || (int)$cat_parent > 0) { |
|
4153 | + if ($cat_parent != "" || (int) $cat_parent > 0) { |
|
4154 | 4154 | $term_parent = ''; |
4155 | 4155 | |
4156 | - if ( $term_parent = get_term_by( 'name', $cat_parent, $taxonomy ) ) { |
|
4156 | + if ($term_parent = get_term_by('name', $cat_parent, $taxonomy)) { |
|
4157 | 4157 | // |
4158 | - } else if ( $term_parent = get_term_by( 'slug', $cat_parent, $taxonomy ) ) { |
|
4158 | + } else if ($term_parent = get_term_by('slug', $cat_parent, $taxonomy)) { |
|
4159 | 4159 | // |
4160 | - } else if ( $term_parent = get_term_by( 'id', $cat_parent, $taxonomy ) ) { |
|
4160 | + } else if ($term_parent = get_term_by('id', $cat_parent, $taxonomy)) { |
|
4161 | 4161 | // |
4162 | 4162 | } else { |
4163 | 4163 | $term_parent_data = array(); |
@@ -4165,104 +4165,104 @@ discard block |
||
4165 | 4165 | //$term_parent_data = array_map( 'utf8_encode', $term_parent_data ); |
4166 | 4166 | $term_parent_data['taxonomy'] = $taxonomy; |
4167 | 4167 | |
4168 | - $term_parent_id = (int)geodir_imex_insert_term( $taxonomy, $term_parent_data ); |
|
4168 | + $term_parent_id = (int) geodir_imex_insert_term($taxonomy, $term_parent_data); |
|
4169 | 4169 | } |
4170 | 4170 | |
4171 | - if ( !empty( $term_parent ) && !is_wp_error( $term_parent ) ) { |
|
4172 | - $term_parent_id = (int)$term_parent->term_id; |
|
4171 | + if (!empty($term_parent) && !is_wp_error($term_parent)) { |
|
4172 | + $term_parent_id = (int) $term_parent->term_id; |
|
4173 | 4173 | } |
4174 | 4174 | } |
4175 | - $term_data['parent'] = (int)$term_parent_id; |
|
4175 | + $term_data['parent'] = (int) $term_parent_id; |
|
4176 | 4176 | |
4177 | 4177 | $term_id = NULL; |
4178 | - if ( $import_choice == 'update' ) { |
|
4179 | - if ( $cat_id > 0 && $term = (array)term_exists( $cat_id, $taxonomy ) ) { |
|
4178 | + if ($import_choice == 'update') { |
|
4179 | + if ($cat_id > 0 && $term = (array) term_exists($cat_id, $taxonomy)) { |
|
4180 | 4180 | $term_data['term_id'] = $term['term_id']; |
4181 | 4181 | |
4182 | - if ( $term_id = geodir_imex_update_term( $taxonomy, $term_data ) ) { |
|
4182 | + if ($term_id = geodir_imex_update_term($taxonomy, $term_data)) { |
|
4183 | 4183 | $updated++; |
4184 | 4184 | } else { |
4185 | 4185 | $invalid++; |
4186 | - 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' ) ); |
|
4186 | + 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')); |
|
4187 | 4187 | } |
4188 | - } else if ( $term_data['slug'] != '' && $term = (array)term_exists( $term_data['slug'], $taxonomy ) ) { |
|
4188 | + } else if ($term_data['slug'] != '' && $term = (array) term_exists($term_data['slug'], $taxonomy)) { |
|
4189 | 4189 | $term_data['term_id'] = $term['term_id']; |
4190 | 4190 | |
4191 | - if ( $term_id = geodir_imex_update_term( $taxonomy, $term_data ) ) { |
|
4191 | + if ($term_id = geodir_imex_update_term($taxonomy, $term_data)) { |
|
4192 | 4192 | $updated++; |
4193 | 4193 | } else { |
4194 | 4194 | $invalid++; |
4195 | - 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' ) ); |
|
4195 | + 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')); |
|
4196 | 4196 | } |
4197 | 4197 | } else { |
4198 | - if ( $term_id = geodir_imex_insert_term( $taxonomy, $term_data ) ) { |
|
4198 | + if ($term_id = geodir_imex_insert_term($taxonomy, $term_data)) { |
|
4199 | 4199 | $created++; |
4200 | 4200 | } else { |
4201 | 4201 | $invalid++; |
4202 | - 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' ) ); |
|
4202 | + 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')); |
|
4203 | 4203 | } |
4204 | 4204 | } |
4205 | - } else if ( $import_choice == 'skip' ) { |
|
4206 | - if ( $cat_id > 0 && $term = (array)term_exists( $cat_id, $taxonomy ) ) { |
|
4205 | + } else if ($import_choice == 'skip') { |
|
4206 | + if ($cat_id > 0 && $term = (array) term_exists($cat_id, $taxonomy)) { |
|
4207 | 4207 | $skipped++; |
4208 | - } else if ( $term_data['slug'] != '' && $term = (array)term_exists( $term_data['slug'], $taxonomy ) ) { |
|
4208 | + } else if ($term_data['slug'] != '' && $term = (array) term_exists($term_data['slug'], $taxonomy)) { |
|
4209 | 4209 | $skipped++; |
4210 | 4210 | } else { |
4211 | - if ( $term_id = geodir_imex_insert_term( $taxonomy, $term_data ) ) { |
|
4211 | + if ($term_id = geodir_imex_insert_term($taxonomy, $term_data)) { |
|
4212 | 4212 | $created++; |
4213 | 4213 | } else { |
4214 | 4214 | $invalid++; |
4215 | - 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' ) ); |
|
4215 | + 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')); |
|
4216 | 4216 | } |
4217 | 4217 | } |
4218 | 4218 | } else { |
4219 | 4219 | $invalid++; |
4220 | - 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' ) ); |
|
4220 | + 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')); |
|
4221 | 4221 | } |
4222 | 4222 | |
4223 | - if ( $term_id ) { |
|
4223 | + if ($term_id) { |
|
4224 | 4224 | // WPML |
4225 | 4225 | if ($is_wpml && $cat_id_original > 0 && $cat_language != '') { |
4226 | - $wpml_element_type = 'tax_' . $taxonomy; |
|
4227 | - $source_language = geodir_get_language_for_element( $cat_id_original, $wpml_element_type ); |
|
4226 | + $wpml_element_type = 'tax_'.$taxonomy; |
|
4227 | + $source_language = geodir_get_language_for_element($cat_id_original, $wpml_element_type); |
|
4228 | 4228 | $source_language = $source_language != '' ? $source_language : $sitepress->get_default_language(); |
4229 | 4229 | |
4230 | - $trid = $sitepress->get_element_trid( $cat_id_original, $wpml_element_type ); |
|
4230 | + $trid = $sitepress->get_element_trid($cat_id_original, $wpml_element_type); |
|
4231 | 4231 | |
4232 | - $sitepress->set_element_language_details( $term_id, $wpml_element_type, $trid, $cat_language, $source_language ); |
|
4232 | + $sitepress->set_element_language_details($term_id, $wpml_element_type, $trid, $cat_language, $source_language); |
|
4233 | 4233 | } |
4234 | 4234 | // WPML |
4235 | 4235 | |
4236 | - if ( isset( $term_data['top_description'] ) ) { |
|
4237 | - update_tax_meta( $term_id, 'ct_cat_top_desc', $term_data['top_description'], $cat_posttype ); |
|
4236 | + if (isset($term_data['top_description'])) { |
|
4237 | + update_tax_meta($term_id, 'ct_cat_top_desc', $term_data['top_description'], $cat_posttype); |
|
4238 | 4238 | } |
4239 | 4239 | |
4240 | - if ( isset( $term_data['cat_schema'] ) ) { |
|
4241 | - update_tax_meta( $term_id, 'ct_cat_schema', $term_data['cat_schema'], $cat_posttype ); |
|
4240 | + if (isset($term_data['cat_schema'])) { |
|
4241 | + update_tax_meta($term_id, 'ct_cat_schema', $term_data['cat_schema'], $cat_posttype); |
|
4242 | 4242 | } |
4243 | 4243 | |
4244 | 4244 | $attachment = false; |
4245 | - if ( isset( $term_data['image'] ) && $term_data['image'] != '' ) { |
|
4246 | - $cat_image = geodir_get_default_catimage( $term_id, $cat_posttype ); |
|
4247 | - $cat_image = !empty( $cat_image ) && isset( $cat_image['src'] ) ? $cat_image['src'] : ''; |
|
4245 | + if (isset($term_data['image']) && $term_data['image'] != '') { |
|
4246 | + $cat_image = geodir_get_default_catimage($term_id, $cat_posttype); |
|
4247 | + $cat_image = !empty($cat_image) && isset($cat_image['src']) ? $cat_image['src'] : ''; |
|
4248 | 4248 | |
4249 | - if ( basename($cat_image) != $term_data['image'] ) { |
|
4249 | + if (basename($cat_image) != $term_data['image']) { |
|
4250 | 4250 | $attachment = true; |
4251 | - update_tax_meta( $term_id, 'ct_cat_default_img', array( 'id' => 'image', 'src' => $uploads['url'] . '/' . $term_data['image'] ), $cat_posttype ); |
|
4251 | + update_tax_meta($term_id, 'ct_cat_default_img', array('id' => 'image', 'src' => $uploads['url'].'/'.$term_data['image']), $cat_posttype); |
|
4252 | 4252 | } |
4253 | 4253 | } |
4254 | 4254 | |
4255 | - if ( isset( $term_data['icon'] ) && $term_data['icon'] != '' ) { |
|
4256 | - $cat_icon = get_tax_meta( $term_id, 'ct_cat_icon', false, $cat_posttype ); |
|
4257 | - $cat_icon = !empty( $cat_icon ) && isset( $cat_icon['src'] ) ? $cat_icon['src'] : ''; |
|
4255 | + if (isset($term_data['icon']) && $term_data['icon'] != '') { |
|
4256 | + $cat_icon = get_tax_meta($term_id, 'ct_cat_icon', false, $cat_posttype); |
|
4257 | + $cat_icon = !empty($cat_icon) && isset($cat_icon['src']) ? $cat_icon['src'] : ''; |
|
4258 | 4258 | |
4259 | - if ( basename($cat_icon) != $term_data['icon'] ) { |
|
4259 | + if (basename($cat_icon) != $term_data['icon']) { |
|
4260 | 4260 | $attachment = true; |
4261 | - update_tax_meta( $term_id, 'ct_cat_icon', array( 'id' => 'icon', 'src' => $uploads['url'] . '/' . $term_data['icon'] ), $cat_posttype ); |
|
4261 | + update_tax_meta($term_id, 'ct_cat_icon', array('id' => 'icon', 'src' => $uploads['url'].'/'.$term_data['icon']), $cat_posttype); |
|
4262 | 4262 | } |
4263 | 4263 | } |
4264 | 4264 | |
4265 | - if ( $attachment ) { |
|
4265 | + if ($attachment) { |
|
4266 | 4266 | $images++; |
4267 | 4267 | } |
4268 | 4268 | } |
@@ -4284,13 +4284,13 @@ discard block |
||
4284 | 4284 | $json['invalid'] = $invalid; |
4285 | 4285 | $json['images'] = $images; |
4286 | 4286 | |
4287 | - wp_send_json( $json ); |
|
4287 | + wp_send_json($json); |
|
4288 | 4288 | exit; |
4289 | - } else if ( $task == 'import_post' ) { |
|
4289 | + } else if ($task == 'import_post') { |
|
4290 | 4290 | //run some stuff to make the import quicker |
4291 | - wp_defer_term_counting( true ); |
|
4292 | - wp_defer_comment_counting( true ); |
|
4293 | - $wpdb->query( 'SET autocommit = 0;' ); |
|
4291 | + wp_defer_term_counting(true); |
|
4292 | + wp_defer_comment_counting(true); |
|
4293 | + $wpdb->query('SET autocommit = 0;'); |
|
4294 | 4294 | |
4295 | 4295 | //remove_all_actions('publish_post'); |
4296 | 4296 | //remove_all_actions('transition_post_status'); |
@@ -4299,18 +4299,18 @@ discard block |
||
4299 | 4299 | if (!empty($file)) { |
4300 | 4300 | $wp_post_statuses = get_post_statuses(); // All of the WordPress supported post statuses. |
4301 | 4301 | $default_status = 'publish'; |
4302 | - $current_date = date_i18n( 'Y-m-d', time() ); |
|
4302 | + $current_date = date_i18n('Y-m-d', time()); |
|
4303 | 4303 | |
4304 | 4304 | $columns = isset($file[0]) ? $file[0] : NULL; |
4305 | 4305 | |
4306 | 4306 | if (empty($columns) || (!empty($columns) && $columns[0] == '')) { |
4307 | 4307 | $json['error'] = CSV_INVAILD_FILE; |
4308 | - wp_send_json( $json ); |
|
4308 | + wp_send_json($json); |
|
4309 | 4309 | exit; |
4310 | 4310 | } |
4311 | 4311 | |
4312 | 4312 | $gd_error_log = __('GD IMPORT LISTINGS [ROW %d]:', 'geodirectory'); |
4313 | - $wp_chars_error = __( '(check & remove if any invalid characters used in data)', 'geodirectory' ); |
|
4313 | + $wp_chars_error = __('(check & remove if any invalid characters used in data)', 'geodirectory'); |
|
4314 | 4314 | $processed_actual = 0; |
4315 | 4315 | for ($i = 1; $i <= $limit; $i++) { |
4316 | 4316 | $index = $processed + $i; |
@@ -4319,9 +4319,9 @@ discard block |
||
4319 | 4319 | if (isset($file[$index])) { |
4320 | 4320 | $processed_actual++; |
4321 | 4321 | $row = $file[$index]; |
4322 | - $row = array_map( 'trim', $row ); |
|
4322 | + $row = array_map('trim', $row); |
|
4323 | 4323 | //$row = array_map( 'utf8_encode', $row ); |
4324 | - $row = array_map( 'addslashes_gpc', $row ); |
|
4324 | + $row = array_map('addslashes_gpc', $row); |
|
4325 | 4325 | |
4326 | 4326 | $post_id = ''; |
4327 | 4327 | $post_title = ''; |
@@ -4358,78 +4358,78 @@ discard block |
||
4358 | 4358 | $original_post_id = ''; |
4359 | 4359 | |
4360 | 4360 | $c = 0; |
4361 | - foreach ($columns as $column ) { |
|
4361 | + foreach ($columns as $column) { |
|
4362 | 4362 | $gd_post[$column] = $row[$c]; |
4363 | 4363 | |
4364 | - if ( $column == 'post_id' ) { |
|
4364 | + if ($column == 'post_id') { |
|
4365 | 4365 | $post_id = $row[$c]; |
4366 | - } else if ( $column == 'post_title' ) { |
|
4366 | + } else if ($column == 'post_title') { |
|
4367 | 4367 | $post_title = sanitize_text_field($row[$c]); |
4368 | - } else if ( $column == 'post_author' ) { |
|
4368 | + } else if ($column == 'post_author') { |
|
4369 | 4369 | $post_author = $row[$c]; |
4370 | - } else if ( $column == 'post_content' ) { |
|
4370 | + } else if ($column == 'post_content') { |
|
4371 | 4371 | $post_content = $row[$c]; |
4372 | - } else if ( $column == 'post_category' && $row[$c] != '' ) { |
|
4373 | - $post_category_arr = explode( ',', $row[$c] ); |
|
4374 | - } else if ( $column == 'default_category' ) { |
|
4372 | + } else if ($column == 'post_category' && $row[$c] != '') { |
|
4373 | + $post_category_arr = explode(',', $row[$c]); |
|
4374 | + } else if ($column == 'default_category') { |
|
4375 | 4375 | $default_category = wp_kses_normalize_entities($row[$c]); |
4376 | - } else if ( $column == 'post_tags' && $row[$c] != '' ) { |
|
4377 | - $post_tags = explode( ',', sanitize_text_field($row[$c]) ); |
|
4378 | - } else if ( $column == 'post_type' ) { |
|
4376 | + } else if ($column == 'post_tags' && $row[$c] != '') { |
|
4377 | + $post_tags = explode(',', sanitize_text_field($row[$c])); |
|
4378 | + } else if ($column == 'post_type') { |
|
4379 | 4379 | $post_type = $row[$c]; |
4380 | - } else if ( $column == 'post_status' ) { |
|
4381 | - $post_status = sanitize_key( $row[$c] ); |
|
4382 | - } else if ( $column == 'is_featured' ) { |
|
4383 | - $is_featured = (int)$row[$c]; |
|
4384 | - } else if ( $column == 'geodir_video' ) { |
|
4380 | + } else if ($column == 'post_status') { |
|
4381 | + $post_status = sanitize_key($row[$c]); |
|
4382 | + } else if ($column == 'is_featured') { |
|
4383 | + $is_featured = (int) $row[$c]; |
|
4384 | + } else if ($column == 'geodir_video') { |
|
4385 | 4385 | $geodir_video = $row[$c]; |
4386 | - } else if ( $column == 'post_address' ) { |
|
4386 | + } else if ($column == 'post_address') { |
|
4387 | 4387 | $post_address = sanitize_text_field($row[$c]); |
4388 | - } else if ( $column == 'post_city' ) { |
|
4388 | + } else if ($column == 'post_city') { |
|
4389 | 4389 | $post_city = sanitize_text_field($row[$c]); |
4390 | - } else if ( $column == 'post_region' ) { |
|
4390 | + } else if ($column == 'post_region') { |
|
4391 | 4391 | $post_region = sanitize_text_field($row[$c]); |
4392 | - } else if ( $column == 'post_country' ) { |
|
4392 | + } else if ($column == 'post_country') { |
|
4393 | 4393 | $post_country = sanitize_text_field($row[$c]); |
4394 | - } else if ( $column == 'post_zip' ) { |
|
4394 | + } else if ($column == 'post_zip') { |
|
4395 | 4395 | $post_zip = sanitize_text_field($row[$c]); |
4396 | - } else if ( $column == 'post_latitude' ) { |
|
4396 | + } else if ($column == 'post_latitude') { |
|
4397 | 4397 | $post_latitude = sanitize_text_field($row[$c]); |
4398 | - } else if ( $column == 'post_longitude' ) { |
|
4398 | + } else if ($column == 'post_longitude') { |
|
4399 | 4399 | $post_longitude = sanitize_text_field($row[$c]); |
4400 | - } else if ( $column == 'post_neighbourhood' ) { |
|
4400 | + } else if ($column == 'post_neighbourhood') { |
|
4401 | 4401 | $post_neighbourhood = sanitize_text_field($row[$c]); |
4402 | 4402 | unset($gd_post[$column]); |
4403 | - } else if ( $column == 'neighbourhood_latitude' ) { |
|
4403 | + } else if ($column == 'neighbourhood_latitude') { |
|
4404 | 4404 | $neighbourhood_latitude = sanitize_text_field($row[$c]); |
4405 | - } else if ( $column == 'neighbourhood_longitude' ) { |
|
4405 | + } else if ($column == 'neighbourhood_longitude') { |
|
4406 | 4406 | $neighbourhood_longitude = sanitize_text_field($row[$c]); |
4407 | - } else if ( $column == 'geodir_timing' ) { |
|
4407 | + } else if ($column == 'geodir_timing') { |
|
4408 | 4408 | $geodir_timing = sanitize_text_field($row[$c]); |
4409 | - } else if ( $column == 'geodir_contact' ) { |
|
4409 | + } else if ($column == 'geodir_contact') { |
|
4410 | 4410 | $geodir_contact = sanitize_text_field($row[$c]); |
4411 | - } else if ( $column == 'geodir_email' ) { |
|
4411 | + } else if ($column == 'geodir_email') { |
|
4412 | 4412 | $geodir_email = sanitize_email($row[$c]); |
4413 | - } else if ( $column == 'geodir_website' ) { |
|
4413 | + } else if ($column == 'geodir_website') { |
|
4414 | 4414 | $geodir_website = sanitize_text_field($row[$c]); |
4415 | - } else if ( $column == 'geodir_twitter' ) { |
|
4415 | + } else if ($column == 'geodir_twitter') { |
|
4416 | 4416 | $geodir_twitter = sanitize_text_field($row[$c]); |
4417 | - } else if ( $column == 'geodir_facebook' ) { |
|
4417 | + } else if ($column == 'geodir_facebook') { |
|
4418 | 4418 | $geodir_facebook = sanitize_text_field($row[$c]); |
4419 | - } else if ( $column == 'IMAGE' && !empty( $row[$c] ) && $row[$c] != '' ) { |
|
4419 | + } else if ($column == 'IMAGE' && !empty($row[$c]) && $row[$c] != '') { |
|
4420 | 4420 | $post_images[] = $row[$c]; |
4421 | - } else if ( $column == 'alive_days' && (int)$row[$c] > 0 ) { |
|
4422 | - $expire_date = date_i18n( 'Y-m-d', strtotime( $current_date . '+' . (int)$row[$c] . ' days' ) ); |
|
4423 | - } else if ( $column == 'expire_date' && $row[$c] != '' && geodir_strtolower($row[$c]) != 'never' ) { |
|
4421 | + } else if ($column == 'alive_days' && (int) $row[$c] > 0) { |
|
4422 | + $expire_date = date_i18n('Y-m-d', strtotime($current_date.'+'.(int) $row[$c].' days')); |
|
4423 | + } else if ($column == 'expire_date' && $row[$c] != '' && geodir_strtolower($row[$c]) != 'never') { |
|
4424 | 4424 | $row[$c] = str_replace('/', '-', $row[$c]); |
4425 | - $expire_date = date_i18n( 'Y-m-d', strtotime( $row[$c] ) ); |
|
4425 | + $expire_date = date_i18n('Y-m-d', strtotime($row[$c])); |
|
4426 | 4426 | } |
4427 | 4427 | // WPML |
4428 | 4428 | if ($is_wpml) { |
4429 | 4429 | if ($column == 'language') { |
4430 | 4430 | $language = geodir_strtolower(trim($row[$c])); |
4431 | 4431 | } else if ($column == 'original_post_id') { |
4432 | - $original_post_id = (int)$row[$c]; |
|
4432 | + $original_post_id = (int) $row[$c]; |
|
4433 | 4433 | } |
4434 | 4434 | } |
4435 | 4435 | // WPML |
@@ -4444,43 +4444,43 @@ discard block |
||
4444 | 4444 | |
4445 | 4445 | $gd_post['IMAGE'] = $post_images; |
4446 | 4446 | |
4447 | - $post_status = !empty( $post_status ) ? sanitize_key( $post_status ) : $default_status; |
|
4448 | - $post_status = !empty( $wp_post_statuses ) && !isset( $wp_post_statuses[$post_status] ) ? $default_status : $post_status; |
|
4447 | + $post_status = !empty($post_status) ? sanitize_key($post_status) : $default_status; |
|
4448 | + $post_status = !empty($wp_post_statuses) && !isset($wp_post_statuses[$post_status]) ? $default_status : $post_status; |
|
4449 | 4449 | |
4450 | 4450 | $valid = true; |
4451 | 4451 | |
4452 | - if ( $post_title == '' || !in_array( $post_type, $post_types ) ) { |
|
4452 | + if ($post_title == '' || !in_array($post_type, $post_types)) { |
|
4453 | 4453 | $invalid++; |
4454 | 4454 | $valid = false; |
4455 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . __( 'Could not be added due to blank title/invalid post type', 'geodirectory' ) ); |
|
4455 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.__('Could not be added due to blank title/invalid post type', 'geodirectory')); |
|
4456 | 4456 | } |
4457 | 4457 | |
4458 | - $location_allowed = function_exists( 'geodir_cpt_no_location' ) && geodir_cpt_no_location( $post_type ) ? false : true; |
|
4459 | - if ( $location_allowed ) { |
|
4458 | + $location_allowed = function_exists('geodir_cpt_no_location') && geodir_cpt_no_location($post_type) ? false : true; |
|
4459 | + if ($location_allowed) { |
|
4460 | 4460 | $location_result = geodir_get_default_location(); |
4461 | - if ( $post_address == '' || $post_city == '' || $post_region == '' || $post_country == '' || $post_latitude == '' || $post_longitude == '' ) { |
|
4461 | + if ($post_address == '' || $post_city == '' || $post_region == '' || $post_country == '' || $post_latitude == '' || $post_longitude == '') { |
|
4462 | 4462 | $invalid_addr++; |
4463 | 4463 | $valid = false; |
4464 | - 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' ) ); |
|
4465 | - } else if ( !empty( $location_result ) && $location_result->location_id == 0 ) { |
|
4466 | - 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 ) ) ) { |
|
4464 | + 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')); |
|
4465 | + } else if (!empty($location_result) && $location_result->location_id == 0) { |
|
4466 | + 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))) { |
|
4467 | 4467 | $invalid_addr++; |
4468 | 4468 | $valid = false; |
4469 | - 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' ) ); |
|
4469 | + 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')); |
|
4470 | 4470 | } else { |
4471 | 4471 | if (!$location_manager) { |
4472 | - $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. |
|
4472 | + $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. |
|
4473 | 4473 | } |
4474 | 4474 | } |
4475 | 4475 | } |
4476 | 4476 | } |
4477 | 4477 | |
4478 | - if ( !$valid ) { |
|
4478 | + if (!$valid) { |
|
4479 | 4479 | continue; |
4480 | 4480 | } |
4481 | 4481 | |
4482 | - $cat_taxonomy = $post_type . 'category'; |
|
4483 | - $tags_taxonomy = $post_type . '_tags'; |
|
4482 | + $cat_taxonomy = $post_type.'category'; |
|
4483 | + $tags_taxonomy = $post_type.'_tags'; |
|
4484 | 4484 | |
4485 | 4485 | if ($default_category != '' && !in_array($default_category, $post_category_arr)) { |
4486 | 4486 | $post_category_arr = array_merge(array($default_category), $post_category_arr); |
@@ -4488,29 +4488,29 @@ discard block |
||
4488 | 4488 | |
4489 | 4489 | $post_category = array(); |
4490 | 4490 | $default_category_id = NULL; |
4491 | - if ( !empty( $post_category_arr ) ) { |
|
4492 | - foreach ( $post_category_arr as $value ) { |
|
4493 | - $category_name = wp_kses_normalize_entities( trim( $value ) ); |
|
4491 | + if (!empty($post_category_arr)) { |
|
4492 | + foreach ($post_category_arr as $value) { |
|
4493 | + $category_name = wp_kses_normalize_entities(trim($value)); |
|
4494 | 4494 | |
4495 | - if ( $category_name != '' ) { |
|
4495 | + if ($category_name != '') { |
|
4496 | 4496 | $term_category = array(); |
4497 | 4497 | |
4498 | - if ( $term = get_term_by( 'name', $category_name, $cat_taxonomy ) ) { |
|
4498 | + if ($term = get_term_by('name', $category_name, $cat_taxonomy)) { |
|
4499 | 4499 | $term_category = $term; |
4500 | - } else if ( $term = get_term_by( 'slug', $category_name, $cat_taxonomy ) ) { |
|
4500 | + } else if ($term = get_term_by('slug', $category_name, $cat_taxonomy)) { |
|
4501 | 4501 | $term_category = $term; |
4502 | 4502 | } else { |
4503 | 4503 | $term_data = array(); |
4504 | 4504 | $term_data['name'] = $category_name; |
4505 | 4505 | $term_data['taxonomy'] = $cat_taxonomy; |
4506 | 4506 | |
4507 | - $term_id = geodir_imex_insert_term( $cat_taxonomy, $term_data ); |
|
4508 | - if ( $term_id ) { |
|
4509 | - $term_category = get_term( $term_id, $cat_taxonomy ); |
|
4507 | + $term_id = geodir_imex_insert_term($cat_taxonomy, $term_data); |
|
4508 | + if ($term_id) { |
|
4509 | + $term_category = get_term($term_id, $cat_taxonomy); |
|
4510 | 4510 | } |
4511 | 4511 | } |
4512 | 4512 | |
4513 | - if ( !empty( $term_category ) && !is_wp_error( $term_category ) ) { |
|
4513 | + if (!empty($term_category) && !is_wp_error($term_category)) { |
|
4514 | 4514 | $post_category[] = intval($term_category->term_id); |
4515 | 4515 | |
4516 | 4516 | if ($category_name == $default_category) { |
@@ -4531,15 +4531,15 @@ discard block |
||
4531 | 4531 | $save_post['post_tags'] = $post_tags; |
4532 | 4532 | |
4533 | 4533 | $saved_post_id = NULL; |
4534 | - if ( $import_choice == 'update' ) { |
|
4535 | - $gd_wp_error = __( 'Unable to add listing, please check the listing data.', 'geodirectory' ); |
|
4534 | + if ($import_choice == 'update') { |
|
4535 | + $gd_wp_error = __('Unable to add listing, please check the listing data.', 'geodirectory'); |
|
4536 | 4536 | |
4537 | - if ( $post_id > 0 && get_post( $post_id ) ) { |
|
4537 | + if ($post_id > 0 && get_post($post_id)) { |
|
4538 | 4538 | $save_post['ID'] = $post_id; |
4539 | 4539 | |
4540 | - if ( $saved_post_id = wp_update_post( $save_post, true ) ) { |
|
4541 | - if ( is_wp_error( $saved_post_id ) ) { |
|
4542 | - $gd_wp_error = $saved_post_id->get_error_message() . ' ' . $wp_chars_error; |
|
4540 | + if ($saved_post_id = wp_update_post($save_post, true)) { |
|
4541 | + if (is_wp_error($saved_post_id)) { |
|
4542 | + $gd_wp_error = $saved_post_id->get_error_message().' '.$wp_chars_error; |
|
4543 | 4543 | $saved_post_id = 0; |
4544 | 4544 | } else { |
4545 | 4545 | $saved_post_id = $post_id; |
@@ -4547,9 +4547,9 @@ discard block |
||
4547 | 4547 | } |
4548 | 4548 | } |
4549 | 4549 | } else { |
4550 | - if ( $saved_post_id = wp_insert_post( $save_post, true ) ) { |
|
4551 | - if ( is_wp_error( $saved_post_id ) ) { |
|
4552 | - $gd_wp_error = $saved_post_id->get_error_message() . ' ' . $wp_chars_error; |
|
4550 | + if ($saved_post_id = wp_insert_post($save_post, true)) { |
|
4551 | + if (is_wp_error($saved_post_id)) { |
|
4552 | + $gd_wp_error = $saved_post_id->get_error_message().' '.$wp_chars_error; |
|
4553 | 4553 | $saved_post_id = 0; |
4554 | 4554 | } else { |
4555 | 4555 | $created++; |
@@ -4557,19 +4557,19 @@ discard block |
||
4557 | 4557 | } |
4558 | 4558 | } |
4559 | 4559 | |
4560 | - if ( !$saved_post_id > 0 ) { |
|
4560 | + if (!$saved_post_id > 0) { |
|
4561 | 4561 | $invalid++; |
4562 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_wp_error ); |
|
4562 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$gd_wp_error); |
|
4563 | 4563 | } |
4564 | - } else if ( $import_choice == 'skip' ) { |
|
4565 | - if ( $post_id > 0 && get_post( $post_id ) ) { |
|
4564 | + } else if ($import_choice == 'skip') { |
|
4565 | + if ($post_id > 0 && get_post($post_id)) { |
|
4566 | 4566 | $skipped++; |
4567 | 4567 | } else { |
4568 | - if ( $saved_post_id = wp_insert_post( $save_post, true ) ) { |
|
4569 | - if ( is_wp_error( $saved_post_id ) ) { |
|
4568 | + if ($saved_post_id = wp_insert_post($save_post, true)) { |
|
4569 | + if (is_wp_error($saved_post_id)) { |
|
4570 | 4570 | $invalid++; |
4571 | 4571 | |
4572 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $saved_post_id->get_error_message() . ' ' . $wp_chars_error ); |
|
4572 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$saved_post_id->get_error_message().' '.$wp_chars_error); |
|
4573 | 4573 | $saved_post_id = 0; |
4574 | 4574 | } else { |
4575 | 4575 | $created++; |
@@ -4577,28 +4577,28 @@ discard block |
||
4577 | 4577 | } else { |
4578 | 4578 | $invalid++; |
4579 | 4579 | |
4580 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $wp_chars_error ); |
|
4580 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$wp_chars_error); |
|
4581 | 4581 | } |
4582 | 4582 | } |
4583 | 4583 | } else { |
4584 | 4584 | $invalid++; |
4585 | 4585 | |
4586 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $wp_chars_error ); |
|
4586 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$wp_chars_error); |
|
4587 | 4587 | } |
4588 | 4588 | |
4589 | - if ( (int)$saved_post_id > 0 ) { |
|
4589 | + if ((int) $saved_post_id > 0) { |
|
4590 | 4590 | // WPML |
4591 | 4591 | if ($is_wpml && $original_post_id > 0 && $language != '') { |
4592 | - $wpml_post_type = 'post_' . $post_type; |
|
4593 | - $source_language = geodir_get_language_for_element( $original_post_id, $wpml_post_type ); |
|
4592 | + $wpml_post_type = 'post_'.$post_type; |
|
4593 | + $source_language = geodir_get_language_for_element($original_post_id, $wpml_post_type); |
|
4594 | 4594 | $source_language = $source_language != '' ? $source_language : $sitepress->get_default_language(); |
4595 | 4595 | |
4596 | - $trid = $sitepress->get_element_trid( $original_post_id, $wpml_post_type ); |
|
4596 | + $trid = $sitepress->get_element_trid($original_post_id, $wpml_post_type); |
|
4597 | 4597 | |
4598 | - $sitepress->set_element_language_details( $saved_post_id, $wpml_post_type, $trid, $language, $source_language ); |
|
4598 | + $sitepress->set_element_language_details($saved_post_id, $wpml_post_type, $trid, $language, $source_language); |
|
4599 | 4599 | } |
4600 | 4600 | // WPML |
4601 | - $gd_post_info = geodir_get_post_info( $saved_post_id ); |
|
4601 | + $gd_post_info = geodir_get_post_info($saved_post_id); |
|
4602 | 4602 | |
4603 | 4603 | $gd_post['post_id'] = $saved_post_id; |
4604 | 4604 | $gd_post['ID'] = $saved_post_id; |
@@ -4610,7 +4610,7 @@ discard block |
||
4610 | 4610 | |
4611 | 4611 | // post location |
4612 | 4612 | $post_location_id = 0; |
4613 | - if ( $location_allowed && !empty( $location_result ) && $location_result->location_id > 0 ) { |
|
4613 | + if ($location_allowed && !empty($location_result) && $location_result->location_id > 0) { |
|
4614 | 4614 | $gd_post['post_neighbourhood'] = ''; |
4615 | 4615 | |
4616 | 4616 | $post_location_info = array( |
@@ -4620,7 +4620,7 @@ discard block |
||
4620 | 4620 | 'geo_lat' => $post_latitude, |
4621 | 4621 | 'geo_lng' => $post_longitude |
4622 | 4622 | ); |
4623 | - if ( $location_id = (int)geodir_add_new_location( $post_location_info ) ) { |
|
4623 | + if ($location_id = (int) geodir_add_new_location($post_location_info)) { |
|
4624 | 4624 | $post_location_id = $location_id; |
4625 | 4625 | } |
4626 | 4626 | |
@@ -4658,14 +4658,14 @@ discard block |
||
4658 | 4658 | $gd_post['post_location_id'] = $post_location_id; |
4659 | 4659 | |
4660 | 4660 | // post package info |
4661 | - $package_id = isset( $gd_post['package_id'] ) && !empty( $gd_post['package_id'] ) ? (int)$gd_post['package_id'] : 0; |
|
4661 | + $package_id = isset($gd_post['package_id']) && !empty($gd_post['package_id']) ? (int) $gd_post['package_id'] : 0; |
|
4662 | 4662 | if (!$package_id && !empty($gd_post_info) && isset($gd_post_info->package_id) && $gd_post_info->package_id) { |
4663 | 4663 | $package_id = $gd_post_info->package_id; |
4664 | 4664 | } |
4665 | 4665 | |
4666 | 4666 | $package_info = array(); |
4667 | 4667 | if ($package_id && function_exists('geodir_get_package_info_by_id')) { |
4668 | - $package_info = (array)geodir_get_package_info_by_id($package_id); |
|
4668 | + $package_info = (array) geodir_get_package_info_by_id($package_id); |
|
4669 | 4669 | |
4670 | 4670 | if (!(!empty($package_info) && isset($package_info['post_type']) && $package_info['post_type'] == $post_type)) { |
4671 | 4671 | $package_info = array(); |
@@ -4673,18 +4673,18 @@ discard block |
||
4673 | 4673 | } |
4674 | 4674 | |
4675 | 4675 | if (empty($package_info)) { |
4676 | - $package_info = (array)geodir_post_package_info( array(), '', $post_type ); |
|
4676 | + $package_info = (array) geodir_post_package_info(array(), '', $post_type); |
|
4677 | 4677 | } |
4678 | 4678 | |
4679 | - if (!empty($package_info)) { |
|
4679 | + if (!empty($package_info)) { |
|
4680 | 4680 | $package_id = $package_info['pid']; |
4681 | 4681 | |
4682 | 4682 | if (isset($gd_post['alive_days']) || isset($gd_post['expire_date'])) { |
4683 | 4683 | $gd_post['expire_date'] = $expire_date; |
4684 | 4684 | } else { |
4685 | - if ( isset( $package_info['days'] ) && (int)$package_info['days'] > 0 ) { |
|
4686 | - $gd_post['alive_days'] = (int)$package_info['days']; |
|
4687 | - $gd_post['expire_date'] = date_i18n( 'Y-m-d', strtotime( $current_date . '+' . (int)$package_info['days'] . ' days' ) ); |
|
4685 | + if (isset($package_info['days']) && (int) $package_info['days'] > 0) { |
|
4686 | + $gd_post['alive_days'] = (int) $package_info['days']; |
|
4687 | + $gd_post['expire_date'] = date_i18n('Y-m-d', strtotime($current_date.'+'.(int) $package_info['days'].' days')); |
|
4688 | 4688 | } else { |
4689 | 4689 | $gd_post['expire_date'] = 'Never'; |
4690 | 4690 | } |
@@ -4693,7 +4693,7 @@ discard block |
||
4693 | 4693 | $gd_post['package_id'] = $package_id; |
4694 | 4694 | } |
4695 | 4695 | |
4696 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
4696 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
4697 | 4697 | |
4698 | 4698 | if ($post_type == 'gd_event') { |
4699 | 4699 | $gd_post = geodir_imex_process_event_data($gd_post); |
@@ -4704,28 +4704,28 @@ discard block |
||
4704 | 4704 | } |
4705 | 4705 | |
4706 | 4706 | // Export franchise fields |
4707 | - $is_franchise_active = is_plugin_active( 'geodir_franchise/geodir_franchise.php' ) && geodir_franchise_enabled( $post_type ) ? true : false; |
|
4707 | + $is_franchise_active = is_plugin_active('geodir_franchise/geodir_franchise.php') && geodir_franchise_enabled($post_type) ? true : false; |
|
4708 | 4708 | if ($is_franchise_active) { |
4709 | - if ( isset( $gd_post['gd_is_franchise'] ) && (int)$gd_post['gd_is_franchise'] == 1 ) { |
|
4709 | + if (isset($gd_post['gd_is_franchise']) && (int) $gd_post['gd_is_franchise'] == 1) { |
|
4710 | 4710 | $gd_franchise_lock = array(); |
4711 | 4711 | |
4712 | - if ( isset( $gd_post['gd_franchise_lock'] ) ) { |
|
4713 | - $gd_franchise_lock = str_replace(" ", "", $gd_post['gd_franchise_lock'] ); |
|
4714 | - $gd_franchise_lock = trim( $gd_franchise_lock ); |
|
4715 | - $gd_franchise_lock = explode( ",", $gd_franchise_lock ); |
|
4712 | + if (isset($gd_post['gd_franchise_lock'])) { |
|
4713 | + $gd_franchise_lock = str_replace(" ", "", $gd_post['gd_franchise_lock']); |
|
4714 | + $gd_franchise_lock = trim($gd_franchise_lock); |
|
4715 | + $gd_franchise_lock = explode(",", $gd_franchise_lock); |
|
4716 | 4716 | } |
4717 | 4717 | |
4718 | - update_post_meta( $saved_post_id, 'gd_is_franchise', 1 ); |
|
4719 | - update_post_meta( $saved_post_id, 'gd_franchise_lock', $gd_franchise_lock ); |
|
4718 | + update_post_meta($saved_post_id, 'gd_is_franchise', 1); |
|
4719 | + update_post_meta($saved_post_id, 'gd_franchise_lock', $gd_franchise_lock); |
|
4720 | 4720 | } else { |
4721 | - if ( isset( $gd_post['franchise'] ) && (int)$gd_post['franchise'] > 0 && geodir_franchise_check( (int)$gd_post['franchise'] ) ) { |
|
4722 | - geodir_save_post_meta( $saved_post_id, 'franchise', (int)$gd_post['franchise'] ); |
|
4721 | + if (isset($gd_post['franchise']) && (int) $gd_post['franchise'] > 0 && geodir_franchise_check((int) $gd_post['franchise'])) { |
|
4722 | + geodir_save_post_meta($saved_post_id, 'franchise', (int) $gd_post['franchise']); |
|
4723 | 4723 | } |
4724 | 4724 | } |
4725 | 4725 | } |
4726 | 4726 | |
4727 | 4727 | if (!empty($save_post['post_category']) && is_array($save_post['post_category'])) { |
4728 | - $save_post['post_category'] = array_unique( array_map( 'intval', $save_post['post_category'] ) ); |
|
4728 | + $save_post['post_category'] = array_unique(array_map('intval', $save_post['post_category'])); |
|
4729 | 4729 | if ($default_category_id) { |
4730 | 4730 | $save_post['post_default_category'] = $default_category_id; |
4731 | 4731 | $gd_post['default_category'] = $default_category_id; |
@@ -4734,34 +4734,34 @@ discard block |
||
4734 | 4734 | } |
4735 | 4735 | |
4736 | 4736 | // Save post info |
4737 | - geodir_save_post_info( $saved_post_id, $gd_post ); |
|
4737 | + geodir_save_post_info($saved_post_id, $gd_post); |
|
4738 | 4738 | // post taxonomies |
4739 | - if ( !empty( $save_post['post_category'] ) ) { |
|
4740 | - wp_set_object_terms( $saved_post_id, $save_post['post_category'], $cat_taxonomy ); |
|
4739 | + if (!empty($save_post['post_category'])) { |
|
4740 | + wp_set_object_terms($saved_post_id, $save_post['post_category'], $cat_taxonomy); |
|
4741 | 4741 | |
4742 | - $post_default_category = isset( $save_post['post_default_category'] ) ? $save_post['post_default_category'] : ''; |
|
4742 | + $post_default_category = isset($save_post['post_default_category']) ? $save_post['post_default_category'] : ''; |
|
4743 | 4743 | if ($default_category_id) { |
4744 | 4744 | $post_default_category = $default_category_id; |
4745 | 4745 | } |
4746 | 4746 | $post_cat_ids = geodir_get_post_meta($saved_post_id, $cat_taxonomy); |
4747 | 4747 | $save_post['post_category'] = !empty($post_cat_ids) ? explode(",", trim($post_cat_ids, ",")) : $save_post['post_category']; |
4748 | - $post_category_str = !empty($save_post['post_category']) ? implode(",y:#", $save_post['post_category']) . ',y:' : ''; |
|
4748 | + $post_category_str = !empty($save_post['post_category']) ? implode(",y:#", $save_post['post_category']).',y:' : ''; |
|
4749 | 4749 | |
4750 | 4750 | if ($post_category_str != '' && $post_default_category) { |
4751 | - $post_category_str = str_replace($post_default_category . ',y:', $post_default_category . ',y,d:', $post_category_str); |
|
4751 | + $post_category_str = str_replace($post_default_category.',y:', $post_default_category.',y,d:', $post_category_str); |
|
4752 | 4752 | } |
4753 | 4753 | |
4754 | 4754 | $post_category_str = $post_category_str != '' ? array($cat_taxonomy => $post_category_str) : ''; |
4755 | 4755 | |
4756 | - geodir_set_postcat_structure( $saved_post_id, $cat_taxonomy, $post_default_category, $post_category_str ); |
|
4756 | + geodir_set_postcat_structure($saved_post_id, $cat_taxonomy, $post_default_category, $post_category_str); |
|
4757 | 4757 | } |
4758 | 4758 | |
4759 | - if ( !empty( $save_post['post_tags'] ) ) { |
|
4760 | - wp_set_object_terms( $saved_post_id, $save_post['post_tags'], $tags_taxonomy ); |
|
4759 | + if (!empty($save_post['post_tags'])) { |
|
4760 | + wp_set_object_terms($saved_post_id, $save_post['post_tags'], $tags_taxonomy); |
|
4761 | 4761 | } |
4762 | 4762 | |
4763 | 4763 | // Post images |
4764 | - if ( !empty( $post_images ) ) { |
|
4764 | + if (!empty($post_images)) { |
|
4765 | 4765 | $post_images = array_unique($post_images); |
4766 | 4766 | |
4767 | 4767 | $old_post_images_arr = array(); |
@@ -4769,82 +4769,82 @@ discard block |
||
4769 | 4769 | |
4770 | 4770 | $order = 1; |
4771 | 4771 | |
4772 | - $old_post_images = geodir_get_images( $saved_post_id ); |
|
4772 | + $old_post_images = geodir_get_images($saved_post_id); |
|
4773 | 4773 | if (!empty($old_post_images)) { |
4774 | - foreach( $old_post_images as $old_post_image ) { |
|
4774 | + foreach ($old_post_images as $old_post_image) { |
|
4775 | 4775 | if (!empty($old_post_image) && isset($old_post_image->file) && $old_post_image->file != '') { |
4776 | 4776 | $old_post_images_arr[] = $old_post_image->file; |
4777 | 4777 | } |
4778 | 4778 | } |
4779 | 4779 | } |
4780 | 4780 | |
4781 | - foreach ( $post_images as $post_image ) { |
|
4782 | - $image_name = basename( $post_image ); |
|
4781 | + foreach ($post_images as $post_image) { |
|
4782 | + $image_name = basename($post_image); |
|
4783 | 4783 | $saved_post_images_arr[] = $image_name; |
4784 | 4784 | |
4785 | - if (!empty($old_post_images_arr) && in_array( $image_name, $old_post_images_arr) ) { |
|
4785 | + if (!empty($old_post_images_arr) && in_array($image_name, $old_post_images_arr)) { |
|
4786 | 4786 | continue; // Skip if image already exists. |
4787 | 4787 | } |
4788 | 4788 | |
4789 | - $image_name_parts = explode( '.', $image_name ); |
|
4790 | - array_pop( $image_name_parts ); |
|
4791 | - $proper_image_name = implode( '.', $image_name_parts ); |
|
4789 | + $image_name_parts = explode('.', $image_name); |
|
4790 | + array_pop($image_name_parts); |
|
4791 | + $proper_image_name = implode('.', $image_name_parts); |
|
4792 | 4792 | |
4793 | - $arr_file_type = wp_check_filetype( $image_name ); |
|
4793 | + $arr_file_type = wp_check_filetype($image_name); |
|
4794 | 4794 | |
4795 | - if ( !empty( $arr_file_type ) ) { |
|
4795 | + if (!empty($arr_file_type)) { |
|
4796 | 4796 | $uploaded_file_type = $arr_file_type['type']; |
4797 | 4797 | |
4798 | 4798 | $attachment = array(); |
4799 | 4799 | $attachment['post_id'] = $saved_post_id; |
4800 | 4800 | $attachment['title'] = $proper_image_name; |
4801 | 4801 | $attachment['content'] = ''; |
4802 | - $attachment['file'] = $uploads_subdir . '/' . $image_name; |
|
4802 | + $attachment['file'] = $uploads_subdir.'/'.$image_name; |
|
4803 | 4803 | $attachment['mime_type'] = $uploaded_file_type; |
4804 | 4804 | $attachment['menu_order'] = $order; |
4805 | 4805 | $attachment['is_featured'] = 0; |
4806 | 4806 | |
4807 | 4807 | $attachment_set = ''; |
4808 | - foreach ( $attachment as $key => $val ) { |
|
4809 | - if ( $val != '' ) { |
|
4810 | - $attachment_set .= $key . " = '" . $val . "', "; |
|
4808 | + foreach ($attachment as $key => $val) { |
|
4809 | + if ($val != '') { |
|
4810 | + $attachment_set .= $key." = '".$val."', "; |
|
4811 | 4811 | } |
4812 | 4812 | } |
4813 | - $attachment_set = trim( $attachment_set, ", " ); |
|
4813 | + $attachment_set = trim($attachment_set, ", "); |
|
4814 | 4814 | |
4815 | 4815 | // Add new attachment |
4816 | - $wpdb->query( "INSERT INTO " . GEODIR_ATTACHMENT_TABLE . " SET " . $attachment_set ); |
|
4816 | + $wpdb->query("INSERT INTO ".GEODIR_ATTACHMENT_TABLE." SET ".$attachment_set); |
|
4817 | 4817 | |
4818 | 4818 | $order++; |
4819 | 4819 | } |
4820 | 4820 | } |
4821 | 4821 | |
4822 | - $saved_post_images_sql = !empty($saved_post_images_arr) ? " AND ( file NOT LIKE '%/" . implode("' AND file NOT LIKE '%/", $saved_post_images_arr) . "' )" : ''; |
|
4822 | + $saved_post_images_sql = !empty($saved_post_images_arr) ? " AND ( file NOT LIKE '%/".implode("' AND file NOT LIKE '%/", $saved_post_images_arr)."' )" : ''; |
|
4823 | 4823 | // Remove previous attachment |
4824 | - $wpdb->query( "DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id = " . (int)$saved_post_id . " " . $saved_post_images_sql ); |
|
4824 | + $wpdb->query("DELETE FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id = ".(int) $saved_post_id." ".$saved_post_images_sql); |
|
4825 | 4825 | |
4826 | - if ( !empty( $saved_post_images_arr ) ) { |
|
4826 | + if (!empty($saved_post_images_arr)) { |
|
4827 | 4827 | $menu_order = 1; |
4828 | 4828 | |
4829 | - foreach ( $saved_post_images_arr as $img_name ) { |
|
4830 | - $wpdb->query( $wpdb->prepare( "UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order = %d WHERE post_id =%d AND file LIKE %s", array( $menu_order, $saved_post_id, '%/' . $img_name ) ) ); |
|
4829 | + foreach ($saved_post_images_arr as $img_name) { |
|
4830 | + $wpdb->query($wpdb->prepare("UPDATE ".GEODIR_ATTACHMENT_TABLE." SET menu_order = %d WHERE post_id =%d AND file LIKE %s", array($menu_order, $saved_post_id, '%/'.$img_name))); |
|
4831 | 4831 | |
4832 | - if( $menu_order == 1 ) { |
|
4833 | - if ( $featured_image = $wpdb->get_var( $wpdb->prepare( "SELECT file FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id =%d AND file LIKE %s", array( $saved_post_id, '%/' . $img_name ) ) ) ) { |
|
4834 | - $wpdb->query( $wpdb->prepare( "UPDATE " . $table . " SET featured_image = %s WHERE post_id =%d", array( $featured_image, $saved_post_id ) ) ); |
|
4832 | + if ($menu_order == 1) { |
|
4833 | + if ($featured_image = $wpdb->get_var($wpdb->prepare("SELECT file FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id =%d AND file LIKE %s", array($saved_post_id, '%/'.$img_name)))) { |
|
4834 | + $wpdb->query($wpdb->prepare("UPDATE ".$table." SET featured_image = %s WHERE post_id =%d", array($featured_image, $saved_post_id))); |
|
4835 | 4835 | } |
4836 | 4836 | } |
4837 | 4837 | $menu_order++; |
4838 | 4838 | } |
4839 | 4839 | } |
4840 | 4840 | |
4841 | - if ( $order > 1 ) { |
|
4841 | + if ($order > 1) { |
|
4842 | 4842 | $images++; |
4843 | 4843 | } |
4844 | 4844 | } |
4845 | 4845 | |
4846 | 4846 | /** This action is documented in geodirectory-functions/post-functions.php */ |
4847 | - do_action( 'geodir_after_save_listing', $saved_post_id, $gd_post ); |
|
4847 | + do_action('geodir_after_save_listing', $saved_post_id, $gd_post); |
|
4848 | 4848 | |
4849 | 4849 | if (isset($is_featured)) { |
4850 | 4850 | geodir_save_post_meta($saved_post_id, 'is_featured', $is_featured); |
@@ -4864,10 +4864,10 @@ discard block |
||
4864 | 4864 | } |
4865 | 4865 | |
4866 | 4866 | //undo some stuff to make the import quicker |
4867 | - wp_defer_term_counting( false ); |
|
4868 | - wp_defer_comment_counting( false ); |
|
4869 | - $wpdb->query( 'COMMIT;' ); |
|
4870 | - $wpdb->query( 'SET autocommit = 1;' ); |
|
4867 | + wp_defer_term_counting(false); |
|
4868 | + wp_defer_comment_counting(false); |
|
4869 | + $wpdb->query('COMMIT;'); |
|
4870 | + $wpdb->query('SET autocommit = 1;'); |
|
4871 | 4871 | |
4872 | 4872 | $json = array(); |
4873 | 4873 | $json['processed'] = $processed_actual; |
@@ -4878,9 +4878,9 @@ discard block |
||
4878 | 4878 | $json['invalid_addr'] = $invalid_addr; |
4879 | 4879 | $json['images'] = $images; |
4880 | 4880 | |
4881 | - wp_send_json( $json ); |
|
4881 | + wp_send_json($json); |
|
4882 | 4882 | exit; |
4883 | - } else if ( $task == 'import_loc' ) { |
|
4883 | + } else if ($task == 'import_loc') { |
|
4884 | 4884 | global $gd_post_types; |
4885 | 4885 | $gd_post_types = $post_types; |
4886 | 4886 | |
@@ -4889,82 +4889,82 @@ discard block |
||
4889 | 4889 | |
4890 | 4890 | if (empty($columns) || (!empty($columns) && $columns[0] == '')) { |
4891 | 4891 | $json['error'] = __('File you are uploading is not valid. Columns does not matching.', 'geodirectory'); |
4892 | - wp_send_json( $json ); |
|
4892 | + wp_send_json($json); |
|
4893 | 4893 | } |
4894 | 4894 | |
4895 | 4895 | $gd_error_log = __('GD IMPORT LOCATIONS [ROW %d]:', 'geodirectory'); |
4896 | - $gd_error_location = __( 'Could not be saved due to blank/invalid address(city, region, country, latitude, longitude)', 'geodirectory' ); |
|
4896 | + $gd_error_location = __('Could not be saved due to blank/invalid address(city, region, country, latitude, longitude)', 'geodirectory'); |
|
4897 | 4897 | for ($i = 1; $i <= $limit; $i++) { |
4898 | 4898 | $index = $processed + $i; |
4899 | 4899 | |
4900 | 4900 | if (isset($file[$index])) { |
4901 | 4901 | $row = $file[$index]; |
4902 | - $row = array_map( 'trim', $row ); |
|
4902 | + $row = array_map('trim', $row); |
|
4903 | 4903 | $data = array(); |
4904 | 4904 | |
4905 | - foreach ($columns as $c => $column ) { |
|
4905 | + foreach ($columns as $c => $column) { |
|
4906 | 4906 | if (in_array($column, array('location_id', 'latitude', 'longitude', 'city', 'city_slug', 'region', 'country', 'city_meta', 'city_desc', 'region_meta', 'region_desc', 'country_meta', 'country_desc'))) { |
4907 | 4907 | $data[$column] = $row[$c]; |
4908 | 4908 | } |
4909 | 4909 | } |
4910 | 4910 | |
4911 | - if ( empty($data['city']) || empty($data['region']) || empty($data['country']) || empty($data['latitude']) || empty($data['longitude']) ) { |
|
4911 | + if (empty($data['city']) || empty($data['region']) || empty($data['country']) || empty($data['latitude']) || empty($data['longitude'])) { |
|
4912 | 4912 | $invalid++; |
4913 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_location ); |
|
4913 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$gd_error_location); |
|
4914 | 4914 | continue; |
4915 | 4915 | } |
4916 | 4916 | |
4917 | 4917 | $data['location_id'] = isset($data['location_id']) ? absint($data['location_id']) : 0; |
4918 | 4918 | |
4919 | - if ( $import_choice == 'update' ) { |
|
4920 | - if ( (int)$data['location_id'] > 0 && $location = geodir_get_location_by_id( '', (int)$data['location_id'] ) ) { |
|
4921 | - if ( $location_id = geodir_location_update_city( $data, true, $location ) ) { |
|
4919 | + if ($import_choice == 'update') { |
|
4920 | + if ((int) $data['location_id'] > 0 && $location = geodir_get_location_by_id('', (int) $data['location_id'])) { |
|
4921 | + if ($location_id = geodir_location_update_city($data, true, $location)) { |
|
4922 | 4922 | $updated++; |
4923 | 4923 | } else { |
4924 | 4924 | $invalid++; |
4925 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_location ); |
|
4925 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$gd_error_location); |
|
4926 | 4926 | } |
4927 | - } else if ( !empty( $data['city_slug'] ) && $location = geodir_get_location_by_slug( 'city', array( 'city_slug' => $data['city_slug'] ) ) ) { |
|
4928 | - $data['location_id'] = (int)$location->location_id; |
|
4927 | + } else if (!empty($data['city_slug']) && $location = geodir_get_location_by_slug('city', array('city_slug' => $data['city_slug']))) { |
|
4928 | + $data['location_id'] = (int) $location->location_id; |
|
4929 | 4929 | |
4930 | - if ( $location = geodir_get_location_by_slug( 'city', array( 'city_slug' => $data['city_slug'], 'country' => $data['country'], 'region' => $data['region'] ) ) ) { |
|
4931 | - $data['location_id'] = (int)$location->location_id; |
|
4932 | - } else if ( $location = geodir_get_location_by_slug( 'city', array( 'city_slug' => $data['city_slug'], 'region' => $data['region'] ) ) ) { |
|
4933 | - $data['location_id'] = (int)$location->location_id; |
|
4934 | - } else if ( $location = geodir_get_location_by_slug( 'city', array( 'city_slug' => $data['city_slug'], 'country' => $data['country'] ) ) ) { |
|
4935 | - $data['location_id'] = (int)$location->location_id; |
|
4930 | + if ($location = geodir_get_location_by_slug('city', array('city_slug' => $data['city_slug'], 'country' => $data['country'], 'region' => $data['region']))) { |
|
4931 | + $data['location_id'] = (int) $location->location_id; |
|
4932 | + } else if ($location = geodir_get_location_by_slug('city', array('city_slug' => $data['city_slug'], 'region' => $data['region']))) { |
|
4933 | + $data['location_id'] = (int) $location->location_id; |
|
4934 | + } else if ($location = geodir_get_location_by_slug('city', array('city_slug' => $data['city_slug'], 'country' => $data['country']))) { |
|
4935 | + $data['location_id'] = (int) $location->location_id; |
|
4936 | 4936 | } |
4937 | 4937 | |
4938 | - if ( $location_id = geodir_location_update_city( $data, true, $location ) ) { |
|
4938 | + if ($location_id = geodir_location_update_city($data, true, $location)) { |
|
4939 | 4939 | $updated++; |
4940 | 4940 | } else { |
4941 | 4941 | $invalid++; |
4942 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_location ); |
|
4942 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$gd_error_location); |
|
4943 | 4943 | } |
4944 | 4944 | } else { |
4945 | - if ( $location_id = geodir_location_insert_city( $data, true ) ) { |
|
4945 | + if ($location_id = geodir_location_insert_city($data, true)) { |
|
4946 | 4946 | $created++; |
4947 | 4947 | } else { |
4948 | 4948 | $invalid++; |
4949 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_location ); |
|
4949 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$gd_error_location); |
|
4950 | 4950 | } |
4951 | 4951 | } |
4952 | - } elseif ( $import_choice == 'skip' ) { |
|
4953 | - if ( (int)$data['location_id'] > 0 && $location = geodir_get_location_by_id( '', (int)$data['location_id'] ) ) { |
|
4952 | + } elseif ($import_choice == 'skip') { |
|
4953 | + if ((int) $data['location_id'] > 0 && $location = geodir_get_location_by_id('', (int) $data['location_id'])) { |
|
4954 | 4954 | $skipped++; |
4955 | - } else if ( !empty( $data['city_slug'] ) && $location = geodir_get_location_by_slug( 'city', array( 'city_slug' => $data['city_slug'] ) ) ) { |
|
4955 | + } else if (!empty($data['city_slug']) && $location = geodir_get_location_by_slug('city', array('city_slug' => $data['city_slug']))) { |
|
4956 | 4956 | $skipped++; |
4957 | 4957 | } else { |
4958 | - if ( $location_id = geodir_location_insert_city( $data, true ) ) { |
|
4958 | + if ($location_id = geodir_location_insert_city($data, true)) { |
|
4959 | 4959 | $created++; |
4960 | 4960 | } else { |
4961 | 4961 | $invalid++; |
4962 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_location ); |
|
4962 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$gd_error_location); |
|
4963 | 4963 | } |
4964 | 4964 | } |
4965 | 4965 | } else { |
4966 | 4966 | $invalid++; |
4967 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_location ); |
|
4967 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$gd_error_location); |
|
4968 | 4968 | } |
4969 | 4969 | } |
4970 | 4970 | } |
@@ -4978,24 +4978,24 @@ discard block |
||
4978 | 4978 | $json['invalid'] = $invalid; |
4979 | 4979 | $json['images'] = $images; |
4980 | 4980 | |
4981 | - wp_send_json( $json ); |
|
4982 | - } else if ( $task == 'import_hood' ) { |
|
4981 | + wp_send_json($json); |
|
4982 | + } else if ($task == 'import_hood') { |
|
4983 | 4983 | if (!empty($file)) { |
4984 | 4984 | $columns = isset($file[0]) ? $file[0] : NULL; |
4985 | 4985 | |
4986 | 4986 | if (empty($columns) || (!empty($columns) && $columns[0] == '')) { |
4987 | 4987 | $json['error'] = __('File you are uploading is not valid. Columns does not matching.', 'geodirectory'); |
4988 | - wp_send_json( $json ); |
|
4988 | + wp_send_json($json); |
|
4989 | 4989 | } |
4990 | 4990 | |
4991 | 4991 | $gd_error_log = __('GD IMPORT NEIGHBOURHOODS [ROW %d]:', 'geodirectory'); |
4992 | - $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' ); |
|
4992 | + $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'); |
|
4993 | 4993 | for ($i = 1; $i <= $limit; $i++) { |
4994 | 4994 | $index = $processed + $i; |
4995 | 4995 | |
4996 | 4996 | if (isset($file[$index])) { |
4997 | 4997 | $row = $file[$index]; |
4998 | - $row = array_map( 'trim', $row ); |
|
4998 | + $row = array_map('trim', $row); |
|
4999 | 4999 | $data = array(); |
5000 | 5000 | |
5001 | 5001 | foreach ($columns as $c => $column) { |
@@ -5006,20 +5006,20 @@ discard block |
||
5006 | 5006 | |
5007 | 5007 | if (empty($data['neighbourhood_name']) || empty($data['latitude']) || empty($data['longitude'])) { |
5008 | 5008 | $invalid++; |
5009 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_hood ); |
|
5009 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$gd_error_hood); |
|
5010 | 5010 | continue; |
5011 | 5011 | } |
5012 | 5012 | |
5013 | 5013 | $location_info = array(); |
5014 | - if (!empty($data['location_id']) && (int)$data['location_id'] > 0) { |
|
5015 | - $location_info = geodir_get_location_by_id('', (int)$data['location_id']); |
|
5014 | + if (!empty($data['location_id']) && (int) $data['location_id'] > 0) { |
|
5015 | + $location_info = geodir_get_location_by_id('', (int) $data['location_id']); |
|
5016 | 5016 | } else if (!empty($data['city']) && !empty($data['region']) && !empty($data['country'])) { |
5017 | 5017 | $location_info = geodir_get_location_by_slug('city', array('fields' => 'location_id', 'city' => $data['city'], 'country' => $data['country'], 'region' => $data['region'])); |
5018 | 5018 | } |
5019 | 5019 | |
5020 | 5020 | if (empty($location_info)) { |
5021 | 5021 | $invalid++; |
5022 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_hood ); |
|
5022 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$gd_error_hood); |
|
5023 | 5023 | continue; |
5024 | 5024 | } |
5025 | 5025 | |
@@ -5034,35 +5034,35 @@ discard block |
||
5034 | 5034 | $hood_data['hood_longitude'] = $data['longitude']; |
5035 | 5035 | $hood_data['hood_location_id'] = $location_id; |
5036 | 5036 | |
5037 | - if ( $import_choice == 'update' ) { |
|
5038 | - if ((int)$data['neighbourhood_id'] > 0 && ($neighbourhood = geodir_location_get_neighbourhood_by_id((int)$data['neighbourhood_id']))) { |
|
5039 | - $hood_data['hood_id'] = (int)$data['neighbourhood_id']; |
|
5037 | + if ($import_choice == 'update') { |
|
5038 | + if ((int) $data['neighbourhood_id'] > 0 && ($neighbourhood = geodir_location_get_neighbourhood_by_id((int) $data['neighbourhood_id']))) { |
|
5039 | + $hood_data['hood_id'] = (int) $data['neighbourhood_id']; |
|
5040 | 5040 | |
5041 | 5041 | if ($neighbourhood = geodir_location_insert_update_neighbourhood($hood_data)) { |
5042 | 5042 | $updated++; |
5043 | 5043 | } else { |
5044 | 5044 | $invalid++; |
5045 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_hood ); |
|
5045 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$gd_error_hood); |
|
5046 | 5046 | } |
5047 | 5047 | } else if (!empty($data['neighbourhood_slug']) && ($neighbourhood = geodir_location_get_neighbourhood_by_id($data['neighbourhood_slug'], true))) { |
5048 | - $hood_data['hood_id'] = (int)$neighbourhood->hood_id; |
|
5048 | + $hood_data['hood_id'] = (int) $neighbourhood->hood_id; |
|
5049 | 5049 | |
5050 | 5050 | if ($neighbourhood = geodir_location_insert_update_neighbourhood($hood_data)) { |
5051 | 5051 | $updated++; |
5052 | 5052 | } else { |
5053 | 5053 | $invalid++; |
5054 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_hood ); |
|
5054 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$gd_error_hood); |
|
5055 | 5055 | } |
5056 | 5056 | } else { |
5057 | 5057 | if ($neighbourhood = geodir_location_insert_update_neighbourhood($hood_data)) { |
5058 | 5058 | $created++; |
5059 | 5059 | } else { |
5060 | 5060 | $invalid++; |
5061 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_hood ); |
|
5061 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$gd_error_hood); |
|
5062 | 5062 | } |
5063 | 5063 | } |
5064 | - } elseif ( $import_choice == 'skip' ) { |
|
5065 | - if ((int)$data['neighbourhood_id'] > 0 && ($neighbourhood = geodir_location_get_neighbourhood_by_id((int)$data['neighbourhood_id']))) { |
|
5064 | + } elseif ($import_choice == 'skip') { |
|
5065 | + if ((int) $data['neighbourhood_id'] > 0 && ($neighbourhood = geodir_location_get_neighbourhood_by_id((int) $data['neighbourhood_id']))) { |
|
5066 | 5066 | $skipped++; |
5067 | 5067 | } else if (!empty($data['neighbourhood_slug']) && ($neighbourhood = geodir_location_get_neighbourhood_by_id($data['neighbourhood_slug'], true))) { |
5068 | 5068 | $skipped++; |
@@ -5072,12 +5072,12 @@ discard block |
||
5072 | 5072 | $created++; |
5073 | 5073 | } else { |
5074 | 5074 | $invalid++; |
5075 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_hood ); |
|
5075 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$gd_error_hood); |
|
5076 | 5076 | } |
5077 | 5077 | } |
5078 | 5078 | } else { |
5079 | 5079 | $invalid++; |
5080 | - geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_hood ); |
|
5080 | + geodir_error_log(wp_sprintf($gd_error_log, ($index + 1)).' '.$gd_error_hood); |
|
5081 | 5081 | } |
5082 | 5082 | } |
5083 | 5083 | } |
@@ -5091,7 +5091,7 @@ discard block |
||
5091 | 5091 | $json['invalid'] = $invalid; |
5092 | 5092 | $json['images'] = $images; |
5093 | 5093 | |
5094 | - wp_send_json( $json ); |
|
5094 | + wp_send_json($json); |
|
5095 | 5095 | } |
5096 | 5096 | } |
5097 | 5097 | break; |
@@ -5135,29 +5135,29 @@ discard block |
||
5135 | 5135 | * } |
5136 | 5136 | * @return int|bool Term id when success, false when fail. |
5137 | 5137 | */ |
5138 | -function geodir_imex_insert_term( $taxonomy, $term_data ) { |
|
5139 | - if ( empty( $taxonomy ) || empty( $term_data ) ) { |
|
5138 | +function geodir_imex_insert_term($taxonomy, $term_data) { |
|
5139 | + if (empty($taxonomy) || empty($term_data)) { |
|
5140 | 5140 | return false; |
5141 | 5141 | } |
5142 | 5142 | |
5143 | - $term = isset( $term_data['name'] ) && !empty( $term_data['name'] ) ? $term_data['name'] : ''; |
|
5143 | + $term = isset($term_data['name']) && !empty($term_data['name']) ? $term_data['name'] : ''; |
|
5144 | 5144 | $args = array(); |
5145 | - $args['description'] = isset( $term_data['description'] ) ? $term_data['description'] : ''; |
|
5146 | - $args['slug'] = isset( $term_data['slug'] ) ? $term_data['slug'] : ''; |
|
5147 | - $args['parent'] = isset( $term_data['parent'] ) ? (int)$term_data['parent'] : ''; |
|
5145 | + $args['description'] = isset($term_data['description']) ? $term_data['description'] : ''; |
|
5146 | + $args['slug'] = isset($term_data['slug']) ? $term_data['slug'] : ''; |
|
5147 | + $args['parent'] = isset($term_data['parent']) ? (int) $term_data['parent'] : ''; |
|
5148 | 5148 | |
5149 | - if ( ( !empty( $args['slug'] ) && term_exists( $args['slug'], $taxonomy ) ) || empty( $args['slug'] ) ) { |
|
5150 | - $term_args = array_merge( $term_data, $args ); |
|
5151 | - $defaults = array( 'alias_of' => '', 'description' => '', 'parent' => 0, 'slug' => ''); |
|
5152 | - $term_args = wp_parse_args( $term_args, $defaults ); |
|
5153 | - $term_args = sanitize_term( $term_args, $taxonomy, 'db' ); |
|
5154 | - $args['slug'] = wp_unique_term_slug( $args['slug'], (object)$term_args ); |
|
5149 | + if ((!empty($args['slug']) && term_exists($args['slug'], $taxonomy)) || empty($args['slug'])) { |
|
5150 | + $term_args = array_merge($term_data, $args); |
|
5151 | + $defaults = array('alias_of' => '', 'description' => '', 'parent' => 0, 'slug' => ''); |
|
5152 | + $term_args = wp_parse_args($term_args, $defaults); |
|
5153 | + $term_args = sanitize_term($term_args, $taxonomy, 'db'); |
|
5154 | + $args['slug'] = wp_unique_term_slug($args['slug'], (object) $term_args); |
|
5155 | 5155 | } |
5156 | 5156 | |
5157 | - if( !empty( $term ) ) { |
|
5158 | - $result = wp_insert_term( $term, $taxonomy, $args ); |
|
5159 | - if( !is_wp_error( $result ) ) { |
|
5160 | - return isset( $result['term_id'] ) ? $result['term_id'] : 0; |
|
5157 | + if (!empty($term)) { |
|
5158 | + $result = wp_insert_term($term, $taxonomy, $args); |
|
5159 | + if (!is_wp_error($result)) { |
|
5160 | + return isset($result['term_id']) ? $result['term_id'] : 0; |
|
5161 | 5161 | } |
5162 | 5162 | } |
5163 | 5163 | |
@@ -5187,36 +5187,36 @@ discard block |
||
5187 | 5187 | * } |
5188 | 5188 | * @return int|bool Term id when success, false when fail. |
5189 | 5189 | */ |
5190 | -function geodir_imex_update_term( $taxonomy, $term_data ) { |
|
5191 | - if ( empty( $taxonomy ) || empty( $term_data ) ) { |
|
5190 | +function geodir_imex_update_term($taxonomy, $term_data) { |
|
5191 | + if (empty($taxonomy) || empty($term_data)) { |
|
5192 | 5192 | return false; |
5193 | 5193 | } |
5194 | 5194 | |
5195 | - $term_id = isset( $term_data['term_id'] ) && !empty( $term_data['term_id'] ) ? $term_data['term_id'] : 0; |
|
5195 | + $term_id = isset($term_data['term_id']) && !empty($term_data['term_id']) ? $term_data['term_id'] : 0; |
|
5196 | 5196 | |
5197 | 5197 | $args = array(); |
5198 | - $args['description'] = isset( $term_data['description'] ) ? $term_data['description'] : ''; |
|
5199 | - $args['slug'] = isset( $term_data['slug'] ) ? $term_data['slug'] : ''; |
|
5200 | - $args['parent'] = isset( $term_data['parent'] ) ? (int)$term_data['parent'] : ''; |
|
5198 | + $args['description'] = isset($term_data['description']) ? $term_data['description'] : ''; |
|
5199 | + $args['slug'] = isset($term_data['slug']) ? $term_data['slug'] : ''; |
|
5200 | + $args['parent'] = isset($term_data['parent']) ? (int) $term_data['parent'] : ''; |
|
5201 | 5201 | |
5202 | - if ( $term_id > 0 && $term_info = (array)get_term( $term_id, $taxonomy ) ) { |
|
5202 | + if ($term_id > 0 && $term_info = (array) get_term($term_id, $taxonomy)) { |
|
5203 | 5203 | $term_data['term_id'] = $term_info['term_id']; |
5204 | 5204 | |
5205 | - $result = wp_update_term( $term_data['term_id'], $taxonomy, $term_data ); |
|
5205 | + $result = wp_update_term($term_data['term_id'], $taxonomy, $term_data); |
|
5206 | 5206 | |
5207 | - if( !is_wp_error( $result ) ) { |
|
5208 | - return isset( $result['term_id'] ) ? $result['term_id'] : 0; |
|
5207 | + if (!is_wp_error($result)) { |
|
5208 | + return isset($result['term_id']) ? $result['term_id'] : 0; |
|
5209 | 5209 | } |
5210 | - } else if ( $term_data['slug'] != '' && $term_info = (array)term_exists( $term_data['slug'], $taxonomy ) ) { |
|
5210 | + } else if ($term_data['slug'] != '' && $term_info = (array) term_exists($term_data['slug'], $taxonomy)) { |
|
5211 | 5211 | $term_data['term_id'] = $term_info['term_id']; |
5212 | 5212 | |
5213 | - $result = wp_update_term( $term_data['term_id'], $taxonomy, $term_data ); |
|
5213 | + $result = wp_update_term($term_data['term_id'], $taxonomy, $term_data); |
|
5214 | 5214 | |
5215 | - if( !is_wp_error( $result ) ) { |
|
5216 | - return isset( $result['term_id'] ) ? $result['term_id'] : 0; |
|
5215 | + if (!is_wp_error($result)) { |
|
5216 | + return isset($result['term_id']) ? $result['term_id'] : 0; |
|
5217 | 5217 | } |
5218 | 5218 | } else { |
5219 | - return geodir_imex_insert_term( $taxonomy, $term_data ); |
|
5219 | + return geodir_imex_insert_term($taxonomy, $term_data); |
|
5220 | 5220 | } |
5221 | 5221 | |
5222 | 5222 | return false; |
@@ -5234,25 +5234,25 @@ discard block |
||
5234 | 5234 | * @param string $post_type Post type. |
5235 | 5235 | * @return int Posts count. |
5236 | 5236 | */ |
5237 | -function geodir_get_posts_count( $post_type ) { |
|
5237 | +function geodir_get_posts_count($post_type) { |
|
5238 | 5238 | global $wpdb, $plugin_prefix; |
5239 | 5239 | |
5240 | - if ( !post_type_exists( $post_type ) ) { |
|
5240 | + if (!post_type_exists($post_type)) { |
|
5241 | 5241 | return 0; |
5242 | 5242 | } |
5243 | 5243 | |
5244 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
5244 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
5245 | 5245 | |
5246 | 5246 | // Skip listing with statuses trash, auto-draft etc... |
5247 | 5247 | $skip_statuses = geodir_imex_export_skip_statuses(); |
5248 | 5248 | $where_statuses = ''; |
5249 | - if ( !empty( $skip_statuses ) && is_array( $skip_statuses ) ) { |
|
5250 | - $where_statuses = "AND `" . $wpdb->posts . "`.`post_status` NOT IN('" . implode( "','", $skip_statuses ) . "')"; |
|
5249 | + if (!empty($skip_statuses) && is_array($skip_statuses)) { |
|
5250 | + $where_statuses = "AND `".$wpdb->posts."`.`post_status` NOT IN('".implode("','", $skip_statuses)."')"; |
|
5251 | 5251 | } |
5252 | 5252 | |
5253 | - $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 ); |
|
5253 | + $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); |
|
5254 | 5254 | |
5255 | - $posts_count = (int)$wpdb->get_var( $query ); |
|
5255 | + $posts_count = (int) $wpdb->get_var($query); |
|
5256 | 5256 | |
5257 | 5257 | /** |
5258 | 5258 | * Modify returned post counts for the current post type. |
@@ -5263,7 +5263,7 @@ discard block |
||
5263 | 5263 | * @param int $posts_count Post counts. |
5264 | 5264 | * @param string $post_type Post type. |
5265 | 5265 | */ |
5266 | - $posts_count = apply_filters( 'geodir_imex_count_posts', $posts_count, $post_type ); |
|
5266 | + $posts_count = apply_filters('geodir_imex_count_posts', $posts_count, $post_type); |
|
5267 | 5267 | |
5268 | 5268 | return $posts_count; |
5269 | 5269 | } |
@@ -5284,17 +5284,17 @@ discard block |
||
5284 | 5284 | * @param int $page_no Page number. Default 0. |
5285 | 5285 | * @return array Array of posts data. |
5286 | 5286 | */ |
5287 | -function geodir_imex_get_posts( $post_type, $per_page = 0, $page_no = 0 ) { |
|
5287 | +function geodir_imex_get_posts($post_type, $per_page = 0, $page_no = 0) { |
|
5288 | 5288 | global $wp_filesystem; |
5289 | 5289 | |
5290 | - $posts = geodir_get_export_posts( $post_type, $per_page, $page_no ); |
|
5290 | + $posts = geodir_get_export_posts($post_type, $per_page, $page_no); |
|
5291 | 5291 | |
5292 | 5292 | $csv_rows = array(); |
5293 | 5293 | |
5294 | - if ( !empty( $posts ) ) { |
|
5295 | - $is_payment_plugin = is_plugin_active( 'geodir_payment_manager/geodir_payment_manager.php' ); |
|
5294 | + if (!empty($posts)) { |
|
5295 | + $is_payment_plugin = is_plugin_active('geodir_payment_manager/geodir_payment_manager.php'); |
|
5296 | 5296 | $location_manager = function_exists('geodir_location_plugin_activated') ? true : false; // Check location manager installed & active. |
5297 | - $location_allowed = function_exists( 'geodir_cpt_no_location' ) && geodir_cpt_no_location( $post_type ) ? false : true; |
|
5297 | + $location_allowed = function_exists('geodir_cpt_no_location') && geodir_cpt_no_location($post_type) ? false : true; |
|
5298 | 5298 | $neighbourhood_active = $location_manager && $location_allowed && get_option('location_neighbourhoods') ? true : false; |
5299 | 5299 | |
5300 | 5300 | $csv_row = array(); |
@@ -5306,7 +5306,7 @@ discard block |
||
5306 | 5306 | $csv_row[] = 'default_category'; |
5307 | 5307 | $csv_row[] = 'post_tags'; |
5308 | 5308 | $csv_row[] = 'post_type'; |
5309 | - if ( $post_type == 'gd_event' ) { |
|
5309 | + if ($post_type == 'gd_event') { |
|
5310 | 5310 | $csv_row[] = 'event_date'; |
5311 | 5311 | $csv_row[] = 'event_enddate'; |
5312 | 5312 | $csv_row[] = 'starttime'; |
@@ -5360,15 +5360,15 @@ discard block |
||
5360 | 5360 | } |
5361 | 5361 | // WPML |
5362 | 5362 | |
5363 | - $custom_fields = geodir_imex_get_custom_fields( $post_type ); |
|
5364 | - if ( !empty( $custom_fields ) ) { |
|
5365 | - foreach ( $custom_fields as $custom_field ) { |
|
5363 | + $custom_fields = geodir_imex_get_custom_fields($post_type); |
|
5364 | + if (!empty($custom_fields)) { |
|
5365 | + foreach ($custom_fields as $custom_field) { |
|
5366 | 5366 | $csv_row[] = $custom_field->htmlvar_name; |
5367 | 5367 | } |
5368 | 5368 | } |
5369 | 5369 | |
5370 | 5370 | // Export franchise fields |
5371 | - $is_franchise_active = is_plugin_active( 'geodir_franchise/geodir_franchise.php' ) && geodir_franchise_enabled( $post_type ) ? true : false; |
|
5371 | + $is_franchise_active = is_plugin_active('geodir_franchise/geodir_franchise.php') && geodir_franchise_enabled($post_type) ? true : false; |
|
5372 | 5372 | if ($is_franchise_active) { |
5373 | 5373 | $csv_row[] = 'gd_is_franchise'; |
5374 | 5374 | $csv_row[] = 'gd_franchise_lock'; |
@@ -5378,28 +5378,28 @@ discard block |
||
5378 | 5378 | $csv_rows[] = $csv_row; |
5379 | 5379 | |
5380 | 5380 | $images_count = 5; |
5381 | - $xx=0; |
|
5382 | - foreach ( $posts as $post ) {$xx++; |
|
5381 | + $xx = 0; |
|
5382 | + foreach ($posts as $post) {$xx++; |
|
5383 | 5383 | $post_id = $post['ID']; |
5384 | 5384 | |
5385 | - $gd_post_info = geodir_get_post_info( $post_id ); |
|
5386 | - $post_info = (array)$gd_post_info; |
|
5385 | + $gd_post_info = geodir_get_post_info($post_id); |
|
5386 | + $post_info = (array) $gd_post_info; |
|
5387 | 5387 | |
5388 | - $taxonomy_category = $post_type . 'category'; |
|
5389 | - $taxonomy_tags = $post_type . '_tags'; |
|
5388 | + $taxonomy_category = $post_type.'category'; |
|
5389 | + $taxonomy_tags = $post_type.'_tags'; |
|
5390 | 5390 | |
5391 | 5391 | $post_category = ''; |
5392 | 5392 | $default_category_id = $gd_post_info->default_category; |
5393 | 5393 | $default_category = ''; |
5394 | 5394 | $post_tags = ''; |
5395 | - $terms = wp_get_post_terms( $post_id, array( $taxonomy_category, $taxonomy_tags ) ); |
|
5395 | + $terms = wp_get_post_terms($post_id, array($taxonomy_category, $taxonomy_tags)); |
|
5396 | 5396 | |
5397 | - if ( !empty( $terms ) && !is_wp_error( $terms ) ) { |
|
5397 | + if (!empty($terms) && !is_wp_error($terms)) { |
|
5398 | 5398 | $post_category = array(); |
5399 | 5399 | $post_tags = array(); |
5400 | 5400 | |
5401 | - foreach ( $terms as $term ) { |
|
5402 | - if ( $term->taxonomy == $taxonomy_category ) { |
|
5401 | + foreach ($terms as $term) { |
|
5402 | + if ($term->taxonomy == $taxonomy_category) { |
|
5403 | 5403 | $post_category[] = $term->name; |
5404 | 5404 | |
5405 | 5405 | if ($default_category_id == $term->term_id) { |
@@ -5407,7 +5407,7 @@ discard block |
||
5407 | 5407 | } |
5408 | 5408 | } |
5409 | 5409 | |
5410 | - if ( $term->taxonomy == $taxonomy_tags ) { |
|
5410 | + if ($term->taxonomy == $taxonomy_tags) { |
|
5411 | 5411 | $post_tags[] = $term->name; |
5412 | 5412 | } |
5413 | 5413 | } |
@@ -5415,47 +5415,47 @@ discard block |
||
5415 | 5415 | if (empty($default_category) && !empty($post_category)) { |
5416 | 5416 | $default_category = $post_category[0]; // Set first one as default category. |
5417 | 5417 | } |
5418 | - $post_category = !empty( $post_category ) ? implode( ',', $post_category ) : ''; |
|
5419 | - $post_tags = !empty( $post_tags ) ? implode( ',', $post_tags ) : ''; |
|
5418 | + $post_category = !empty($post_category) ? implode(',', $post_category) : ''; |
|
5419 | + $post_tags = !empty($post_tags) ? implode(',', $post_tags) : ''; |
|
5420 | 5420 | } |
5421 | 5421 | |
5422 | 5422 | // Franchise data |
5423 | - if ($is_franchise_active && isset($post_info['franchise']) && (int)$post_info['franchise'] > 0 && geodir_franchise_check((int)$post_info['franchise'])) { |
|
5423 | + if ($is_franchise_active && isset($post_info['franchise']) && (int) $post_info['franchise'] > 0 && geodir_franchise_check((int) $post_info['franchise'])) { |
|
5424 | 5424 | $franchise_id = $post_info['franchise']; |
5425 | 5425 | $gd_franchise_info = geodir_get_post_info($franchise_id); |
5426 | 5426 | |
5427 | 5427 | if (geodir_franchise_pkg_is_active($gd_franchise_info)) { |
5428 | - $franchise_info = (array)$gd_franchise_info; |
|
5428 | + $franchise_info = (array) $gd_franchise_info; |
|
5429 | 5429 | $locked_fields = geodir_franchise_get_locked_fields($franchise_id, true); |
5430 | 5430 | |
5431 | 5431 | if (!empty($locked_fields)) { |
5432 | - foreach( $locked_fields as $locked_field) { |
|
5432 | + foreach ($locked_fields as $locked_field) { |
|
5433 | 5433 | if (isset($post_info[$locked_field]) && isset($franchise_info[$locked_field])) { |
5434 | 5434 | $post_info[$locked_field] = $franchise_info[$locked_field]; |
5435 | 5435 | } |
5436 | 5436 | |
5437 | 5437 | if (in_array($taxonomy_category, $locked_fields) || in_array('post_tags', $locked_fields)) { |
5438 | - $franchise_terms = wp_get_post_terms( $franchise_id, array( $taxonomy_category, $taxonomy_tags ) ); |
|
5438 | + $franchise_terms = wp_get_post_terms($franchise_id, array($taxonomy_category, $taxonomy_tags)); |
|
5439 | 5439 | |
5440 | - if ( !empty( $franchise_terms ) && !is_wp_error( $franchise_terms ) ) { |
|
5440 | + if (!empty($franchise_terms) && !is_wp_error($franchise_terms)) { |
|
5441 | 5441 | $franchise_post_category = array(); |
5442 | 5442 | $franchise_post_tags = array(); |
5443 | 5443 | |
5444 | - foreach ( $franchise_terms as $franchise_term ) { |
|
5445 | - if ( $franchise_term->taxonomy == $taxonomy_category ) { |
|
5444 | + foreach ($franchise_terms as $franchise_term) { |
|
5445 | + if ($franchise_term->taxonomy == $taxonomy_category) { |
|
5446 | 5446 | $franchise_post_category[] = $franchise_term->name; |
5447 | 5447 | } |
5448 | 5448 | |
5449 | - if ( $franchise_term->taxonomy == $taxonomy_tags ) { |
|
5449 | + if ($franchise_term->taxonomy == $taxonomy_tags) { |
|
5450 | 5450 | $franchise_post_tags[] = $franchise_term->name; |
5451 | 5451 | } |
5452 | 5452 | } |
5453 | 5453 | |
5454 | 5454 | if (in_array($taxonomy_category, $locked_fields)) { |
5455 | - $post_category = !empty( $franchise_post_category ) ? implode( ',', $franchise_post_category ) : ''; |
|
5455 | + $post_category = !empty($franchise_post_category) ? implode(',', $franchise_post_category) : ''; |
|
5456 | 5456 | } |
5457 | 5457 | if (in_array('post_tags', $locked_fields)) { |
5458 | - $post_tags = !empty( $franchise_post_tags ) ? implode( ',', $franchise_post_tags ) : ''; |
|
5458 | + $post_tags = !empty($franchise_post_tags) ? implode(',', $franchise_post_tags) : ''; |
|
5459 | 5459 | } |
5460 | 5460 | } |
5461 | 5461 | } |
@@ -5464,18 +5464,18 @@ discard block |
||
5464 | 5464 | } |
5465 | 5465 | } |
5466 | 5466 | |
5467 | - $post_images = geodir_get_images( $post_id ); |
|
5467 | + $post_images = geodir_get_images($post_id); |
|
5468 | 5468 | $current_images = array(); |
5469 | - if ( !empty( $post_images ) ) { |
|
5470 | - foreach ( $post_images as $post_image ) { |
|
5471 | - $post_image = (array)$post_image; |
|
5472 | - $image = !empty( $post_image ) && isset( $post_image['path'] ) && $wp_filesystem->is_file( $post_image['path'] ) && $wp_filesystem->exists( $post_image['path'] ) ? $post_image['src'] : ''; |
|
5473 | - if ( $image ) { |
|
5469 | + if (!empty($post_images)) { |
|
5470 | + foreach ($post_images as $post_image) { |
|
5471 | + $post_image = (array) $post_image; |
|
5472 | + $image = !empty($post_image) && isset($post_image['path']) && $wp_filesystem->is_file($post_image['path']) && $wp_filesystem->exists($post_image['path']) ? $post_image['src'] : ''; |
|
5473 | + if ($image) { |
|
5474 | 5474 | $current_images[] = $image; |
5475 | 5475 | } |
5476 | 5476 | } |
5477 | 5477 | |
5478 | - $images_count = max( $images_count, count( $current_images ) ); |
|
5478 | + $images_count = max($images_count, count($current_images)); |
|
5479 | 5479 | } |
5480 | 5480 | |
5481 | 5481 | $csv_row = array(); |
@@ -5487,7 +5487,7 @@ discard block |
||
5487 | 5487 | $csv_row[] = $default_category; // default_category |
5488 | 5488 | $csv_row[] = $post_tags; // post_tags |
5489 | 5489 | $csv_row[] = $post_type; // post_type |
5490 | - if ( $post_type == 'gd_event' ) { |
|
5490 | + if ($post_type == 'gd_event') { |
|
5491 | 5491 | $event_data = geodir_imex_get_event_data($post, $gd_post_info); |
5492 | 5492 | $csv_row[] = $event_data['event_date']; // event_date |
5493 | 5493 | $csv_row[] = $event_data['event_enddate']; // enddate |
@@ -5508,9 +5508,9 @@ discard block |
||
5508 | 5508 | $csv_row[] = $event_data['recurring_end_date']; // repeat_end |
5509 | 5509 | } |
5510 | 5510 | $csv_row[] = $post_info['post_status']; // post_status |
5511 | - $csv_row[] = (int)$post_info['is_featured'] == 1 ? 1 : ''; // is_featured |
|
5511 | + $csv_row[] = (int) $post_info['is_featured'] == 1 ? 1 : ''; // is_featured |
|
5512 | 5512 | if ($is_payment_plugin) { |
5513 | - $csv_row[] = (int)$post_info['package_id']; // package_id |
|
5513 | + $csv_row[] = (int) $post_info['package_id']; // package_id |
|
5514 | 5514 | $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 |
5515 | 5515 | } |
5516 | 5516 | $csv_row[] = $post_info['geodir_video']; // geodir_video |
@@ -5546,14 +5546,14 @@ discard block |
||
5546 | 5546 | $csv_row[] = $post_info['geodir_special_offers']; // geodir_special_offers |
5547 | 5547 | // WPML |
5548 | 5548 | if ($is_wpml) { |
5549 | - $csv_row[] = geodir_get_language_for_element( $post_id, 'post_' . $post_type ); |
|
5550 | - $csv_row[] = geodir_imex_original_post_id( $post_id, 'post_' . $post_type ); |
|
5549 | + $csv_row[] = geodir_get_language_for_element($post_id, 'post_'.$post_type); |
|
5550 | + $csv_row[] = geodir_imex_original_post_id($post_id, 'post_'.$post_type); |
|
5551 | 5551 | } |
5552 | 5552 | // WPML |
5553 | 5553 | |
5554 | - if ( !empty( $custom_fields ) ) { |
|
5555 | - foreach ( $custom_fields as $custom_field ) { |
|
5556 | - $csv_row[] = isset( $post_info[$custom_field->htmlvar_name] ) ? $post_info[$custom_field->htmlvar_name] : ''; |
|
5554 | + if (!empty($custom_fields)) { |
|
5555 | + foreach ($custom_fields as $custom_field) { |
|
5556 | + $csv_row[] = isset($post_info[$custom_field->htmlvar_name]) ? $post_info[$custom_field->htmlvar_name] : ''; |
|
5557 | 5557 | } |
5558 | 5558 | } |
5559 | 5559 | |
@@ -5564,26 +5564,26 @@ discard block |
||
5564 | 5564 | $franchise = ''; |
5565 | 5565 | |
5566 | 5566 | if (geodir_franchise_pkg_is_active($gd_post_info)) { |
5567 | - $gd_is_franchise = (int)get_post_meta( $post_id, 'gd_is_franchise', true ); |
|
5568 | - $locaked_fields = $gd_is_franchise ? get_post_meta( $post_id, 'gd_franchise_lock', true ) : ''; |
|
5567 | + $gd_is_franchise = (int) get_post_meta($post_id, 'gd_is_franchise', true); |
|
5568 | + $locaked_fields = $gd_is_franchise ? get_post_meta($post_id, 'gd_franchise_lock', true) : ''; |
|
5569 | 5569 | $locaked_fields = (is_array($locaked_fields) && !empty($locaked_fields) ? implode(",", $locaked_fields) : ''); |
5570 | - $franchise = !$gd_is_franchise && isset($post_info['franchise']) && (int)$post_info['franchise'] > 0 ? (int)$post_info['franchise'] : 0; // franchise id |
|
5570 | + $franchise = !$gd_is_franchise && isset($post_info['franchise']) && (int) $post_info['franchise'] > 0 ? (int) $post_info['franchise'] : 0; // franchise id |
|
5571 | 5571 | } |
5572 | 5572 | |
5573 | - $csv_row[] = (int)$gd_is_franchise; // gd_is_franchise |
|
5573 | + $csv_row[] = (int) $gd_is_franchise; // gd_is_franchise |
|
5574 | 5574 | $csv_row[] = $locaked_fields; // gd_franchise_lock fields |
5575 | - $csv_row[] = (int)$franchise; // franchise id |
|
5575 | + $csv_row[] = (int) $franchise; // franchise id |
|
5576 | 5576 | } |
5577 | 5577 | |
5578 | - for ( $c = 0; $c < $images_count; $c++ ) { |
|
5579 | - $csv_row[] = isset( $current_images[$c] ) ? $current_images[$c] : ''; // IMAGE |
|
5578 | + for ($c = 0; $c < $images_count; $c++) { |
|
5579 | + $csv_row[] = isset($current_images[$c]) ? $current_images[$c] : ''; // IMAGE |
|
5580 | 5580 | } |
5581 | 5581 | |
5582 | 5582 | $csv_rows[] = $csv_row; |
5583 | 5583 | |
5584 | 5584 | } |
5585 | 5585 | |
5586 | - for ( $c = 0; $c < $images_count; $c++ ) { |
|
5586 | + for ($c = 0; $c < $images_count; $c++) { |
|
5587 | 5587 | $csv_rows[0][] = 'IMAGE'; |
5588 | 5588 | } |
5589 | 5589 | } |
@@ -5605,33 +5605,33 @@ discard block |
||
5605 | 5605 | * @param int $page_no Page number. Default 0. |
5606 | 5606 | * @return array Array of posts data. |
5607 | 5607 | */ |
5608 | -function geodir_get_export_posts( $post_type, $per_page = 0, $page_no = 0 ) { |
|
5608 | +function geodir_get_export_posts($post_type, $per_page = 0, $page_no = 0) { |
|
5609 | 5609 | global $wpdb, $plugin_prefix; |
5610 | 5610 | |
5611 | - if ( ! post_type_exists( $post_type ) ) |
|
5611 | + if (!post_type_exists($post_type)) |
|
5612 | 5612 | return new stdClass; |
5613 | 5613 | |
5614 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
5614 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
5615 | 5615 | |
5616 | 5616 | $limit = ''; |
5617 | - if ( $per_page > 0 && $page_no > 0 ) { |
|
5618 | - $offset = ( $page_no - 1 ) * $per_page; |
|
5617 | + if ($per_page > 0 && $page_no > 0) { |
|
5618 | + $offset = ($page_no - 1) * $per_page; |
|
5619 | 5619 | |
5620 | - if ( $offset > 0 ) { |
|
5621 | - $limit = " LIMIT " . $offset . "," . $per_page; |
|
5620 | + if ($offset > 0) { |
|
5621 | + $limit = " LIMIT ".$offset.",".$per_page; |
|
5622 | 5622 | } else { |
5623 | - $limit = " LIMIT " . $per_page; |
|
5623 | + $limit = " LIMIT ".$per_page; |
|
5624 | 5624 | } |
5625 | 5625 | } |
5626 | 5626 | |
5627 | 5627 | // Skip listing with statuses trash, auto-draft etc... |
5628 | 5628 | $skip_statuses = geodir_imex_export_skip_statuses(); |
5629 | 5629 | $where_statuses = ''; |
5630 | - if ( !empty( $skip_statuses ) && is_array( $skip_statuses ) ) { |
|
5631 | - $where_statuses = "AND `" . $wpdb->posts . "`.`post_status` NOT IN('" . implode( "','", $skip_statuses ) . "')"; |
|
5630 | + if (!empty($skip_statuses) && is_array($skip_statuses)) { |
|
5631 | + $where_statuses = "AND `".$wpdb->posts."`.`post_status` NOT IN('".implode("','", $skip_statuses)."')"; |
|
5632 | 5632 | } |
5633 | 5633 | |
5634 | - $query = "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; |
|
5634 | + $query = "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; |
|
5635 | 5635 | /** |
5636 | 5636 | * Modify returned posts SQL query for the current post type. |
5637 | 5637 | * |
@@ -5641,9 +5641,9 @@ discard block |
||
5641 | 5641 | * @param int $query The SQL query. |
5642 | 5642 | * @param string $post_type Post type. |
5643 | 5643 | */ |
5644 | - $query = apply_filters( 'geodir_imex_export_posts_query', $query, $post_type ); |
|
5644 | + $query = apply_filters('geodir_imex_export_posts_query', $query, $post_type); |
|
5645 | 5645 | |
5646 | - $results = (array)$wpdb->get_results( $wpdb->prepare( $query, $post_type ), ARRAY_A ); |
|
5646 | + $results = (array) $wpdb->get_results($wpdb->prepare($query, $post_type), ARRAY_A); |
|
5647 | 5647 | |
5648 | 5648 | /** |
5649 | 5649 | * Modify returned post results for the current post type. |
@@ -5654,7 +5654,7 @@ discard block |
||
5654 | 5654 | * @param object $results An object containing all post ids. |
5655 | 5655 | * @param string $post_type Post type. |
5656 | 5656 | */ |
5657 | - return apply_filters( 'geodir_export_posts', $results, $post_type ); |
|
5657 | + return apply_filters('geodir_export_posts', $results, $post_type); |
|
5658 | 5658 | } |
5659 | 5659 | |
5660 | 5660 | /** |
@@ -5671,21 +5671,21 @@ discard block |
||
5671 | 5671 | * @param string $post_type Post type. |
5672 | 5672 | * @return string The SQL query. |
5673 | 5673 | */ |
5674 | -function geodir_imex_get_events_query( $query, $post_type ) { |
|
5675 | - if ( $post_type == 'gd_event' ) { |
|
5674 | +function geodir_imex_get_events_query($query, $post_type) { |
|
5675 | + if ($post_type == 'gd_event') { |
|
5676 | 5676 | global $wpdb, $plugin_prefix; |
5677 | 5677 | |
5678 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
5678 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
5679 | 5679 | $schedule_table = EVENT_SCHEDULE; |
5680 | 5680 | |
5681 | 5681 | // Skip listing with statuses trash, auto-draft etc... |
5682 | 5682 | $skip_statuses = geodir_imex_export_skip_statuses(); |
5683 | 5683 | $where_statuses = ''; |
5684 | - if ( !empty( $skip_statuses ) && is_array( $skip_statuses ) ) { |
|
5685 | - $where_statuses = "AND `" . $wpdb->posts . "`.`post_status` NOT IN('" . implode( "','", $skip_statuses ) . "')"; |
|
5684 | + if (!empty($skip_statuses) && is_array($skip_statuses)) { |
|
5685 | + $where_statuses = "AND `".$wpdb->posts."`.`post_status` NOT IN('".implode("','", $skip_statuses)."')"; |
|
5686 | 5686 | } |
5687 | 5687 | |
5688 | - $query = "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"; |
|
5688 | + $query = "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"; |
|
5689 | 5689 | } |
5690 | 5690 | |
5691 | 5691 | return $query; |
@@ -5709,35 +5709,35 @@ discard block |
||
5709 | 5709 | * @param string $post_type Post type. |
5710 | 5710 | * @return int Total terms count. |
5711 | 5711 | */ |
5712 | -function geodir_get_terms_count( $post_type ) { |
|
5713 | - $args = array( 'hide_empty' => 0 ); |
|
5712 | +function geodir_get_terms_count($post_type) { |
|
5713 | + $args = array('hide_empty' => 0); |
|
5714 | 5714 | |
5715 | - remove_all_filters( 'get_terms' ); |
|
5715 | + remove_all_filters('get_terms'); |
|
5716 | 5716 | |
5717 | - $taxonomy = $post_type . 'category'; |
|
5717 | + $taxonomy = $post_type.'category'; |
|
5718 | 5718 | |
5719 | 5719 | // WPML |
5720 | 5720 | $is_wpml = geodir_is_wpml(); |
5721 | 5721 | $active_lang = 'all'; |
5722 | - if ( $is_wpml ) { |
|
5722 | + if ($is_wpml) { |
|
5723 | 5723 | global $sitepress; |
5724 | 5724 | $active_lang = $sitepress->get_current_language(); |
5725 | 5725 | |
5726 | - if ( $active_lang != 'all' ) { |
|
5727 | - $sitepress->switch_lang( 'all', true ); |
|
5726 | + if ($active_lang != 'all') { |
|
5727 | + $sitepress->switch_lang('all', true); |
|
5728 | 5728 | } |
5729 | 5729 | } |
5730 | 5730 | // WPML |
5731 | 5731 | |
5732 | - $count_terms = wp_count_terms( $taxonomy, $args ); |
|
5732 | + $count_terms = wp_count_terms($taxonomy, $args); |
|
5733 | 5733 | |
5734 | 5734 | // WPML |
5735 | - if ( $is_wpml && $active_lang !== 'all' ) { |
|
5735 | + if ($is_wpml && $active_lang !== 'all') { |
|
5736 | 5736 | global $sitepress; |
5737 | - $sitepress->switch_lang( $active_lang, true ); |
|
5737 | + $sitepress->switch_lang($active_lang, true); |
|
5738 | 5738 | } |
5739 | 5739 | // WPML |
5740 | - $count_terms = !is_wp_error( $count_terms ) ? $count_terms : 0; |
|
5740 | + $count_terms = !is_wp_error($count_terms) ? $count_terms : 0; |
|
5741 | 5741 | |
5742 | 5742 | return $count_terms; |
5743 | 5743 | } |
@@ -5754,23 +5754,23 @@ discard block |
||
5754 | 5754 | * @param int $page_no Page number. Default 0. |
5755 | 5755 | * @return array Array of terms data. |
5756 | 5756 | */ |
5757 | -function geodir_imex_get_terms( $post_type, $per_page = 0, $page_no = 0 ) { |
|
5758 | - $args = array( 'hide_empty' => 0, 'orderby' => 'id' ); |
|
5757 | +function geodir_imex_get_terms($post_type, $per_page = 0, $page_no = 0) { |
|
5758 | + $args = array('hide_empty' => 0, 'orderby' => 'id'); |
|
5759 | 5759 | |
5760 | - remove_all_filters( 'get_terms' ); |
|
5760 | + remove_all_filters('get_terms'); |
|
5761 | 5761 | |
5762 | - $taxonomy = $post_type . 'category'; |
|
5762 | + $taxonomy = $post_type.'category'; |
|
5763 | 5763 | |
5764 | - if ( $per_page > 0 && $page_no > 0 ) { |
|
5765 | - $args['offset'] = ( $page_no - 1 ) * $per_page; |
|
5764 | + if ($per_page > 0 && $page_no > 0) { |
|
5765 | + $args['offset'] = ($page_no - 1) * $per_page; |
|
5766 | 5766 | $args['number'] = $per_page; |
5767 | 5767 | } |
5768 | 5768 | |
5769 | - $terms = get_terms( $taxonomy, $args ); |
|
5769 | + $terms = get_terms($taxonomy, $args); |
|
5770 | 5770 | |
5771 | 5771 | $csv_rows = array(); |
5772 | 5772 | |
5773 | - if ( !empty( $terms ) ) { |
|
5773 | + if (!empty($terms)) { |
|
5774 | 5774 | $csv_row = array(); |
5775 | 5775 | $csv_row[] = 'cat_id'; |
5776 | 5776 | $csv_row[] = 'cat_name'; |
@@ -5792,16 +5792,16 @@ discard block |
||
5792 | 5792 | |
5793 | 5793 | $csv_rows[] = $csv_row; |
5794 | 5794 | |
5795 | - foreach ( $terms as $term ) { |
|
5796 | - $cat_icon = get_tax_meta( $term->term_id, 'ct_cat_icon', false, $post_type ); |
|
5797 | - $cat_icon = !empty( $cat_icon ) && isset( $cat_icon['src'] ) ? $cat_icon['src'] : ''; |
|
5795 | + foreach ($terms as $term) { |
|
5796 | + $cat_icon = get_tax_meta($term->term_id, 'ct_cat_icon', false, $post_type); |
|
5797 | + $cat_icon = !empty($cat_icon) && isset($cat_icon['src']) ? $cat_icon['src'] : ''; |
|
5798 | 5798 | |
5799 | - $cat_image = geodir_get_default_catimage( $term->term_id, $post_type ); |
|
5800 | - $cat_image = !empty( $cat_image ) && isset( $cat_image['src'] ) ? $cat_image['src'] : ''; |
|
5799 | + $cat_image = geodir_get_default_catimage($term->term_id, $post_type); |
|
5800 | + $cat_image = !empty($cat_image) && isset($cat_image['src']) ? $cat_image['src'] : ''; |
|
5801 | 5801 | |
5802 | 5802 | $cat_parent = ''; |
5803 | - if (isset($term->parent) && (int)$term->parent > 0 && term_exists((int)$term->parent, $taxonomy)) { |
|
5804 | - $parent_term = (array)get_term_by( 'id', (int)$term->parent, $taxonomy ); |
|
5803 | + if (isset($term->parent) && (int) $term->parent > 0 && term_exists((int) $term->parent, $taxonomy)) { |
|
5804 | + $parent_term = (array) get_term_by('id', (int) $term->parent, $taxonomy); |
|
5805 | 5805 | $cat_parent = !empty($parent_term) && isset($parent_term['name']) ? $parent_term['name'] : ''; |
5806 | 5806 | } |
5807 | 5807 | |
@@ -5811,15 +5811,15 @@ discard block |
||
5811 | 5811 | $csv_row[] = $term->slug; |
5812 | 5812 | $csv_row[] = $post_type; |
5813 | 5813 | $csv_row[] = $cat_parent; |
5814 | - $csv_row[] = get_tax_meta( $term->term_id, 'ct_cat_schema', false, $post_type ); |
|
5814 | + $csv_row[] = get_tax_meta($term->term_id, 'ct_cat_schema', false, $post_type); |
|
5815 | 5815 | // WPML |
5816 | 5816 | if ($is_wpml) { |
5817 | - $csv_row[] = geodir_get_language_for_element( $term->term_id, 'tax_' . $taxonomy ); |
|
5818 | - $csv_row[] = geodir_imex_original_post_id( $term->term_id, 'tax_' . $taxonomy ); |
|
5817 | + $csv_row[] = geodir_get_language_for_element($term->term_id, 'tax_'.$taxonomy); |
|
5818 | + $csv_row[] = geodir_imex_original_post_id($term->term_id, 'tax_'.$taxonomy); |
|
5819 | 5819 | } |
5820 | 5820 | // WPML |
5821 | 5821 | $csv_row[] = $term->description; |
5822 | - $csv_row[] = get_tax_meta( $term->term_id, 'ct_cat_top_desc', false, $post_type ); |
|
5822 | + $csv_row[] = get_tax_meta($term->term_id, 'ct_cat_top_desc', false, $post_type); |
|
5823 | 5823 | $csv_row[] = $cat_image; |
5824 | 5824 | $csv_row[] = $cat_icon; |
5825 | 5825 | |
@@ -5838,10 +5838,10 @@ discard block |
||
5838 | 5838 | * @param bool $relative True for relative path & False for absolute path. |
5839 | 5839 | * @return string Path to the cache directory. |
5840 | 5840 | */ |
5841 | -function geodir_path_import_export( $relative = true ) { |
|
5841 | +function geodir_path_import_export($relative = true) { |
|
5842 | 5842 | $upload_dir = wp_upload_dir(); |
5843 | 5843 | |
5844 | - return $relative ? $upload_dir['baseurl'] . '/cache' : $upload_dir['basedir'] . '/cache'; |
|
5844 | + return $relative ? $upload_dir['baseurl'].'/cache' : $upload_dir['basedir'].'/cache'; |
|
5845 | 5845 | } |
5846 | 5846 | |
5847 | 5847 | /** |
@@ -5857,8 +5857,8 @@ discard block |
||
5857 | 5857 | * @param bool $clear If true then it overwrite data otherwise add rows at the end of file. |
5858 | 5858 | * @return bool true if success otherwise false. |
5859 | 5859 | */ |
5860 | -function geodir_save_csv_data( $file_path, $csv_data = array(), $clear = true ) { |
|
5861 | - if ( empty( $csv_data ) ) { |
|
5860 | +function geodir_save_csv_data($file_path, $csv_data = array(), $clear = true) { |
|
5861 | + if (empty($csv_data)) { |
|
5862 | 5862 | return false; |
5863 | 5863 | } |
5864 | 5864 | |
@@ -5866,17 +5866,17 @@ discard block |
||
5866 | 5866 | |
5867 | 5867 | $mode = $clear ? 'w+' : 'a+'; |
5868 | 5868 | |
5869 | - if ( function_exists( 'fputcsv' ) ) { |
|
5870 | - $file = fopen( $file_path, $mode ); |
|
5871 | - foreach( $csv_data as $csv_row ) { |
|
5869 | + if (function_exists('fputcsv')) { |
|
5870 | + $file = fopen($file_path, $mode); |
|
5871 | + foreach ($csv_data as $csv_row) { |
|
5872 | 5872 | //$csv_row = array_map( 'utf8_decode', $csv_row ); |
5873 | - $write_successful = fputcsv( $file, $csv_row, ",", $enclosure = '"' ); |
|
5873 | + $write_successful = fputcsv($file, $csv_row, ",", $enclosure = '"'); |
|
5874 | 5874 | } |
5875 | - fclose( $file ); |
|
5875 | + fclose($file); |
|
5876 | 5876 | } else { |
5877 | - foreach( $csv_data as $csv_row ) { |
|
5877 | + foreach ($csv_data as $csv_row) { |
|
5878 | 5878 | //$csv_row = array_map( 'utf8_decode', $csv_row ); |
5879 | - $wp_filesystem->put_contents( $file_path, $csv_row ); |
|
5879 | + $wp_filesystem->put_contents($file_path, $csv_row); |
|
5880 | 5880 | } |
5881 | 5881 | } |
5882 | 5882 | |
@@ -5894,14 +5894,14 @@ discard block |
||
5894 | 5894 | * @param string $file Full path to file. |
5895 | 5895 | * @return int No of file rows. |
5896 | 5896 | */ |
5897 | -function geodir_import_export_line_count( $file ) { |
|
5897 | +function geodir_import_export_line_count($file) { |
|
5898 | 5898 | global $wp_filesystem; |
5899 | 5899 | |
5900 | - if ( $wp_filesystem->is_file( $file ) && $wp_filesystem->exists( $file ) ) { |
|
5901 | - $contents = $wp_filesystem->get_contents_array( $file ); |
|
5900 | + if ($wp_filesystem->is_file($file) && $wp_filesystem->exists($file)) { |
|
5901 | + $contents = $wp_filesystem->get_contents_array($file); |
|
5902 | 5902 | |
5903 | - if ( !empty( $contents ) && is_array( $contents ) ) { |
|
5904 | - return count( $contents ) - 1; |
|
5903 | + if (!empty($contents) && is_array($contents)) { |
|
5904 | + return count($contents) - 1; |
|
5905 | 5905 | } |
5906 | 5906 | } |
5907 | 5907 | |
@@ -5918,11 +5918,11 @@ discard block |
||
5918 | 5918 | * @param string $post_type The post type. |
5919 | 5919 | * @return object Queried object. |
5920 | 5920 | */ |
5921 | -function geodir_imex_get_custom_fields( $post_type ) { |
|
5921 | +function geodir_imex_get_custom_fields($post_type) { |
|
5922 | 5922 | global $wpdb; |
5923 | 5923 | |
5924 | - $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 ) ); |
|
5925 | - $rows = $wpdb->get_results( $sql ); |
|
5924 | + $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)); |
|
5925 | + $rows = $wpdb->get_results($sql); |
|
5926 | 5926 | |
5927 | 5927 | return $rows; |
5928 | 5928 | } |
@@ -6001,14 +6001,14 @@ discard block |
||
6001 | 6001 | global $wpdb, $plugin_prefix; |
6002 | 6002 | |
6003 | 6003 | $post_type = get_post_type($master_post_id); |
6004 | - $post_table = $plugin_prefix . $post_type . '_detail'; |
|
6004 | + $post_table = $plugin_prefix.$post_type.'_detail'; |
|
6005 | 6005 | |
6006 | - $query = $wpdb->prepare("SELECT * FROM " . $post_table . " WHERE post_id = %d", array($master_post_id)); |
|
6007 | - $data = (array)$wpdb->get_row($query); |
|
6006 | + $query = $wpdb->prepare("SELECT * FROM ".$post_table." WHERE post_id = %d", array($master_post_id)); |
|
6007 | + $data = (array) $wpdb->get_row($query); |
|
6008 | 6008 | |
6009 | - if ( !empty( $data ) ) { |
|
6009 | + if (!empty($data)) { |
|
6010 | 6010 | $data['post_id'] = $tr_post_id; |
6011 | - unset($data['default_category'], $data['marker_json'], $data['featured_image'], $data[$post_type . 'category'], $data['overall_rating'], $data['rating_count'], $data['ratings']); |
|
6011 | + unset($data['default_category'], $data['marker_json'], $data['featured_image'], $data[$post_type.'category'], $data['overall_rating'], $data['rating_count'], $data['ratings']); |
|
6012 | 6012 | |
6013 | 6013 | $wpdb->update($post_table, $data, array('post_id' => $tr_post_id)); |
6014 | 6014 | return true; |
@@ -6034,7 +6034,7 @@ discard block |
||
6034 | 6034 | global $sitepress, $wpdb; |
6035 | 6035 | $post_type = get_post_type($master_post_id); |
6036 | 6036 | |
6037 | - remove_filter('get_term', array($sitepress,'get_term_adjust_id')); // AVOID filtering to current language |
|
6037 | + remove_filter('get_term', array($sitepress, 'get_term_adjust_id')); // AVOID filtering to current language |
|
6038 | 6038 | |
6039 | 6039 | $taxonomies = get_object_taxonomies($post_type); |
6040 | 6040 | foreach ($taxonomies as $taxonomy) { |
@@ -6043,9 +6043,9 @@ discard block |
||
6043 | 6043 | |
6044 | 6044 | if ($terms) { |
6045 | 6045 | foreach ($terms as $term) { |
6046 | - $tr_id = apply_filters( 'translate_object_id',$term->term_id, $taxonomy, false, $lang); |
|
6046 | + $tr_id = apply_filters('translate_object_id', $term->term_id, $taxonomy, false, $lang); |
|
6047 | 6047 | |
6048 | - if (!is_null($tr_id)){ |
|
6048 | + if (!is_null($tr_id)) { |
|
6049 | 6049 | // not using get_term - unfiltered get_term |
6050 | 6050 | $translated_term = $wpdb->get_row($wpdb->prepare(" |
6051 | 6051 | 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)); |
@@ -6054,14 +6054,14 @@ discard block |
||
6054 | 6054 | } |
6055 | 6055 | } |
6056 | 6056 | |
6057 | - if (!is_taxonomy_hierarchical($taxonomy)){ |
|
6058 | - $terms_array = array_unique( array_map( 'intval', $terms_array ) ); |
|
6057 | + if (!is_taxonomy_hierarchical($taxonomy)) { |
|
6058 | + $terms_array = array_unique(array_map('intval', $terms_array)); |
|
6059 | 6059 | } |
6060 | 6060 | |
6061 | 6061 | wp_set_post_terms($tr_post_id, $terms_array, $taxonomy); |
6062 | 6062 | |
6063 | - if ($taxonomy == $post_type . 'category') { |
|
6064 | - geodir_set_postcat_structure($tr_post_id, $post_type . 'category'); |
|
6063 | + if ($taxonomy == $post_type.'category') { |
|
6064 | + geodir_set_postcat_structure($tr_post_id, $post_type.'category'); |
|
6065 | 6065 | } |
6066 | 6066 | } |
6067 | 6067 | } |
@@ -6082,15 +6082,15 @@ discard block |
||
6082 | 6082 | function geodir_icl_duplicate_post_images($master_post_id, $tr_post_id, $lang) { |
6083 | 6083 | global $wpdb; |
6084 | 6084 | |
6085 | - $query = $wpdb->prepare("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE mime_type like %s AND post_id = %d", array('%image%', $tr_post_id)); |
|
6085 | + $query = $wpdb->prepare("DELETE FROM ".GEODIR_ATTACHMENT_TABLE." WHERE mime_type like %s AND post_id = %d", array('%image%', $tr_post_id)); |
|
6086 | 6086 | $wpdb->query($query); |
6087 | 6087 | |
6088 | - $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)); |
|
6088 | + $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)); |
|
6089 | 6089 | $post_images = $wpdb->get_results($query); |
6090 | 6090 | |
6091 | - if ( !empty( $post_images ) ) { |
|
6092 | - foreach ( $post_images as $post_image) { |
|
6093 | - $image_data = (array)$post_image; |
|
6091 | + if (!empty($post_images)) { |
|
6092 | + foreach ($post_images as $post_image) { |
|
6093 | + $image_data = (array) $post_image; |
|
6094 | 6094 | unset($image_data['ID']); |
6095 | 6095 | $image_data['post_id'] = $tr_post_id; |
6096 | 6096 | |
@@ -6116,10 +6116,10 @@ discard block |
||
6116 | 6116 | * @return array Event data array. |
6117 | 6117 | */ |
6118 | 6118 | function geodir_imex_get_event_data($post, $gd_post_info) { |
6119 | - $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'] ) ) : ''; |
|
6119 | + $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'])) : ''; |
|
6120 | 6120 | $event_enddate = $event_date; |
6121 | - $starttime = isset( $post['starttime'] ) && $post['starttime'] != '' && $post['starttime'] != '00:00:00' ? date_i18n( 'H:i', strtotime( $post['starttime'] ) ) : ''; |
|
6122 | - $endtime = isset( $post['endtime'] ) && $post['endtime'] != '' && $post['endtime'] != '00:00:00' ? date_i18n( 'H:i', strtotime( $post['endtime'] ) ) : ''; |
|
6121 | + $starttime = isset($post['starttime']) && $post['starttime'] != '' && $post['starttime'] != '00:00:00' ? date_i18n('H:i', strtotime($post['starttime'])) : ''; |
|
6122 | + $endtime = isset($post['endtime']) && $post['endtime'] != '' && $post['endtime'] != '00:00:00' ? date_i18n('H:i', strtotime($post['endtime'])) : ''; |
|
6123 | 6123 | |
6124 | 6124 | $is_recurring_event = ''; |
6125 | 6125 | $event_duration_days = ''; |
@@ -6136,15 +6136,15 @@ discard block |
||
6136 | 6136 | |
6137 | 6137 | $recurring_data = isset($gd_post_info->recurring_dates) ? maybe_unserialize($gd_post_info->recurring_dates) : array(); |
6138 | 6138 | if (!empty($recurring_data)) { |
6139 | - $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; |
|
6140 | - $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; |
|
6141 | - $starttime = isset( $recurring_data['starttime'] ) && $recurring_data['starttime'] != '' && $recurring_data['starttime'] != '00:00:00' ? date_i18n( 'H:i', strtotime( $recurring_data['starttime'] ) ) : $starttime; |
|
6142 | - $endtime = isset( $recurring_data['endtime'] ) && $recurring_data['endtime'] != '' && $recurring_data['endtime'] != '00:00:00' ? date_i18n( 'H:i', strtotime( $recurring_data['endtime'] ) ) : $endtime; |
|
6139 | + $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; |
|
6140 | + $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; |
|
6141 | + $starttime = isset($recurring_data['starttime']) && $recurring_data['starttime'] != '' && $recurring_data['starttime'] != '00:00:00' ? date_i18n('H:i', strtotime($recurring_data['starttime'])) : $starttime; |
|
6142 | + $endtime = isset($recurring_data['endtime']) && $recurring_data['endtime'] != '' && $recurring_data['endtime'] != '00:00:00' ? date_i18n('H:i', strtotime($recurring_data['endtime'])) : $endtime; |
|
6143 | 6143 | $is_whole_day_event = !empty($recurring_data['all_day']) ? 1 : ''; |
6144 | 6144 | $different_times = !empty($recurring_data['different_times']) ? true : false; |
6145 | 6145 | |
6146 | - $recurring_pkg = geodir_event_recurring_pkg( $gd_post_info ); |
|
6147 | - $is_recurring = isset( $gd_post_info->is_recurring ) && (int)$gd_post_info->is_recurring == 0 ? false : true; |
|
6146 | + $recurring_pkg = geodir_event_recurring_pkg($gd_post_info); |
|
6147 | + $is_recurring = isset($gd_post_info->is_recurring) && (int) $gd_post_info->is_recurring == 0 ? false : true; |
|
6148 | 6148 | |
6149 | 6149 | if ($recurring_pkg && $is_recurring) { |
6150 | 6150 | $recurring_dates = $event_date; |
@@ -6154,13 +6154,13 @@ discard block |
||
6154 | 6154 | $recurring_type = !empty($recurring_data['repeat_type']) && in_array($recurring_data['repeat_type'], array('day', 'week', 'month', 'year', 'custom')) ? $recurring_data['repeat_type'] : 'custom'; |
6155 | 6155 | |
6156 | 6156 | if (!empty($recurring_data['event_recurring_dates'])) { |
6157 | - $event_recurring_dates = explode( ',', $recurring_data['event_recurring_dates'] ); |
|
6157 | + $event_recurring_dates = explode(',', $recurring_data['event_recurring_dates']); |
|
6158 | 6158 | |
6159 | 6159 | if (!empty($event_recurring_dates)) { |
6160 | 6160 | $recurring_dates = array(); |
6161 | 6161 | |
6162 | 6162 | foreach ($event_recurring_dates as $date) { |
6163 | - $recurring_dates[] = date_i18n( 'd/m/Y', strtotime( $date ) ); |
|
6163 | + $recurring_dates[] = date_i18n('d/m/Y', strtotime($date)); |
|
6164 | 6164 | } |
6165 | 6165 | |
6166 | 6166 | $recurring_dates = implode(",", $recurring_dates); |
@@ -6176,7 +6176,7 @@ discard block |
||
6176 | 6176 | $times = array(); |
6177 | 6177 | |
6178 | 6178 | foreach ($recurring_data['starttimes'] as $time) { |
6179 | - $times[] = $time != '00:00:00' ? date_i18n( 'H:i', strtotime( $time ) ) : '00:00'; |
|
6179 | + $times[] = $time != '00:00:00' ? date_i18n('H:i', strtotime($time)) : '00:00'; |
|
6180 | 6180 | } |
6181 | 6181 | |
6182 | 6182 | $event_starttimes = implode(",", $times); |
@@ -6186,7 +6186,7 @@ discard block |
||
6186 | 6186 | $times = array(); |
6187 | 6187 | |
6188 | 6188 | foreach ($recurring_data['endtimes'] as $time) { |
6189 | - $times[] = $time != '00:00:00' ? date_i18n( 'H:i', strtotime( $time ) ) : '00:00'; |
|
6189 | + $times[] = $time != '00:00:00' ? date_i18n('H:i', strtotime($time)) : '00:00'; |
|
6190 | 6190 | } |
6191 | 6191 | |
6192 | 6192 | $event_endtimes = implode(",", $times); |
@@ -6198,8 +6198,8 @@ discard block |
||
6198 | 6198 | } |
6199 | 6199 | } |
6200 | 6200 | } else { |
6201 | - $event_duration_days = isset($recurring_data['duration_x']) ? (int)$recurring_data['duration_x'] : 1; |
|
6202 | - $recurring_interval = !empty($recurring_data['repeat_x']) && (int)$recurring_data['repeat_x'] > 0 ? $recurring_data['repeat_x'] : 1; |
|
6201 | + $event_duration_days = isset($recurring_data['duration_x']) ? (int) $recurring_data['duration_x'] : 1; |
|
6202 | + $recurring_interval = !empty($recurring_data['repeat_x']) && (int) $recurring_data['repeat_x'] > 0 ? $recurring_data['repeat_x'] : 1; |
|
6203 | 6203 | |
6204 | 6204 | if (($recurring_type == 'week' || $recurring_type == 'month') && !empty($recurring_data['repeat_days'])) { |
6205 | 6205 | $week_days = array('Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'); |
@@ -6215,11 +6215,11 @@ discard block |
||
6215 | 6215 | } |
6216 | 6216 | |
6217 | 6217 | $recurring_week_nos = $recurring_type == 'month' && !empty($recurring_data['repeat_weeks']) ? implode(",", $recurring_data['repeat_weeks']) : $recurring_week_nos; |
6218 | - if (!empty($recurring_data['repeat_end_type']) && (int)$recurring_data['repeat_end_type'] == 1) { |
|
6219 | - $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'] ) ) : ''; |
|
6218 | + if (!empty($recurring_data['repeat_end_type']) && (int) $recurring_data['repeat_end_type'] == 1) { |
|
6219 | + $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'])) : ''; |
|
6220 | 6220 | $max_recurring_count = empty($recurring_end_date) ? 1 : ''; |
6221 | 6221 | } else { |
6222 | - $max_recurring_count = (!empty($recurring_data['max_repeat']) && (int)$recurring_data['max_repeat'] > 0 ? (int)$recurring_data['max_repeat'] : 1); |
|
6222 | + $max_recurring_count = (!empty($recurring_data['max_repeat']) && (int) $recurring_data['max_repeat'] > 0 ? (int) $recurring_data['max_repeat'] : 1); |
|
6223 | 6223 | } |
6224 | 6224 | } |
6225 | 6225 | } |
@@ -6283,9 +6283,9 @@ discard block |
||
6283 | 6283 | * @return array Event data array. |
6284 | 6284 | */ |
6285 | 6285 | function geodir_imex_process_event_data($gd_post) { |
6286 | - $recurring_pkg = geodir_event_recurring_pkg( (object)$gd_post ); |
|
6286 | + $recurring_pkg = geodir_event_recurring_pkg((object) $gd_post); |
|
6287 | 6287 | |
6288 | - $is_recurring = isset( $gd_post['is_recurring_event'] ) && (int)$gd_post['is_recurring_event'] == 0 ? false : true; |
|
6288 | + $is_recurring = isset($gd_post['is_recurring_event']) && (int) $gd_post['is_recurring_event'] == 0 ? false : true; |
|
6289 | 6289 | $event_date = isset($gd_post['event_date']) && $gd_post['event_date'] != '' ? geodir_imex_get_date_ymd($gd_post['event_date']) : ''; |
6290 | 6290 | $event_enddate = isset($gd_post['event_enddate']) && $gd_post['event_enddate'] != '' ? geodir_imex_get_date_ymd($gd_post['event_enddate']) : $event_date; |
6291 | 6291 | $all_day = isset($gd_post['is_whole_day_event']) && !empty($gd_post['is_whole_day_event']) ? true : false; |
@@ -6332,17 +6332,17 @@ discard block |
||
6332 | 6332 | $event_recurring_dates = implode(",", $event_recurring_dates); |
6333 | 6333 | } |
6334 | 6334 | } else { |
6335 | - $duration_x = !empty( $gd_post['event_duration_days'] ) ? (int)$gd_post['event_duration_days'] : 1; |
|
6336 | - $repeat_x = !empty( $gd_post['recurring_interval'] ) ? (int)$gd_post['recurring_interval'] : 1; |
|
6337 | - $max_repeat = !empty( $gd_post['max_recurring_count'] ) ? (int)$gd_post['max_recurring_count'] : 1; |
|
6338 | - $repeat_end = !empty( $gd_post['recurring_end_date'] ) ? geodir_imex_get_date_ymd($gd_post['recurring_end_date']) : ''; |
|
6335 | + $duration_x = !empty($gd_post['event_duration_days']) ? (int) $gd_post['event_duration_days'] : 1; |
|
6336 | + $repeat_x = !empty($gd_post['recurring_interval']) ? (int) $gd_post['recurring_interval'] : 1; |
|
6337 | + $max_repeat = !empty($gd_post['max_recurring_count']) ? (int) $gd_post['max_recurring_count'] : 1; |
|
6338 | + $repeat_end = !empty($gd_post['recurring_end_date']) ? geodir_imex_get_date_ymd($gd_post['recurring_end_date']) : ''; |
|
6339 | 6339 | |
6340 | 6340 | $repeat_end_type = $repeat_end != '' ? 1 : 0; |
6341 | 6341 | $max_repeat = $repeat_end != '' ? '' : $max_repeat; |
6342 | 6342 | |
6343 | 6343 | $week_days = array_flip(array('sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat')); |
6344 | 6344 | |
6345 | - $a_repeat_days = isset($gd_post['recurring_week_days']) && trim($gd_post['recurring_week_days'])!='' ? explode(',', trim($gd_post['recurring_week_days'])) : array(); |
|
6345 | + $a_repeat_days = isset($gd_post['recurring_week_days']) && trim($gd_post['recurring_week_days']) != '' ? explode(',', trim($gd_post['recurring_week_days'])) : array(); |
|
6346 | 6346 | $repeat_days = array(); |
6347 | 6347 | if (!empty($a_repeat_days)) { |
6348 | 6348 | foreach ($a_repeat_days as $repeat_day) { |
@@ -6360,7 +6360,7 @@ discard block |
||
6360 | 6360 | $repeat_weeks = array(); |
6361 | 6361 | if (!empty($a_repeat_weeks)) { |
6362 | 6362 | foreach ($a_repeat_weeks as $repeat_week) { |
6363 | - $repeat_weeks[] = (int)$repeat_week; |
|
6363 | + $repeat_weeks[] = (int) $repeat_week; |
|
6364 | 6364 | } |
6365 | 6365 | |
6366 | 6366 | $repeat_weeks = array_unique($repeat_weeks); |
@@ -6424,7 +6424,7 @@ discard block |
||
6424 | 6424 | |
6425 | 6425 | $page_found = $wpdb->get_var( |
6426 | 6426 | $wpdb->prepare( |
6427 | - "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s LIMIT 1;", |
|
6427 | + "SELECT ID FROM ".$wpdb->posts." WHERE post_name = %s LIMIT 1;", |
|
6428 | 6428 | array($slug) |
6429 | 6429 | ) |
6430 | 6430 | ); |
@@ -6479,7 +6479,7 @@ discard block |
||
6479 | 6479 | */ |
6480 | 6480 | function geodir_admin_upgrade_notice() { |
6481 | 6481 | $class = "error"; |
6482 | - $message = __("Please update core GeoDirectory or some addons may not function correctly.","geodirectory"); |
|
6482 | + $message = __("Please update core GeoDirectory or some addons may not function correctly.", "geodirectory"); |
|
6483 | 6483 | echo"<div class=\"$class\"> <p>$message</p></div>"; |
6484 | 6484 | } |
6485 | 6485 | |
@@ -6491,7 +6491,7 @@ discard block |
||
6491 | 6491 | * @param (object) $r |
6492 | 6492 | * @return (string) $output |
6493 | 6493 | */ |
6494 | -function geodire_admin_upgrade_notice( $plugin_data, $r ) |
|
6494 | +function geodire_admin_upgrade_notice($plugin_data, $r) |
|
6495 | 6495 | { |
6496 | 6496 | // readme contents |
6497 | 6497 | $args = array( |
@@ -6499,7 +6499,7 @@ discard block |
||
6499 | 6499 | 'redirection' => 5 |
6500 | 6500 | ); |
6501 | 6501 | $url = "http://plugins.svn.wordpress.org/geodirectory/trunk/readme.txt"; |
6502 | - $data = wp_remote_get( $url, $args ); |
|
6502 | + $data = wp_remote_get($url, $args); |
|
6503 | 6503 | |
6504 | 6504 | if (!is_wp_error($data) && $data['response']['code'] == 200) { |
6505 | 6505 | |
@@ -6514,20 +6514,20 @@ discard block |
||
6514 | 6514 | function geodir_in_plugin_update_message($content) { |
6515 | 6515 | // Output Upgrade Notice |
6516 | 6516 | $matches = null; |
6517 | - $regexp = '~==\s*Upgrade Notice\s*==\s*=\s*(.*)\s*=(.*)(=\s*' . preg_quote( GEODIRECTORY_VERSION ) . '\s*=|$)~Uis'; |
|
6517 | + $regexp = '~==\s*Upgrade Notice\s*==\s*=\s*(.*)\s*=(.*)(=\s*'.preg_quote(GEODIRECTORY_VERSION).'\s*=|$)~Uis'; |
|
6518 | 6518 | $upgrade_notice = ''; |
6519 | - if ( preg_match( $regexp, $content, $matches ) ) { |
|
6520 | - if(empty($matches)){return;} |
|
6519 | + if (preg_match($regexp, $content, $matches)) { |
|
6520 | + if (empty($matches)) {return; } |
|
6521 | 6521 | |
6522 | - $version = trim( $matches[1] ); |
|
6523 | - if($version && $version>GEODIRECTORY_VERSION){ |
|
6522 | + $version = trim($matches[1]); |
|
6523 | + if ($version && $version > GEODIRECTORY_VERSION) { |
|
6524 | 6524 | |
6525 | 6525 | |
6526 | - $notices = (array) preg_split('~[\r\n]+~', trim( $matches[2] ) ); |
|
6527 | - if ( version_compare( GEODIRECTORY_VERSION, $version, '<' ) ) { |
|
6526 | + $notices = (array) preg_split('~[\r\n]+~', trim($matches[2])); |
|
6527 | + if (version_compare(GEODIRECTORY_VERSION, $version, '<')) { |
|
6528 | 6528 | $upgrade_notice .= '<div class="geodir_plugin_upgrade_notice">'; |
6529 | - foreach ( $notices as $index => $line ) { |
|
6530 | - $upgrade_notice .= wp_kses_post( preg_replace( '~\[([^\]]*)\]\(([^\)]*)\)~', '<a href="${2}">${1}</a>', $line ) ); |
|
6529 | + foreach ($notices as $index => $line) { |
|
6530 | + $upgrade_notice .= wp_kses_post(preg_replace('~\[([^\]]*)\]\(([^\)]*)\)~', '<a href="${2}">${1}</a>', $line)); |
|
6531 | 6531 | } |
6532 | 6532 | $upgrade_notice .= '</div> '; |
6533 | 6533 | } |
@@ -6551,7 +6551,7 @@ discard block |
||
6551 | 6551 | $default_language = $sitepress->get_default_language(); |
6552 | 6552 | if ($current_language != 'all' && $current_language != $default_language) { |
6553 | 6553 | ?> |
6554 | - <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> |
|
6554 | + <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> |
|
6555 | 6555 | <?php |
6556 | 6556 | } |
6557 | 6557 | } |
@@ -6566,7 +6566,7 @@ discard block |
||
6566 | 6566 | * @param array Listing statuses to be skipped. |
6567 | 6567 | */ |
6568 | 6568 | function geodir_imex_export_skip_statuses() { |
6569 | - $statuses = array( 'trash', 'auto-draft' ); |
|
6569 | + $statuses = array('trash', 'auto-draft'); |
|
6570 | 6570 | |
6571 | 6571 | /** |
6572 | 6572 | * Filter the statuses to skip during GD export listings. |
@@ -6576,7 +6576,7 @@ discard block |
||
6576 | 6576 | * |
6577 | 6577 | * @param array $statuses Listing statuses to be skipped. |
6578 | 6578 | */ |
6579 | - $statuses = apply_filters( 'geodir_imex_export_skip_statuses', $statuses ); |
|
6579 | + $statuses = apply_filters('geodir_imex_export_skip_statuses', $statuses); |
|
6580 | 6580 | |
6581 | 6581 | return $statuses; |
6582 | 6582 | } |