@@ -1,10 +1,10 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Template functions that affect the output of most GeoDirectory pages |
|
| 4 | - * |
|
| 5 | - * @since 1.0.0 |
|
| 6 | - * @package GeoDirectory |
|
| 7 | - */ |
|
| 3 | + * Template functions that affect the output of most GeoDirectory pages |
|
| 4 | + * |
|
| 5 | + * @since 1.0.0 |
|
| 6 | + * @package GeoDirectory |
|
| 7 | + */ |
|
| 8 | 8 | ############################################### |
| 9 | 9 | ########### DYNAMIC CONTENT ################### |
| 10 | 10 | ############################################### |
@@ -1002,7 +1002,7 @@ discard block |
||
| 1002 | 1002 | |
| 1003 | 1003 | if ($preview) {
|
| 1004 | 1004 | $post_images = array(); |
| 1005 | - if (isset($post->post_images) && !empty($post->post_images)) {
|
|
| 1005 | + if (isset($post->post_images) && !empty($post->post_images)) {
|
|
| 1006 | 1006 | $post->post_images = trim($post->post_images, ","); |
| 1007 | 1007 | $post_images = explode(",", $post->post_images);
|
| 1008 | 1008 | } |
@@ -1195,9 +1195,9 @@ discard block |
||
| 1195 | 1195 | } else {
|
| 1196 | 1196 | $post_term = $post->$post_taxonomy; |
| 1197 | 1197 | |
| 1198 | - if ($preview && !$is_backend_preview) {
|
|
| 1199 | - $post_term = geodir_add_parent_terms($post_term, $post_taxonomy); |
|
| 1200 | - } |
|
| 1198 | + if ($preview && !$is_backend_preview) {
|
|
| 1199 | + $post_term = geodir_add_parent_terms($post_term, $post_taxonomy); |
|
| 1200 | + } |
|
| 1201 | 1201 | } |
| 1202 | 1202 | |
| 1203 | 1203 | $post_term = array_unique($post_term); |
@@ -714,8 +714,9 @@ discard block |
||
| 714 | 714 | |
| 715 | 715 | if (isset($post->post_default_category) && $post->post_default_category == $cat_id) {
|
| 716 | 716 | if ($term_icon_url = get_tax_meta($cat_id, 'ct_cat_icon', false, $post_type)) {
|
| 717 | - if (isset($term_icon_url['src']) && $term_icon_url['src'] != '') |
|
| 718 | - $term_icon = $term_icon_url['src']; |
|
| 717 | + if (isset($term_icon_url['src']) && $term_icon_url['src'] != '') { |
|
| 718 | + $term_icon = $term_icon_url['src']; |
|
| 719 | + } |
|
| 719 | 720 | break; |
| 720 | 721 | } |
| 721 | 722 | } |
@@ -1244,8 +1245,9 @@ discard block |
||
| 1244 | 1245 | echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>'; |
| 1245 | 1246 | } |
| 1246 | 1247 | |
| 1247 | - if (isset($taxonomies[$post_type . '_tags'])) |
|
| 1248 | - echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>'; |
|
| 1248 | + if (isset($taxonomies[$post_type . '_tags'])) { |
|
| 1249 | + echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>'; |
|
| 1250 | + } |
|
| 1249 | 1251 | |
| 1250 | 1252 | ?> |
| 1251 | 1253 | </p><?php |
@@ -1596,23 +1598,21 @@ discard block |
||
| 1596 | 1598 | if(geodir_is_page('pt')){
|
| 1597 | 1599 | $gd_page = 'pt'; |
| 1598 | 1600 | $title = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
|
| 1599 | - } |
|
| 1600 | - elseif(geodir_is_page('listing')){
|
|
| 1601 | + } elseif(geodir_is_page('listing')){
|
|
| 1601 | 1602 | $gd_page = 'listing'; |
| 1602 | 1603 | global $wp_query; |
| 1603 | 1604 | $current_term = $wp_query->get_queried_object(); |
| 1604 | 1605 | if (strpos($current_term->taxonomy,'_tags') !== false) {
|
| 1605 | 1606 | $title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title;
|
| 1606 | - }else{
|
|
| 1607 | + } else{
|
|
| 1607 | 1608 | $title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title;
|
| 1608 | 1609 | } |
| 1609 | 1610 | |
| 1610 | - } |
|
| 1611 | - elseif(geodir_is_page('author')){
|
|
| 1611 | + } elseif(geodir_is_page('author')){
|
|
| 1612 | 1612 | $gd_page = 'author'; |
| 1613 | 1613 | if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
|
| 1614 | 1614 | $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
|
| 1615 | - }else{
|
|
| 1615 | + } else{
|
|
| 1616 | 1616 | $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
|
| 1617 | 1617 | } |
| 1618 | 1618 | |
@@ -2023,8 +2023,9 @@ discard block |
||
| 2023 | 2023 | */ |
| 2024 | 2024 | function geodir_action_add_listing_page_title() |
| 2025 | 2025 | {
|
| 2026 | - if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '') |
|
| 2027 | - $listing_type = $_REQUEST['listing_type']; |
|
| 2026 | + if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '') { |
|
| 2027 | + $listing_type = $_REQUEST['listing_type']; |
|
| 2028 | + } |
|
| 2028 | 2029 | /** This action is documented in geodirectory_template_actions.php */ |
| 2029 | 2030 | $class = apply_filters('geodir_page_title_class', 'entry-title fn');
|
| 2030 | 2031 | /** This action is documented in geodirectory_template_actions.php */ |
@@ -2036,7 +2037,7 @@ discard block |
||
| 2036 | 2037 | $gd_page = 'add-listing'; |
| 2037 | 2038 | if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
|
| 2038 | 2039 | $title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
|
| 2039 | - }elseif(isset($listing_type)){
|
|
| 2040 | + } elseif(isset($listing_type)){
|
|
| 2040 | 2041 | $title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
|
| 2041 | 2042 | } |
| 2042 | 2043 | |
@@ -2094,7 +2095,11 @@ discard block |
||
| 2094 | 2095 | $required_msg = ''; |
| 2095 | 2096 | $submit_button = ''; |
| 2096 | 2097 | |
| 2097 | - if (isset($_REQUEST['ajax_action'])) $ajax_action = $_REQUEST['ajax_action']; else $ajax_action = 'add'; |
|
| 2098 | + if (isset($_REQUEST['ajax_action'])) { |
|
| 2099 | + $ajax_action = $_REQUEST['ajax_action']; |
|
| 2100 | + } else { |
|
| 2101 | + $ajax_action = 'add'; |
|
| 2102 | + } |
|
| 2098 | 2103 | |
| 2099 | 2104 | $thumb_img_arr = array(); |
| 2100 | 2105 | $curImages = ''; |
@@ -2333,8 +2338,9 @@ discard block |
||
| 2333 | 2338 | $totImg = 0; |
| 2334 | 2339 | if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
|
| 2335 | 2340 | $post = (object)$gd_session->get('listing');
|
| 2336 | - if (isset($post->post_images)) |
|
| 2337 | - $curImages = trim($post->post_images, ","); |
|
| 2341 | + if (isset($post->post_images)) { |
|
| 2342 | + $curImages = trim($post->post_images, ","); |
|
| 2343 | + } |
|
| 2338 | 2344 | |
| 2339 | 2345 | |
| 2340 | 2346 | if ($curImages != '') {
|
@@ -2362,10 +2368,13 @@ discard block |
||
| 2362 | 2368 | $totImg = count((array)$thumb_img_arr); |
| 2363 | 2369 | } |
| 2364 | 2370 | |
| 2365 | - if ($curImages != '') |
|
| 2366 | - $svalue = $curImages; // this will be initial value of the above form field. Image urls. |
|
| 2367 | - else |
|
| 2368 | - $svalue = ''; |
|
| 2371 | + if ($curImages != '') { |
|
| 2372 | + $svalue = $curImages; |
|
| 2373 | + } |
|
| 2374 | + // this will be initial value of the above form field. Image urls. |
|
| 2375 | + else { |
|
| 2376 | + $svalue = ''; |
|
| 2377 | + } |
|
| 2369 | 2378 | |
| 2370 | 2379 | $image_limit = $package_info->image_limit; |
| 2371 | 2380 | $show_image_input_box = ($image_limit != '0'); |
@@ -2575,8 +2584,9 @@ discard block |
||
| 2575 | 2584 | </script><?php |
| 2576 | 2585 | |
| 2577 | 2586 | global $errors; |
| 2578 | - if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim') |
|
| 2579 | - $errors->add('claim_login', LOGIN_CLAIM);
|
|
| 2587 | + if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim') { |
|
| 2588 | + $errors->add('claim_login', LOGIN_CLAIM); |
|
| 2589 | + } |
|
| 2580 | 2590 | |
| 2581 | 2591 | if (!empty($errors)) {
|
| 2582 | 2592 | foreach ($errors as $errorsObj) {
|
@@ -2680,8 +2690,9 @@ discard block |
||
| 2680 | 2690 | |
| 2681 | 2691 | if (!empty($term)) {
|
| 2682 | 2692 | $current_term = get_term_by('slug', $term, $taxonomy[0]);
|
| 2683 | - if (!empty($current_term)) |
|
| 2684 | - $list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
|
|
| 2693 | + if (!empty($current_term)) { |
|
| 2694 | + $list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'"; |
|
| 2695 | + } |
|
| 2685 | 2696 | } |
| 2686 | 2697 | |
| 2687 | 2698 | |
@@ -2699,7 +2710,7 @@ discard block |
||
| 2699 | 2710 | $gd_page = 'author'; |
| 2700 | 2711 | if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
|
| 2701 | 2712 | $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
|
| 2702 | - }else{
|
|
| 2713 | + } else{
|
|
| 2703 | 2714 | $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
|
| 2704 | 2715 | } |
| 2705 | 2716 | |
@@ -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)) {
|
@@ -1017,7 +1017,7 @@ discard block |
||
| 1017 | 1017 | @list($width, $height) = getimagesize(trim($image)); |
| 1018 | 1018 | |
| 1019 | 1019 | if ($image && $width && $height) {
|
| 1020 | - $image = (object)array('src' => $image, 'width' => $width, 'height' => $height);
|
|
| 1020 | + $image = (object) array('src' => $image, 'width' => $width, 'height' => $height);
|
|
| 1021 | 1021 | } |
| 1022 | 1022 | |
| 1023 | 1023 | if (isset($image->src)) {
|
@@ -1050,9 +1050,9 @@ discard block |
||
| 1050 | 1050 | } else {
|
| 1051 | 1051 | $spacer_height = ((400 - $image->height) / 2); |
| 1052 | 1052 | } |
| 1053 | - $caption = '';//(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : ''; |
|
| 1053 | + $caption = ''; //(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : ''; |
|
| 1054 | 1054 | $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;" />'; |
| 1055 | - $main_slides .= '<img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:400px;margin:0 auto;" />'.$caption.'</li>'; |
|
| 1055 | + $main_slides .= '<img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:400px;margin:0 auto;" />' . $caption . '</li>'; |
|
| 1056 | 1056 | $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:48px;margin:0 auto;" /></li>'; |
| 1057 | 1057 | $slides++; |
| 1058 | 1058 | } |
@@ -1088,7 +1088,7 @@ discard block |
||
| 1088 | 1088 | */ |
| 1089 | 1089 | function geodir_action_details_taxonomies() |
| 1090 | 1090 | {
|
| 1091 | - global $preview, $post;?> |
|
| 1091 | + global $preview, $post; ?> |
|
| 1092 | 1092 | <p class="geodir_post_taxomomies clearfix"> |
| 1093 | 1093 | <?php |
| 1094 | 1094 | $taxonomies = array(); |
@@ -1166,12 +1166,12 @@ discard block |
||
| 1166 | 1166 | * @param string $tag_link The tag link html. |
| 1167 | 1167 | * @param object $term The tag term object. |
| 1168 | 1168 | */ |
| 1169 | - $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
|
|
| 1169 | + $tag_link = apply_filters('geodir_details_taxonomies_tag_link', $tag_link, $term);
|
|
| 1170 | 1170 | $links[] = $tag_link; |
| 1171 | 1171 | } else {
|
| 1172 | 1172 | $tag_link = "<a href='" . esc_attr(get_term_link($term->term_id, $term->taxonomy)) . "'>$term->name</a>"; |
| 1173 | 1173 | /** This action is documented in geodirectory-template_actions.php */ |
| 1174 | - $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
|
|
| 1174 | + $tag_link = apply_filters('geodir_details_taxonomies_tag_link', $tag_link, $term);
|
|
| 1175 | 1175 | $links[] = $tag_link; |
| 1176 | 1176 | } |
| 1177 | 1177 | $terms[] = $term; |
@@ -1181,7 +1181,7 @@ discard block |
||
| 1181 | 1181 | if (!isset($listing_label)) {
|
| 1182 | 1182 | $listing_label = ''; |
| 1183 | 1183 | } |
| 1184 | - $taxonomies[$post_type . '_tags'] = wp_sprintf('%s: %l', geodir_ucwords($listing_label . ' ' . __('Tags', 'geodirectory')), $links, (object)$terms);
|
|
| 1184 | + $taxonomies[$post_type . '_tags'] = wp_sprintf('%s: %l', geodir_ucwords($listing_label . ' ' . __('Tags', 'geodirectory')), $links, (object) $terms);
|
|
| 1185 | 1185 | endif; |
| 1186 | 1186 | |
| 1187 | 1187 | } |
@@ -1217,7 +1217,7 @@ discard block |
||
| 1217 | 1217 | * @param string $term_link The link html to the category. |
| 1218 | 1218 | * @param object $term The category term object. |
| 1219 | 1219 | */ |
| 1220 | - $term_link = apply_filters('geodir_details_taxonomies_cat_link',$term_link,$term);
|
|
| 1220 | + $term_link = apply_filters('geodir_details_taxonomies_cat_link', $term_link, $term);
|
|
| 1221 | 1221 | $links[] = $term_link; |
| 1222 | 1222 | $terms[] = $term; |
| 1223 | 1223 | } |
@@ -1235,7 +1235,7 @@ discard block |
||
| 1235 | 1235 | if (!isset($listing_label)) {
|
| 1236 | 1236 | $listing_label = ''; |
| 1237 | 1237 | } |
| 1238 | - $taxonomies[$post_taxonomy] = wp_sprintf('%s: %l', geodir_ucwords($listing_label . ' ' . __('Category', 'geodirectory')), $links, (object)$terms);
|
|
| 1238 | + $taxonomies[$post_taxonomy] = wp_sprintf('%s: %l', geodir_ucwords($listing_label . ' ' . __('Category', 'geodirectory')), $links, (object) $terms);
|
|
| 1239 | 1239 | |
| 1240 | 1240 | } |
| 1241 | 1241 | |
@@ -1266,11 +1266,11 @@ discard block |
||
| 1266 | 1266 | * @param object $post Optional. The post object or blank. |
| 1267 | 1267 | * @package GeoDirectory |
| 1268 | 1268 | */ |
| 1269 | -function geodir_action_details_micordata($post='') |
|
| 1269 | +function geodir_action_details_micordata($post = '') |
|
| 1270 | 1270 | {
|
| 1271 | 1271 | |
| 1272 | 1272 | global $preview; |
| 1273 | - if(empty($post)){global $post;}
|
|
| 1273 | + if (empty($post)) {global $post; }
|
|
| 1274 | 1274 | if ($preview || !geodir_is_page('detail')) {
|
| 1275 | 1275 | return; |
| 1276 | 1276 | } |
@@ -1291,7 +1291,7 @@ discard block |
||
| 1291 | 1291 | "description" => $review->comment_content, |
| 1292 | 1292 | "reviewRating" => array( |
| 1293 | 1293 | "@type" => "Rating", |
| 1294 | - "bestRating" => "5",// @todo this will need to be filtered for review manager if user changes the score. |
|
| 1294 | + "bestRating" => "5", // @todo this will need to be filtered for review manager if user changes the score. |
|
| 1295 | 1295 | "ratingValue" => geodir_get_commentoverall($review->comment_ID), |
| 1296 | 1296 | "worstRating" => "1" |
| 1297 | 1297 | ) |
@@ -1319,13 +1319,13 @@ discard block |
||
| 1319 | 1319 | } |
| 1320 | 1320 | //print_r($post); |
| 1321 | 1321 | // external links |
| 1322 | - $external_links = array(); |
|
| 1322 | + $external_links = array(); |
|
| 1323 | 1323 | $external_links[] = $post->geodir_website; |
| 1324 | 1324 | $external_links[] = $post->geodir_twitter; |
| 1325 | 1325 | $external_links[] = $post->geodir_facebook; |
| 1326 | 1326 | $external_links = array_filter($external_links); |
| 1327 | 1327 | |
| 1328 | - if(!empty($external_links)){
|
|
| 1328 | + if (!empty($external_links)) {
|
|
| 1329 | 1329 | $external_links = array_values($external_links); |
| 1330 | 1330 | } |
| 1331 | 1331 | |
@@ -1335,16 +1335,16 @@ discard block |
||
| 1335 | 1335 | |
| 1336 | 1336 | // schema type |
| 1337 | 1337 | $schema_type = 'LocalBusiness'; |
| 1338 | - if(isset($post->default_category) && $post->default_category){
|
|
| 1338 | + if (isset($post->default_category) && $post->default_category) {
|
|
| 1339 | 1339 | $schema_type = get_tax_meta($post->default_category, 'ct_cat_schema', false, $post->post_type); |
| 1340 | - if(!$schema_type && $post->post_type=='gd_event'){$schema_type = 'Event';}
|
|
| 1340 | + if (!$schema_type && $post->post_type == 'gd_event') {$schema_type = 'Event'; }
|
|
| 1341 | 1341 | } |
| 1342 | 1342 | |
| 1343 | 1343 | $schema = array(); |
| 1344 | 1344 | $schema['@context'] = "http://schema.org"; |
| 1345 | 1345 | $schema['@type'] = $schema_type; |
| 1346 | 1346 | $schema['name'] = $post->post_name; |
| 1347 | - $schema['description'] = wp_strip_all_tags( $post->post_content, true ); |
|
| 1347 | + $schema['description'] = wp_strip_all_tags($post->post_content, true); |
|
| 1348 | 1348 | $schema['telephone'] = $post->geodir_contact; |
| 1349 | 1349 | $schema['url'] = $c_url; |
| 1350 | 1350 | $schema['sameAs'] = $external_links; |
@@ -1358,7 +1358,7 @@ discard block |
||
| 1358 | 1358 | "postalCode" => $post->post_zip |
| 1359 | 1359 | ); |
| 1360 | 1360 | |
| 1361 | - if($post->post_latitude && $post->post_longitude) {
|
|
| 1361 | + if ($post->post_latitude && $post->post_longitude) {
|
|
| 1362 | 1362 | $schema['geo'] = array( |
| 1363 | 1363 | "@type" => "GeoCoordinates", |
| 1364 | 1364 | "latitude" => $post->post_latitude, |
@@ -1366,7 +1366,7 @@ discard block |
||
| 1366 | 1366 | ); |
| 1367 | 1367 | } |
| 1368 | 1368 | |
| 1369 | - if($post_avgratings) {
|
|
| 1369 | + if ($post_avgratings) {
|
|
| 1370 | 1370 | $schema['aggregateRating'] = array( |
| 1371 | 1371 | "@type" => "AggregateRating", |
| 1372 | 1372 | "ratingValue" => $post_avgratings, |
@@ -1385,7 +1385,7 @@ discard block |
||
| 1385 | 1385 | * @param array $schema The array of schema data to be filtered. |
| 1386 | 1386 | * @param object $post The post object. |
| 1387 | 1387 | */ |
| 1388 | - $schema = apply_filters('geodir_details_schema', $schema,$post);
|
|
| 1388 | + $schema = apply_filters('geodir_details_schema', $schema, $post);
|
|
| 1389 | 1389 | |
| 1390 | 1390 | |
| 1391 | 1391 | echo '<script type="application/ld+json">' . json_encode($schema) . '</script>'; |
@@ -1593,26 +1593,26 @@ discard block |
||
| 1593 | 1593 | |
| 1594 | 1594 | |
| 1595 | 1595 | $title = $list_title; |
| 1596 | - if(geodir_is_page('pt')){
|
|
| 1596 | + if (geodir_is_page('pt')) {
|
|
| 1597 | 1597 | $gd_page = 'pt'; |
| 1598 | - $title = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
|
|
| 1598 | + $title = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
|
|
| 1599 | 1599 | } |
| 1600 | - elseif(geodir_is_page('listing')){
|
|
| 1600 | + elseif (geodir_is_page('listing')) {
|
|
| 1601 | 1601 | $gd_page = 'listing'; |
| 1602 | 1602 | global $wp_query; |
| 1603 | 1603 | $current_term = $wp_query->get_queried_object(); |
| 1604 | - if (strpos($current_term->taxonomy,'_tags') !== false) {
|
|
| 1604 | + if (strpos($current_term->taxonomy, '_tags') !== false) {
|
|
| 1605 | 1605 | $title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title;
|
| 1606 | - }else{
|
|
| 1606 | + } else {
|
|
| 1607 | 1607 | $title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title;
|
| 1608 | 1608 | } |
| 1609 | 1609 | |
| 1610 | 1610 | } |
| 1611 | - elseif(geodir_is_page('author')){
|
|
| 1611 | + elseif (geodir_is_page('author')) {
|
|
| 1612 | 1612 | $gd_page = 'author'; |
| 1613 | - if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
|
|
| 1613 | + if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
|
|
| 1614 | 1614 | $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
|
| 1615 | - }else{
|
|
| 1615 | + } else {
|
|
| 1616 | 1616 | $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
|
| 1617 | 1617 | } |
| 1618 | 1618 | |
@@ -1626,7 +1626,7 @@ discard block |
||
| 1626 | 1626 | * @param string $title The page title including variables. |
| 1627 | 1627 | * @param string $gd_page The GeoDirectory page type if any. |
| 1628 | 1628 | */ |
| 1629 | - $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
|
|
| 1629 | + $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
|
|
| 1630 | 1630 | |
| 1631 | 1631 | echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . |
| 1632 | 1632 | /** |
@@ -1671,7 +1671,7 @@ discard block |
||
| 1671 | 1671 | if ($cat_description) {
|
| 1672 | 1672 | ?> |
| 1673 | 1673 | |
| 1674 | - <div class="term_description"><?php echo $cat_description;?></div> <?php |
|
| 1674 | + <div class="term_description"><?php echo $cat_description; ?></div> <?php |
|
| 1675 | 1675 | } |
| 1676 | 1676 | |
| 1677 | 1677 | } |
@@ -1956,7 +1956,7 @@ discard block |
||
| 1956 | 1956 | */ |
| 1957 | 1957 | do_action('geodir_main_content_open', 'listings-page', 'geodir-main-content', 'listings-page');
|
| 1958 | 1958 | $extra_class = apply_filters('geodir_before_listing_wrapper_extra_class', '', 'listings-page');
|
| 1959 | - echo '<div class="clearfix '.$extra_class.'">'; |
|
| 1959 | + echo '<div class="clearfix ' . $extra_class . '">'; |
|
| 1960 | 1960 | /** |
| 1961 | 1961 | * Called before the listings page content, inside the outer wrapper. Used on listings pages and search and author pages. |
| 1962 | 1962 | * |
@@ -2032,11 +2032,11 @@ discard block |
||
| 2032 | 2032 | |
| 2033 | 2033 | $title = apply_filters('geodir_add_listing_page_title_text', get_the_title());
|
| 2034 | 2034 | |
| 2035 | - if(geodir_is_page('add-listing')){
|
|
| 2035 | + if (geodir_is_page('add-listing')) {
|
|
| 2036 | 2036 | $gd_page = 'add-listing'; |
| 2037 | - if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
|
|
| 2037 | + if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
|
| 2038 | 2038 | $title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
|
| 2039 | - }elseif(isset($listing_type)){
|
|
| 2039 | + }elseif (isset($listing_type)) {
|
|
| 2040 | 2040 | $title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
|
| 2041 | 2041 | } |
| 2042 | 2042 | |
@@ -2050,7 +2050,7 @@ discard block |
||
| 2050 | 2050 | * @param string $title The page title including variables. |
| 2051 | 2051 | * @param string $gd_page The GeoDirectory page type if any. |
| 2052 | 2052 | */ |
| 2053 | - $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
|
|
| 2053 | + $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
|
|
| 2054 | 2054 | |
| 2055 | 2055 | echo '<header class="' . $class_header . '"><h1 class="' . $class . '">'; |
| 2056 | 2056 | echo $title; |
@@ -2066,7 +2066,7 @@ discard block |
||
| 2066 | 2066 | */ |
| 2067 | 2067 | function geodir_action_add_listing_page_mandatory() |
| 2068 | 2068 | {?>
|
| 2069 | - <p class="geodir-note "><span class="geodir-required">*</span> <?php echo INDICATES_MANDATORY_FIELDS_TEXT;?></p> |
|
| 2069 | + <p class="geodir-note "><span class="geodir-required">*</span> <?php echo INDICATES_MANDATORY_FIELDS_TEXT; ?></p> |
|
| 2070 | 2070 | <?php |
| 2071 | 2071 | } |
| 2072 | 2072 | |
@@ -2101,7 +2101,7 @@ discard block |
||
| 2101 | 2101 | |
| 2102 | 2102 | if (isset($_REQUEST['backandedit'])) {
|
| 2103 | 2103 | global $post; |
| 2104 | - $post = (object)$gd_session->get('listing');
|
|
| 2104 | + $post = (object) $gd_session->get('listing');
|
|
| 2105 | 2105 | $listing_type = $post->listing_type; |
| 2106 | 2106 | $title = $post->post_title; |
| 2107 | 2107 | $desc = $post->post_desc; |
@@ -2143,10 +2143,10 @@ discard block |
||
| 2143 | 2143 | |
| 2144 | 2144 | |
| 2145 | 2145 | ?> |
| 2146 | - <form name="propertyform" id="propertyform" action="<?php echo get_page_link(geodir_preview_page_id());?>" |
|
| 2146 | + <form name="propertyform" id="propertyform" action="<?php echo get_page_link(geodir_preview_page_id()); ?>" |
|
| 2147 | 2147 | method="post" enctype="multipart/form-data"> |
| 2148 | - <input type="hidden" name="preview" value="<?php echo sanitize_text_field($listing_type);?>"/> |
|
| 2149 | - <input type="hidden" name="listing_type" value="<?php echo sanitize_text_field($listing_type);?>"/> |
|
| 2148 | + <input type="hidden" name="preview" value="<?php echo sanitize_text_field($listing_type); ?>"/> |
|
| 2149 | + <input type="hidden" name="listing_type" value="<?php echo sanitize_text_field($listing_type); ?>"/> |
|
| 2150 | 2150 | <?php if ($page_id) { ?><input type="hidden" name="add_listing_page_id"
|
| 2151 | 2151 | value="<?php echo $page_id; ?>" /><?php }?> |
| 2152 | 2152 | <?php if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') { ?>
|
@@ -2163,9 +2163,9 @@ discard block |
||
| 2163 | 2163 | * |
| 2164 | 2164 | * @since 1.0.0 |
| 2165 | 2165 | */ |
| 2166 | - do_action('geodir_before_detail_fields');?>
|
|
| 2166 | + do_action('geodir_before_detail_fields'); ?>
|
|
| 2167 | 2167 | |
| 2168 | - <h5 id="geodir_fieldset_details" class="geodir-fieldset-row" gd-fieldset="details"><?php echo LISTING_DETAILS_TEXT;?></h5> |
|
| 2168 | + <h5 id="geodir_fieldset_details" class="geodir-fieldset-row" gd-fieldset="details"><?php echo LISTING_DETAILS_TEXT; ?></h5> |
|
| 2169 | 2169 | |
| 2170 | 2170 | <?php |
| 2171 | 2171 | /** |
@@ -2175,13 +2175,13 @@ discard block |
||
| 2175 | 2175 | * |
| 2176 | 2176 | * @since 1.0.0 |
| 2177 | 2177 | */ |
| 2178 | - do_action('geodir_before_main_form_fields');?>
|
|
| 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 | |
| 2187 | 2187 | <?php |
@@ -2226,20 +2226,20 @@ discard block |
||
| 2226 | 2226 | <div id="geodir_post_desc_row" class="<?php if ($desc_limit != '0') {
|
| 2227 | 2227 | echo 'required_field'; |
| 2228 | 2228 | }?> geodir_form_row clearfix gd-fieldset-details"> |
| 2229 | - <label><?php echo PLACE_DESC_TEXT;?><span><?php if ($desc_limit != '0') {
|
|
| 2229 | + <label><?php echo PLACE_DESC_TEXT; ?><span><?php if ($desc_limit != '0') {
|
|
| 2230 | 2230 | echo '*'; |
| 2231 | 2231 | }?></span> </label> |
| 2232 | 2232 | <?php |
| 2233 | 2233 | if (!empty($show_editor) && in_array($listing_type, $show_editor)) {
|
| 2234 | 2234 | |
| 2235 | - $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);?>
|
|
| 2235 | + $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10); ?>
|
|
| 2236 | 2236 | |
| 2237 | 2237 | <div class="editor" field_id="post_desc" field_type="editor"> |
| 2238 | 2238 | <?php wp_editor($desc, "post_desc", $editor_settings); ?> |
| 2239 | 2239 | </div> |
| 2240 | 2240 | <?php if ($desc_limit != '') { ?>
|
| 2241 | 2241 | <script |
| 2242 | - type="text/javascript">jQuery('textarea#post_desc').attr('maxlength', "<?php echo $desc_limit;?>");</script>
|
|
| 2242 | + type="text/javascript">jQuery('textarea#post_desc').attr('maxlength', "<?php echo $desc_limit; ?>");</script>
|
|
| 2243 | 2243 | <?php } ?> |
| 2244 | 2244 | <?php } else { ?>
|
| 2245 | 2245 | <textarea field_type="textarea" name="post_desc" id="post_desc" class="geodir_textarea" |
@@ -2248,7 +2248,7 @@ discard block |
||
| 2248 | 2248 | <?php if ($desc_limit_msg != '') { ?>
|
| 2249 | 2249 | <span class="geodir_message_note"><?php echo $desc_limit_msg; ?></span> |
| 2250 | 2250 | <?php } ?> |
| 2251 | - <span class="geodir_message_error"><?php echo _e($required_msg, 'geodirectory');?></span> |
|
| 2251 | + <span class="geodir_message_error"><?php echo _e($required_msg, 'geodirectory'); ?></span> |
|
| 2252 | 2252 | </div> |
| 2253 | 2253 | <?php |
| 2254 | 2254 | /** |
@@ -2298,8 +2298,8 @@ discard block |
||
| 2298 | 2298 | <div id="geodir_post_tags_row" class="geodir_form_row clearfix gd-fieldset-details"> |
| 2299 | 2299 | <label><?php echo TAGKW_TEXT; ?></label> |
| 2300 | 2300 | <input name="post_tags" id="post_tags" value="<?php echo $kw_tags; ?>" type="text" class="geodir_textfield" |
| 2301 | - maxlength="<?php echo $kw_tags_count;?>"/> |
|
| 2302 | - <span class="geodir_message_note"><?php echo $kw_tags_msg;?></span> |
|
| 2301 | + maxlength="<?php echo $kw_tags_count; ?>"/> |
|
| 2302 | + <span class="geodir_message_note"><?php echo $kw_tags_msg; ?></span> |
|
| 2303 | 2303 | </div> |
| 2304 | 2304 | <?php |
| 2305 | 2305 | /** |
@@ -2316,7 +2316,7 @@ discard block |
||
| 2316 | 2316 | |
| 2317 | 2317 | $package_info = geodir_post_package_info($package_info, $post); |
| 2318 | 2318 | |
| 2319 | - geodir_get_custom_fields_html($package_info->pid, 'all', $listing_type);?> |
|
| 2319 | + geodir_get_custom_fields_html($package_info->pid, 'all', $listing_type); ?> |
|
| 2320 | 2320 | |
| 2321 | 2321 | |
| 2322 | 2322 | <?php |
@@ -2332,7 +2332,7 @@ discard block |
||
| 2332 | 2332 | $thumb_img_arr = array(); |
| 2333 | 2333 | $totImg = 0; |
| 2334 | 2334 | if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
|
| 2335 | - $post = (object)$gd_session->get('listing');
|
|
| 2335 | + $post = (object) $gd_session->get('listing');
|
|
| 2336 | 2336 | if (isset($post->post_images)) |
| 2337 | 2337 | $curImages = trim($post->post_images, ","); |
| 2338 | 2338 | |
@@ -2359,7 +2359,7 @@ discard block |
||
| 2359 | 2359 | //$curImages = $img->src.","; |
| 2360 | 2360 | } |
| 2361 | 2361 | |
| 2362 | - $totImg = count((array)$thumb_img_arr); |
|
| 2362 | + $totImg = count((array) $thumb_img_arr); |
|
| 2363 | 2363 | } |
| 2364 | 2364 | |
| 2365 | 2365 | if ($curImages != '') |
@@ -2380,7 +2380,7 @@ discard block |
||
| 2380 | 2380 | if ($show_image_input_box) {
|
| 2381 | 2381 | ?> |
| 2382 | 2382 | |
| 2383 | - <h5 id="geodir_form_title_row" class="geodir-form_title"> <?php echo PRO_PHOTO_TEXT;?> |
|
| 2383 | + <h5 id="geodir_form_title_row" class="geodir-form_title"> <?php echo PRO_PHOTO_TEXT; ?> |
|
| 2384 | 2384 | <?php if ($image_limit == 1) {
|
| 2385 | 2385 | echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>';
|
| 2386 | 2386 | } ?> |
@@ -2403,7 +2403,7 @@ discard block |
||
| 2403 | 2403 | <div |
| 2404 | 2404 | class="plupload-upload-uic hide-if-no-js <?php if ($multiple): ?>plupload-upload-uic-multiple<?php endif; ?>" |
| 2405 | 2405 | id="<?php echo $id; ?>plupload-upload-ui"> |
| 2406 | - <h4><?php _e('Drop files to upload', 'geodirectory');?></h4><br/>
|
|
| 2406 | + <h4><?php _e('Drop files to upload', 'geodirectory'); ?></h4><br/>
|
|
| 2407 | 2407 | <input id="<?php echo $id; ?>plupload-browse-button" type="button" |
| 2408 | 2408 | value="<?php esc_attr_e('Select Files', 'geodirectory'); ?>" class="geodir_button"/>
|
| 2409 | 2409 | <span class="ajaxnonceplu" |
@@ -2420,7 +2420,7 @@ discard block |
||
| 2420 | 2420 | id="<?php echo $id; ?>plupload-thumbs" style="border-top:1px solid #ccc; padding-top:10px;"> |
| 2421 | 2421 | </div> |
| 2422 | 2422 | <span |
| 2423 | - id="upload-msg"><?php _e('Please drag & drop the images to rearrange the order', 'geodirectory');?></span>
|
|
| 2423 | + id="upload-msg"><?php _e('Please drag & drop the images to rearrange the order', 'geodirectory'); ?></span>
|
|
| 2424 | 2424 | <span id="<?php echo $id; ?>upload-error" style="display:none"></span> |
| 2425 | 2425 | </div> |
| 2426 | 2426 | |
@@ -2432,7 +2432,7 @@ discard block |
||
| 2432 | 2432 | * |
| 2433 | 2433 | * @since 1.0.0 |
| 2434 | 2434 | */ |
| 2435 | - do_action('geodir_after_main_form_fields');?>
|
|
| 2435 | + do_action('geodir_after_main_form_fields'); ?>
|
|
| 2436 | 2436 | |
| 2437 | 2437 | |
| 2438 | 2438 | <!-- add captcha code --> |
@@ -2443,7 +2443,7 @@ discard block |
||
| 2443 | 2443 | </script> |
| 2444 | 2444 | <noscript> |
| 2445 | 2445 | <div> |
| 2446 | - <label><?php _e('Type 64 into this box', 'geodirectory');?></label>
|
|
| 2446 | + <label><?php _e('Type 64 into this box', 'geodirectory'); ?></label>
|
|
| 2447 | 2447 | <input type="text" id="geodir_spamblocker_top_form" name="geodir_spamblocker" value="" maxlength="10"/> |
| 2448 | 2448 | </div> |
| 2449 | 2449 | </noscript> |
@@ -2453,10 +2453,10 @@ discard block |
||
| 2453 | 2453 | <!-- end captcha code --> |
| 2454 | 2454 | |
| 2455 | 2455 | <div id="geodir-add-listing-submit" class="geodir_form_row clear_both" style="padding:2px;text-align:center;"> |
| 2456 | - <input type="submit" value="<?php echo PRO_PREVIEW_BUTTON;?>" |
|
| 2457 | - class="geodir_button" <?php echo $submit_button;?>/> |
|
| 2456 | + <input type="submit" value="<?php echo PRO_PREVIEW_BUTTON; ?>" |
|
| 2457 | + class="geodir_button" <?php echo $submit_button; ?>/> |
|
| 2458 | 2458 | <span class="geodir_message_note" |
| 2459 | - style="padding-left:0px;"> <?php _e('Note: You will be able to see a preview in the next page', 'geodirectory');?></span>
|
|
| 2459 | + style="padding-left:0px;"> <?php _e('Note: You will be able to see a preview in the next page', 'geodirectory'); ?></span>
|
|
| 2460 | 2460 | </div> |
| 2461 | 2461 | |
| 2462 | 2462 | </form> |
@@ -2518,7 +2518,7 @@ discard block |
||
| 2518 | 2518 | class="<?php |
| 2519 | 2519 | /** This action is documented in geodirectory_template_actions.php */ |
| 2520 | 2520 | echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>">
|
| 2521 | - <?php dynamic_sidebar('Reg/Login Top Section');?>
|
|
| 2521 | + <?php dynamic_sidebar('Reg/Login Top Section'); ?>
|
|
| 2522 | 2522 | </div><!-- clearfix ends here--> |
| 2523 | 2523 | <?php |
| 2524 | 2524 | } |
@@ -2540,7 +2540,7 @@ discard block |
||
| 2540 | 2540 | |
| 2541 | 2541 | ?> |
| 2542 | 2542 | <script type="text/javascript"> |
| 2543 | - <?php if ( $user_login ) { ?>
|
|
| 2543 | + <?php if ($user_login) { ?>
|
|
| 2544 | 2544 | setTimeout(function () {
|
| 2545 | 2545 | try {
|
| 2546 | 2546 | d = document.getElementById('user_pass');
|
@@ -2557,7 +2557,7 @@ discard block |
||
| 2557 | 2557 | <?php } ?> |
| 2558 | 2558 | </script> |
| 2559 | 2559 | <script type="text/javascript"> |
| 2560 | - <?php if ( $user_login ) { ?>
|
|
| 2560 | + <?php if ($user_login) { ?>
|
|
| 2561 | 2561 | setTimeout(function () {
|
| 2562 | 2562 | try {
|
| 2563 | 2563 | d = document.getElementById('user_pass');
|
@@ -2695,11 +2695,11 @@ discard block |
||
| 2695 | 2695 | $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
|
| 2696 | 2696 | |
| 2697 | 2697 | $title = $list_title; |
| 2698 | - if(geodir_is_page('author')){
|
|
| 2698 | + if (geodir_is_page('author')) {
|
|
| 2699 | 2699 | $gd_page = 'author'; |
| 2700 | - if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
|
|
| 2700 | + if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
|
|
| 2701 | 2701 | $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
|
| 2702 | - }else{
|
|
| 2702 | + } else {
|
|
| 2703 | 2703 | $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
|
| 2704 | 2704 | } |
| 2705 | 2705 | |
@@ -2713,7 +2713,7 @@ discard block |
||
| 2713 | 2713 | * @param string $title The page title including variables. |
| 2714 | 2714 | * @param string $gd_page The GeoDirectory page type if any. |
| 2715 | 2715 | */ |
| 2716 | - $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
|
|
| 2716 | + $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
|
|
| 2717 | 2717 | |
| 2718 | 2718 | echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . |
| 2719 | 2719 | /** |
@@ -2927,7 +2927,7 @@ discard block |
||
| 2927 | 2927 | $post_type_info = get_post_type_object($gd_post_type); |
| 2928 | 2928 | |
| 2929 | 2929 | $pt_name = ''; |
| 2930 | - if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;}
|
|
| 2930 | + if (isset($post_type_info->labels->name)) {$pt_name = $post_type_info->labels->name; }
|
|
| 2931 | 2931 | |
| 2932 | 2932 | if (is_search()) {
|
| 2933 | 2933 | $list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
|
@@ -247,13 +247,14 @@ discard block |
||
| 247 | 247 | */ |
| 248 | 248 | function geodir_add_async_forscript($url) |
| 249 | 249 | {
|
| 250 | - if (strpos($url, '#asyncload')===false) |
|
| 251 | - return $url; |
|
| 252 | - else if (is_admin()) |
|
| 253 | - return str_replace('#asyncload', '', $url);
|
|
| 254 | - else |
|
| 255 | - return str_replace('#asyncload', '', $url)."' async='async";
|
|
| 256 | -} |
|
| 250 | + if (strpos($url, '#asyncload')===false) { |
|
| 251 | + return $url; |
|
| 252 | + } else if (is_admin()) { |
|
| 253 | + return str_replace('#asyncload', '', $url); |
|
| 254 | + } else { |
|
| 255 | + return str_replace('#asyncload', '', $url)."' async='async"; |
|
| 256 | + } |
|
| 257 | + } |
|
| 257 | 258 | add_filter('clean_url', 'geodir_add_async_forscript', 11, 1);
|
| 258 | 259 | |
| 259 | 260 | /** |
@@ -300,7 +301,7 @@ discard block |
||
| 300 | 301 | wp_register_style('geodir-chosen-style', geodir_plugin_url() . '/geodirectory-assets/css/chosen.css', array(), GEODIRECTORY_VERSION);
|
| 301 | 302 | wp_enqueue_style('geodir-chosen-style');
|
| 302 | 303 | |
| 303 | - }else{
|
|
| 304 | + } else{
|
|
| 304 | 305 | wp_register_style('geodir-core-scss', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION);
|
| 305 | 306 | wp_enqueue_style('geodir-core-scss');
|
| 306 | 307 | |
@@ -361,8 +362,10 @@ discard block |
||
| 361 | 362 | |
| 362 | 363 | $half_pages_to_show = round($pages_to_show / 2); |
| 363 | 364 | |
| 364 | - if (geodir_is_page('home') || (get_option('geodir_set_as_home') && is_home())) // dont apply default pagination for geodirectory home page.
|
|
| 365 | - return; |
|
| 365 | + if (geodir_is_page('home') || (get_option('geodir_set_as_home') && is_home())) { |
|
| 366 | + // dont apply default pagination for geodirectory home page. |
|
| 367 | + return; |
|
| 368 | + } |
|
| 366 | 369 | |
| 367 | 370 | if (!is_single()) {
|
| 368 | 371 | if (function_exists('geodir_location_geo_home_link')) {
|
@@ -435,11 +438,21 @@ discard block |
||
| 435 | 438 | } |
| 436 | 439 | $dist_dif = 1000; |
| 437 | 440 | |
| 438 | - if ($dist <= 5000) $dist_dif = 500; |
|
| 439 | - if ($dist <= 1000) $dist_dif = 100; |
|
| 440 | - if ($dist <= 500) $dist_dif = 50; |
|
| 441 | - if ($dist <= 100) $dist_dif = 10; |
|
| 442 | - if ($dist <= 50) $dist_dif = 5; |
|
| 441 | + if ($dist <= 5000) { |
|
| 442 | + $dist_dif = 500; |
|
| 443 | + } |
|
| 444 | + if ($dist <= 1000) { |
|
| 445 | + $dist_dif = 100; |
|
| 446 | + } |
|
| 447 | + if ($dist <= 500) { |
|
| 448 | + $dist_dif = 50; |
|
| 449 | + } |
|
| 450 | + if ($dist <= 100) { |
|
| 451 | + $dist_dif = 10; |
|
| 452 | + } |
|
| 453 | + if ($dist <= 50) { |
|
| 454 | + $dist_dif = 5; |
|
| 455 | + } |
|
| 443 | 456 | |
| 444 | 457 | ?> |
| 445 | 458 | <script type="text/javascript"> |
@@ -501,18 +514,23 @@ discard block |
||
| 501 | 514 | {
|
| 502 | 515 | |
| 503 | 516 | $default_search_for_text = SEARCH_FOR_TEXT; |
| 504 | - if (get_option('geodir_search_field_default_text'))
|
|
| 505 | - $default_search_for_text = __(get_option('geodir_search_field_default_text'), 'geodirectory');
|
|
| 517 | + if (get_option('geodir_search_field_default_text')) { |
|
| 518 | + $default_search_for_text = __(get_option('geodir_search_field_default_text'), 'geodirectory'); |
|
| 519 | + } |
|
| 506 | 520 | |
| 507 | 521 | $default_near_text = NEAR_TEXT; |
| 508 | - if (get_option('geodir_near_field_default_text'))
|
|
| 509 | - $default_near_text = __(get_option('geodir_near_field_default_text'), 'geodirectory');
|
|
| 522 | + if (get_option('geodir_near_field_default_text')) { |
|
| 523 | + $default_near_text = __(get_option('geodir_near_field_default_text'), 'geodirectory'); |
|
| 524 | + } |
|
| 510 | 525 | |
| 511 | 526 | ?> |
| 512 | 527 | |
| 513 | 528 | |
| 514 | 529 | <script type="text/javascript"> |
| 515 | - var default_location = '<?php if($search_location = geodir_get_default_location()) echo $search_location->city ;?>'; |
|
| 530 | + var default_location = '<?php if($search_location = geodir_get_default_location()) { |
|
| 531 | + echo $search_location->city ; |
|
| 532 | +} |
|
| 533 | +?>'; |
|
| 516 | 534 | var latlng; |
| 517 | 535 | var Sgeocoder; |
| 518 | 536 | var address; |
@@ -184,17 +184,17 @@ discard block |
||
| 184 | 184 | |
| 185 | 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 | - wp_enqueue_script('geodirectory-post-custom-js');
|
|
| 188 | - } |
|
| 187 | + wp_enqueue_script('geodirectory-post-custom-js');
|
|
| 188 | + } |
|
| 189 | 189 | |
| 190 | 190 | // font awesome rating script |
| 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);
|
|
| 193 | - wp_enqueue_script('geodir-barrating-js');
|
|
| 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);
|
|
| 196 | - wp_enqueue_script('geodir-jRating-js');
|
|
| 197 | - } |
|
| 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);
|
|
| 193 | + wp_enqueue_script('geodir-barrating-js');
|
|
| 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);
|
|
| 196 | + wp_enqueue_script('geodir-jRating-js');
|
|
| 197 | + } |
|
| 198 | 198 | |
| 199 | 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');
|
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | */ |
| 231 | 231 | function geodir_footer_scripts() |
| 232 | 232 | {
|
| 233 | - echo stripslashes(get_option('geodir_ga_tracking_code'));
|
|
| 233 | + echo stripslashes(get_option('geodir_ga_tracking_code'));
|
|
| 234 | 234 | echo stripslashes(get_option('geodir_footer_scripts'));
|
| 235 | 235 | } |
| 236 | 236 | |
@@ -363,9 +363,9 @@ discard block |
||
| 363 | 363 | return; |
| 364 | 364 | |
| 365 | 365 | if (!is_single()) {
|
| 366 | - if (function_exists('geodir_location_geo_home_link')) {
|
|
| 367 | - remove_filter('home_url', 'geodir_location_geo_home_link', 100000);
|
|
| 368 | - } |
|
| 366 | + if (function_exists('geodir_location_geo_home_link')) {
|
|
| 367 | + remove_filter('home_url', 'geodir_location_geo_home_link', 100000);
|
|
| 368 | + } |
|
| 369 | 369 | $numposts = $wp_query->found_posts; |
| 370 | 370 | |
| 371 | 371 | |
@@ -376,22 +376,22 @@ discard block |
||
| 376 | 376 | } |
| 377 | 377 | |
| 378 | 378 | if ($max_page > 1 || $always_show) {
|
| 379 | - // Extra pagination info |
|
| 380 | - $geodir_pagination_more_info = get_option('geodir_pagination_advance_info');
|
|
| 381 | - $start_no = ( $paged - 1 ) * $posts_per_page + 1; |
|
| 382 | - $end_no = min($paged * $posts_per_page, $numposts); |
|
| 379 | + // Extra pagination info |
|
| 380 | + $geodir_pagination_more_info = get_option('geodir_pagination_advance_info');
|
|
| 381 | + $start_no = ( $paged - 1 ) * $posts_per_page + 1; |
|
| 382 | + $end_no = min($paged * $posts_per_page, $numposts); |
|
| 383 | 383 | |
| 384 | - if ($geodir_pagination_more_info != '') {
|
|
| 385 | - $pagination_info = '<div class="gd-pagination-details">' . wp_sprintf(__('Showing listings %d-%d of %d', 'geodirectory'), $start_no, $end_no, $numposts) . '</div>';
|
|
| 384 | + if ($geodir_pagination_more_info != '') {
|
|
| 385 | + $pagination_info = '<div class="gd-pagination-details">' . wp_sprintf(__('Showing listings %d-%d of %d', 'geodirectory'), $start_no, $end_no, $numposts) . '</div>';
|
|
| 386 | 386 | |
| 387 | - if ($geodir_pagination_more_info == 'before') {
|
|
| 388 | - $before = $before . $pagination_info; |
|
| 389 | - } else if ($geodir_pagination_more_info == 'after') {
|
|
| 390 | - $after = $pagination_info . $after; |
|
| 391 | - } |
|
| 392 | - } |
|
| 387 | + if ($geodir_pagination_more_info == 'before') {
|
|
| 388 | + $before = $before . $pagination_info; |
|
| 389 | + } else if ($geodir_pagination_more_info == 'after') {
|
|
| 390 | + $after = $pagination_info . $after; |
|
| 391 | + } |
|
| 392 | + } |
|
| 393 | 393 | |
| 394 | - echo "$before <div class='Navi'>"; |
|
| 394 | + echo "$before <div class='Navi'>"; |
|
| 395 | 395 | if ($paged >= ($pages_to_show - 1)) {
|
| 396 | 396 | echo '<a href="' . str_replace('&paged', '&paged', get_pagenum_link()) . '">«</a>';
|
| 397 | 397 | } |
@@ -412,9 +412,9 @@ discard block |
||
| 412 | 412 | echo "</div> $after"; |
| 413 | 413 | } |
| 414 | 414 | |
| 415 | - if (function_exists('geodir_location_geo_home_link')) {
|
|
| 416 | - add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2);
|
|
| 417 | - } |
|
| 415 | + if (function_exists('geodir_location_geo_home_link')) {
|
|
| 416 | + add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2);
|
|
| 417 | + } |
|
| 418 | 418 | } |
| 419 | 419 | } |
| 420 | 420 | |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | {
|
| 38 | 38 | $is_detail_page = false; |
| 39 | 39 | |
| 40 | - if((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview') )) {
|
|
| 40 | + if ((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview'))) {
|
|
| 41 | 41 | $is_detail_page = true; |
| 42 | 42 | } |
| 43 | 43 | |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | 'siteurl' => get_option('siteurl'),
|
| 52 | 52 | 'geodir_plugin_url' => geodir_plugin_url(), |
| 53 | 53 | 'geodir_ajax_url' => geodir_get_ajax_url(), |
| 54 | - 'geodir_gd_modal' => (int)get_option('geodir_disable_gb_modal'),
|
|
| 54 | + 'geodir_gd_modal' => (int) get_option('geodir_disable_gb_modal'),
|
|
| 55 | 55 | 'is_rtl' => is_rtl() ? 1 : 0 // fix rtl issue |
| 56 | 56 | ); |
| 57 | 57 | |
@@ -72,25 +72,25 @@ discard block |
||
| 72 | 72 | * |
| 73 | 73 | * } |
| 74 | 74 | */ |
| 75 | - $geodir_vars_data = apply_filters('geodir_vars_data',$geodir_vars_data);
|
|
| 75 | + $geodir_vars_data = apply_filters('geodir_vars_data', $geodir_vars_data);
|
|
| 76 | 76 | |
| 77 | 77 | wp_localize_script('geodirectory-script', 'geodir_var', $geodir_vars_data);
|
| 78 | 78 | |
| 79 | 79 | |
| 80 | 80 | |
| 81 | 81 | |
| 82 | - wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION,true);
|
|
| 83 | - if($is_detail_page){wp_enqueue_script('geodirectory-jquery-flexslider-js');}
|
|
| 82 | + wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION, true);
|
|
| 83 | + if ($is_detail_page) {wp_enqueue_script('geodirectory-jquery-flexslider-js'); }
|
|
| 84 | 84 | |
| 85 | 85 | |
| 86 | 86 | |
| 87 | - wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url() . '/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION,true);
|
|
| 87 | + wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url() . '/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION, true);
|
|
| 88 | 88 | wp_enqueue_script('geodirectory-lightbox-jquery');
|
| 89 | 89 | |
| 90 | 90 | |
| 91 | 91 | |
| 92 | - wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url() . '/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION,true);
|
|
| 93 | - if($is_detail_page){wp_enqueue_script('geodirectory-jquery-simplemodal');}
|
|
| 92 | + wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url() . '/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION, true);
|
|
| 93 | + if ($is_detail_page) {wp_enqueue_script('geodirectory-jquery-simplemodal'); }
|
|
| 94 | 94 | |
| 95 | 95 | |
| 96 | 96 | //if( get_option('geodir_enqueue_google_api_script')==1)
|
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | wp_enqueue_script( 'geodirectory-googlemap-script' ); |
| 112 | 112 | } |
| 113 | 113 | */ |
| 114 | - wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION,true);
|
|
| 114 | + wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION, true);
|
|
| 115 | 115 | wp_enqueue_script('geodirectory-goMap-script');
|
| 116 | 116 | |
| 117 | 117 | |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | wp_enqueue_script('plupload-all');
|
| 134 | 134 | wp_enqueue_script('jquery-ui-sortable');
|
| 135 | 135 | |
| 136 | - wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION,true);
|
|
| 136 | + wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
|
|
| 137 | 137 | wp_enqueue_script('geodirectory-plupload-script');
|
| 138 | 138 | |
| 139 | 139 | // SCRIPT FOR UPLOAD END |
@@ -245,12 +245,12 @@ 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);
|
| 252 | 252 | else |
| 253 | - return str_replace('#asyncload', '', $url)."' async='async";
|
|
| 253 | + return str_replace('#asyncload', '', $url) . "' async='async";
|
|
| 254 | 254 | } |
| 255 | 255 | add_filter('clean_url', 'geodir_add_async_forscript', 11, 1);
|
| 256 | 256 | |
@@ -264,7 +264,7 @@ 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 | 270 | wp_register_style('geodirectory-frontend-style', geodir_plugin_url() . '/geodirectory-assets/css/style.css', array(), GEODIRECTORY_VERSION);
|
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 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{
|
|
| 301 | + } else {
|
|
| 302 | 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 | |
@@ -306,7 +306,7 @@ discard block |
||
| 306 | 306 | |
| 307 | 307 | } |
| 308 | 308 | |
| 309 | - if(is_rtl()){
|
|
| 309 | + if (is_rtl()) {
|
|
| 310 | 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 | } |
@@ -378,7 +378,7 @@ discard block |
||
| 378 | 378 | if ($max_page > 1 || $always_show) {
|
| 379 | 379 | // Extra pagination info |
| 380 | 380 | $geodir_pagination_more_info = get_option('geodir_pagination_advance_info');
|
| 381 | - $start_no = ( $paged - 1 ) * $posts_per_page + 1; |
|
| 381 | + $start_no = ($paged - 1) * $posts_per_page + 1; |
|
| 382 | 382 | $end_no = min($paged * $posts_per_page, $numposts); |
| 383 | 383 | |
| 384 | 384 | if ($geodir_pagination_more_info != '') {
|
@@ -445,7 +445,7 @@ discard block |
||
| 445 | 445 | jQuery(function ($) {
|
| 446 | 446 | $("#distance_slider").slider({
|
| 447 | 447 | range: true, |
| 448 | - values: [0, <?php echo ($_REQUEST['sdist']!='') ? $_REQUEST['sdist'] : "0"; ?>], |
|
| 448 | + values: [0, <?php echo ($_REQUEST['sdist'] != '') ? $_REQUEST['sdist'] : "0"; ?>], |
|
| 449 | 449 | min: 0, |
| 450 | 450 | max: <?php echo $dist; ?>, |
| 451 | 451 | step: <?php echo $dist_dif; ?>, |
@@ -510,7 +510,7 @@ discard block |
||
| 510 | 510 | |
| 511 | 511 | |
| 512 | 512 | <script type="text/javascript"> |
| 513 | - var default_location = '<?php if($search_location = geodir_get_default_location()) echo $search_location->city ;?>'; |
|
| 513 | + var default_location = '<?php if ($search_location = geodir_get_default_location()) echo $search_location->city; ?>'; |
|
| 514 | 514 | var latlng; |
| 515 | 515 | var Sgeocoder; |
| 516 | 516 | var address; |
@@ -523,7 +523,7 @@ discard block |
||
| 523 | 523 | var $form = jQuery(this).closest('form');
|
| 524 | 524 | |
| 525 | 525 | if (jQuery("#sdist input[type='radio']:checked").length != 0) dist = jQuery("#sdist input[type='radio']:checked").val();
|
| 526 | - if (jQuery('.search_text', $form).val() == '' || jQuery('.search_text', $form).val() == '<?php echo $default_search_for_text;?>') jQuery('.search_text', $form).val(s);
|
|
| 526 | + if (jQuery('.search_text', $form).val() == '' || jQuery('.search_text', $form).val() == '<?php echo $default_search_for_text; ?>') jQuery('.search_text', $form).val(s);
|
|
| 527 | 527 | |
| 528 | 528 | // Disable location based search for disabled location post type. |
| 529 | 529 | if (jQuery('.search_by_post', $form).val() != '' && typeof gd_cpt_no_location == 'function') {
|
@@ -537,7 +537,7 @@ discard block |
||
| 537 | 537 | } |
| 538 | 538 | } |
| 539 | 539 | |
| 540 | - 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;?>')) {
|
|
| 540 | + 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; ?>')) {
|
|
| 541 | 541 | geodir_setsearch($form); |
| 542 | 542 | } else {
|
| 543 | 543 | jQuery(".snear", $form).val('');
|
@@ -557,7 +557,7 @@ discard block |
||
| 557 | 557 | }); |
| 558 | 558 | |
| 559 | 559 | function geodir_setsearch($form) {
|
| 560 | - 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);
|
|
| 560 | + 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);
|
|
| 561 | 561 | geocodeAddress($form); |
| 562 | 562 | } |
| 563 | 563 | |
@@ -570,8 +570,8 @@ discard block |
||
| 570 | 570 | function geocodeAddress($form) {
|
| 571 | 571 | Sgeocoder = new google.maps.Geocoder(); // Call the geocode function |
| 572 | 572 | |
| 573 | - if (jQuery('.snear', $form).val() == '' || ( jQuery('.sgeo_lat').val() != '' && jQuery('.sgeo_lon').val() != '' ) || jQuery('.snear', $form).val().match("^<?php _e('In:','geodirectory');?>")) {
|
|
| 574 | - if (jQuery('.snear', $form).val().match("^<?php _e('In:','geodirectory');?>")) {
|
|
| 573 | + if (jQuery('.snear', $form).val() == '' || ( jQuery('.sgeo_lat').val() != '' && jQuery('.sgeo_lon').val() != '' ) || jQuery('.snear', $form).val().match("^<?php _e('In:', 'geodirectory'); ?>")) {
|
|
| 574 | + if (jQuery('.snear', $form).val().match("^<?php _e('In:', 'geodirectory'); ?>")) {
|
|
| 575 | 575 | jQuery(".snear", $form).val('');
|
| 576 | 576 | } |
| 577 | 577 | jQuery($form).submit(); |
@@ -579,24 +579,24 @@ discard block |
||
| 579 | 579 | |
| 580 | 580 | var address = jQuery(".snear", $form).val();
|
| 581 | 581 | |
| 582 | - if (jQuery('.snear', $form).val() == '<?php echo $default_near_text;?>') {
|
|
| 582 | + if (jQuery('.snear', $form).val() == '<?php echo $default_near_text; ?>') {
|
|
| 583 | 583 | initialise2(); |
| 584 | 584 | } else {
|
| 585 | 585 | |
| 586 | 586 | Sgeocoder.geocode({'address': address<?php
|
| 587 | - if($near_add = get_option('geodir_search_near_addition')){echo '+", '.$near_add.'"';}
|
|
| 588 | - if($near_add2 = |
|
| 587 | + if ($near_add = get_option('geodir_search_near_addition')) {echo '+", ' . $near_add . '"'; }
|
|
| 588 | + if ($near_add2 = |
|
| 589 | 589 | /** |
| 590 | 590 | * Adds any extra info to the near search box query when trying to geolocate it via google api. |
| 591 | 591 | * |
| 592 | 592 | * @since 1.0.0 |
| 593 | 593 | */ |
| 594 | - apply_filters('geodir_search_near_addition','')){echo $near_add2;}//gt_advanced_near_search();?>},
|
|
| 594 | + apply_filters('geodir_search_near_addition', '')) {echo $near_add2; }//gt_advanced_near_search();?>},
|
|
| 595 | 595 | function (results, status) {
|
| 596 | 596 | if (status == google.maps.GeocoderStatus.OK) {
|
| 597 | 597 | updateSearchPosition(results[0].geometry.location, $form); |
| 598 | 598 | } else {
|
| 599 | - alert("<?php _e('Search was not successful for the following reason:','geodirectory');?>" + status);
|
|
| 599 | + alert("<?php _e('Search was not successful for the following reason:', 'geodirectory'); ?>" + status);
|
|
| 600 | 600 | } |
| 601 | 601 | }); |
| 602 | 602 | } |
@@ -627,19 +627,19 @@ discard block |
||
| 627 | 627 | var msg; |
| 628 | 628 | switch (err.code) {
|
| 629 | 629 | case err.UNKNOWN_ERROR: |
| 630 | - msg = "<?php _e('Unable to find your location','geodirectory');?>";
|
|
| 630 | + msg = "<?php _e('Unable to find your location', 'geodirectory'); ?>";
|
|
| 631 | 631 | break; |
| 632 | 632 | case err.PERMISSION_DENINED: |
| 633 | - msg = "<?php _e('Permission denied in finding your location','geodirectory');?>";
|
|
| 633 | + msg = "<?php _e('Permission denied in finding your location', 'geodirectory'); ?>";
|
|
| 634 | 634 | break; |
| 635 | 635 | case err.POSITION_UNAVAILABLE: |
| 636 | - msg = "<?php _e('Your location is currently unknown','geodirectory');?>";
|
|
| 636 | + msg = "<?php _e('Your location is currently unknown', 'geodirectory'); ?>";
|
|
| 637 | 637 | break; |
| 638 | 638 | case err.BREAK: |
| 639 | - msg = "<?php _e('Attempt to find location took too long','geodirectory');?>";
|
|
| 639 | + msg = "<?php _e('Attempt to find location took too long', 'geodirectory'); ?>";
|
|
| 640 | 640 | break; |
| 641 | 641 | default: |
| 642 | - msg = "<?php _e('Location detection not supported in browser','geodirectory');?>";
|
|
| 642 | + msg = "<?php _e('Location detection not supported in browser', 'geodirectory'); ?>";
|
|
| 643 | 643 | } |
| 644 | 644 | jQuery('#info').html(msg);
|
| 645 | 645 | } |
@@ -679,7 +679,7 @@ discard block |
||
| 679 | 679 | * @param object $post The post object. |
| 680 | 680 | * @param string $link The link to the post. |
| 681 | 681 | */ |
| 682 | - return apply_filters('geodir_featured_badge_on_image', '<a href="' . $link . '"><span class="geodir_featured_img"> </span></a>',$post,$link);
|
|
| 682 | + return apply_filters('geodir_featured_badge_on_image', '<a href="' . $link . '"><span class="geodir_featured_img"> </span></a>', $post, $link);
|
|
| 683 | 683 | break; |
| 684 | 684 | case 'new' : |
| 685 | 685 | /** |
@@ -689,7 +689,7 @@ discard block |
||
| 689 | 689 | * @param object $post The post object. |
| 690 | 690 | * @param string $link The link to the post. |
| 691 | 691 | */ |
| 692 | - return apply_filters('geodir_new_badge_on_image', '<a href="' . $link . '"><span class="geodir_new_listing"> </span></a>',$post,$link);
|
|
| 692 | + return apply_filters('geodir_new_badge_on_image', '<a href="' . $link . '"><span class="geodir_new_listing"> </span></a>', $post, $link);
|
|
| 693 | 693 | break; |
| 694 | 694 | |
| 695 | 695 | } |
@@ -1083,7 +1083,7 @@ |
||
| 1083 | 1083 | * @package GeoDirectory |
| 1084 | 1084 | */ |
| 1085 | 1085 | include_once('geodirectory-widgets/geodirectory_bestof_widget.php');
|
| 1086 | - /** |
|
| 1086 | + /** |
|
| 1087 | 1087 | * Contains all functions for cpt categories widget. |
| 1088 | 1088 | * |
| 1089 | 1089 | * @since 1.5.4 |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | public function form($instance) |
| 302 | 302 | {
|
| 303 | 303 | //widgetform in backend |
| 304 | - $instance = wp_parse_args((array)$instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'desc1' => ''));
|
|
| 304 | + $instance = wp_parse_args((array) $instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'desc1' => ''));
|
|
| 305 | 305 | $title = strip_tags($instance['title']); |
| 306 | 306 | |
| 307 | 307 | ?> |
@@ -373,7 +373,7 @@ discard block |
||
| 373 | 373 | ?> |
| 374 | 374 | |
| 375 | 375 | <a href="http://twitter.com/share" |
| 376 | - class="twitter-share-button"><?php _e('Tweet', 'geodirectory');?></a>
|
|
| 376 | + class="twitter-share-button"><?php _e('Tweet', 'geodirectory'); ?></a>
|
|
| 377 | 377 | |
| 378 | 378 | <script type="text/javascript" src="//platform.twitter.com/widgets.js"></script> |
| 379 | 379 | |
@@ -443,7 +443,7 @@ discard block |
||
| 443 | 443 | public function form($instance) |
| 444 | 444 | {
|
| 445 | 445 | //widgetform in backend |
| 446 | - $instance = wp_parse_args((array)$instance, array('title' => ''));
|
|
| 446 | + $instance = wp_parse_args((array) $instance, array('title' => ''));
|
|
| 447 | 447 | $title = strip_tags($instance['title']); |
| 448 | 448 | ?> |
| 449 | 449 | <p>No settings for this widget</p> |
@@ -519,7 +519,7 @@ discard block |
||
| 519 | 519 | echo 'http://feeds2.feedburner.com/' . $id; |
| 520 | 520 | } else {
|
| 521 | 521 | bloginfo('rss_url');
|
| 522 | - } ?>"><i class="fa fa-rss-square"></i> </a><?php echo $after_title;?> |
|
| 522 | + } ?>"><i class="fa fa-rss-square"></i> </a><?php echo $after_title; ?> |
|
| 523 | 523 | |
| 524 | 524 | <?php if ($text <> "") { ?>
|
| 525 | 525 | |
@@ -584,7 +584,7 @@ discard block |
||
| 584 | 584 | public function form($instance) |
| 585 | 585 | {
|
| 586 | 586 | //widgetform in backend |
| 587 | - $instance = wp_parse_args((array)$instance, array('title' => '', 'id' => '', 'advt1' => '', 'text' => '', 'twitter' => '', 'facebook' => '', 'digg' => '', 'myspace' => ''));
|
|
| 587 | + $instance = wp_parse_args((array) $instance, array('title' => '', 'id' => '', 'advt1' => '', 'text' => '', 'twitter' => '', 'facebook' => '', 'digg' => '', 'myspace' => ''));
|
|
| 588 | 588 | |
| 589 | 589 | $id = strip_tags($instance['id']); |
| 590 | 590 | |
@@ -596,19 +596,19 @@ discard block |
||
| 596 | 596 | |
| 597 | 597 | ?> |
| 598 | 598 | <p><label |
| 599 | - for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title', 'geodirectory');?>:
|
|
| 599 | + for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title', 'geodirectory'); ?>:
|
|
| 600 | 600 | <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>"
|
| 601 | 601 | name="<?php echo $this->get_field_name('title'); ?>" type="text"
|
| 602 | 602 | value="<?php echo esc_attr($title); ?>"/></label></p> |
| 603 | 603 | |
| 604 | 604 | <p><label |
| 605 | - for="<?php echo $this->get_field_id('id'); ?>"><?php _e('Feedburner ID (ex :- geotheme)', 'geodirectory');?>
|
|
| 605 | + for="<?php echo $this->get_field_id('id'); ?>"><?php _e('Feedburner ID (ex :- geotheme)', 'geodirectory'); ?>
|
|
| 606 | 606 | : <input class="widefat" id="<?php echo $this->get_field_id('id'); ?>"
|
| 607 | 607 | name="<?php echo $this->get_field_name('id'); ?>" type="text"
|
| 608 | 608 | value="<?php echo esc_attr($id); ?>"/></label></p> |
| 609 | 609 | |
| 610 | 610 | <p><label |
| 611 | - for="<?php echo $this->get_field_id('text'); ?>"><?php _e('Short Description', 'geodirectory');?>
|
|
| 611 | + for="<?php echo $this->get_field_id('text'); ?>"><?php _e('Short Description', 'geodirectory'); ?>
|
|
| 612 | 612 | <textarea class="widefat" rows="6" cols="20" id="<?php echo $this->get_field_id('text'); ?>"
|
| 613 | 613 | name="<?php echo $this->get_field_name('text'); ?>"><?php echo esc_attr($text); ?></textarea></label>
|
| 614 | 614 | </p> |
@@ -704,12 +704,12 @@ discard block |
||
| 704 | 704 | public function form($instance) |
| 705 | 705 | {
|
| 706 | 706 | //widgetform in backend |
| 707 | - $instance = wp_parse_args((array)$instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'desc1' => ''));
|
|
| 707 | + $instance = wp_parse_args((array) $instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'desc1' => ''));
|
|
| 708 | 708 | |
| 709 | 709 | $desc1 = ($instance['desc1']); |
| 710 | 710 | ?> |
| 711 | 711 | <p><label |
| 712 | - for="<?php echo $this->get_field_id('desc1'); ?>"><?php _e('Your Advt code (ex.google adsense, etc.)', 'geodirectory');?>
|
|
| 712 | + for="<?php echo $this->get_field_id('desc1'); ?>"><?php _e('Your Advt code (ex.google adsense, etc.)', 'geodirectory'); ?>
|
|
| 713 | 713 | <textarea class="widefat" rows="6" cols="20" id="<?php echo $this->get_field_id('desc1'); ?>"
|
| 714 | 714 | name="<?php echo $this->get_field_name('desc1'); ?>"><?php echo esc_attr($desc1); ?></textarea></label>
|
| 715 | 715 | </p> |
@@ -819,14 +819,14 @@ discard block |
||
| 819 | 819 | {
|
| 820 | 820 | |
| 821 | 821 | //widgetform in backend |
| 822 | - $instance = wp_parse_args((array)$instance, array('title' => '', 'id' => '', 'number' => ''));
|
|
| 822 | + $instance = wp_parse_args((array) $instance, array('title' => '', 'id' => '', 'number' => ''));
|
|
| 823 | 823 | $id = strip_tags($instance['id']); |
| 824 | 824 | $number = strip_tags($instance['number']); |
| 825 | 825 | ?> |
| 826 | 826 | |
| 827 | 827 | <p> |
| 828 | 828 | <label |
| 829 | - for="<?php echo $this->get_field_id('id'); ?>"><?php _e('Flickr ID', 'geodirectory');?>
|
|
| 829 | + for="<?php echo $this->get_field_id('id'); ?>"><?php _e('Flickr ID', 'geodirectory'); ?>
|
|
| 830 | 830 | (<a href="http://www.idgettr.com">idGettr</a>): |
| 831 | 831 | <input class="widefat" id="<?php echo $this->get_field_id('id'); ?>"
|
| 832 | 832 | name="<?php echo $this->get_field_name('id'); ?>" type="text"
|
@@ -836,7 +836,7 @@ discard block |
||
| 836 | 836 | |
| 837 | 837 | <p> |
| 838 | 838 | <label |
| 839 | - for="<?php echo $this->get_field_id('number'); ?>"><?php _e('Number of photos:', 'geodirectory');?>
|
|
| 839 | + for="<?php echo $this->get_field_id('number'); ?>"><?php _e('Number of photos:', 'geodirectory'); ?>
|
|
| 840 | 840 | <input class="widefat" id="<?php echo $this->get_field_id('number'); ?>"
|
| 841 | 841 | name="<?php echo $this->get_field_name('number'); ?>" type="text"
|
| 842 | 842 | value="<?php echo esc_attr($number); ?>"/> |
@@ -932,12 +932,12 @@ discard block |
||
| 932 | 932 | public function form($instance) |
| 933 | 933 | {
|
| 934 | 934 | //widgetform in backend |
| 935 | - $instance = wp_parse_args((array)$instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'gd_tw_desc1' => ''));
|
|
| 935 | + $instance = wp_parse_args((array) $instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'gd_tw_desc1' => ''));
|
|
| 936 | 936 | |
| 937 | 937 | $desc1 = ($instance['gd_tw_desc1']); |
| 938 | 938 | ?> |
| 939 | 939 | <p><label |
| 940 | - for="<?php echo $this->get_field_id('gd_tw_desc1'); ?>"><?php _e('Your twitter code', 'geodirectory');?>
|
|
| 940 | + for="<?php echo $this->get_field_id('gd_tw_desc1'); ?>"><?php _e('Your twitter code', 'geodirectory'); ?>
|
|
| 941 | 941 | <textarea class="widefat" rows="6" cols="20" |
| 942 | 942 | id="<?php echo $this->get_field_id('gd_tw_desc1'); ?>"
|
| 943 | 943 | name="<?php echo $this->get_field_name('gd_tw_desc1'); ?>"><?php echo esc_attr($desc1); ?></textarea></label>
|
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | |
| 50 | - add_action('init', 'gd_fix_cpt_rewrite_slug', 11);// this needs to be kept for a few versions
|
|
| 50 | + add_action('init', 'gd_fix_cpt_rewrite_slug', 11); // this needs to be kept for a few versions
|
|
| 51 | 51 | |
| 52 | 52 | update_option('geodirectory' . '_db_version', GEODIRECTORY_VERSION);
|
| 53 | 53 | |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | * @since 1.0.0 |
| 85 | 85 | * @package GeoDirectory |
| 86 | 86 | */ |
| 87 | -function geodir_upgrade_146(){
|
|
| 87 | +function geodir_upgrade_146() {
|
|
| 88 | 88 | gd_convert_virtual_pages(); |
| 89 | 89 | } |
| 90 | 90 | |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | * @since 1.5.0 |
| 95 | 95 | * @package GeoDirectory |
| 96 | 96 | */ |
| 97 | -function geodir_upgrade_150(){
|
|
| 97 | +function geodir_upgrade_150() {
|
|
| 98 | 98 | gd_fix_cpt_rewrite_slug(); |
| 99 | 99 | } |
| 100 | 100 | |
@@ -106,12 +106,12 @@ discard block |
||
| 106 | 106 | * @since 1.4.8 |
| 107 | 107 | * @package GeoDirectory |
| 108 | 108 | */ |
| 109 | -function geodir_upgrade_148(){
|
|
| 109 | +function geodir_upgrade_148() {
|
|
| 110 | 110 | /* |
| 111 | 111 | * Blank the users google password if present as we now use oAuth 2.0 |
| 112 | 112 | */ |
| 113 | - update_option('geodir_ga_pass','');
|
|
| 114 | - update_option('geodir_ga_user','');
|
|
| 113 | + update_option('geodir_ga_pass', '');
|
|
| 114 | + update_option('geodir_ga_user', '');
|
|
| 115 | 115 | |
| 116 | 116 | } |
| 117 | 117 | |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | * @since 1.5.3 |
| 123 | 123 | * @package GeoDirectory |
| 124 | 124 | */ |
| 125 | -function geodir_upgrade_153(){
|
|
| 125 | +function geodir_upgrade_153() {
|
|
| 126 | 126 | geodir_create_page(esc_sql(_x('gd-info', 'page_slug', 'geodirectory')), 'geodir_info_page', __('Info', 'geodirectory'), '');
|
| 127 | 127 | geodir_create_page(esc_sql(_x('gd-login', 'page_slug', 'geodirectory')), 'geodir_login_page', __('Login', 'geodirectory'), '');
|
| 128 | 128 | } |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | * @since 1.5.3 |
| 134 | 134 | * @package GeoDirectory |
| 135 | 135 | */ |
| 136 | -function geodir_upgrade_154(){
|
|
| 136 | +function geodir_upgrade_154() {
|
|
| 137 | 137 | geodir_create_page(esc_sql(_x('gd-home', 'page_slug', 'geodirectory')), 'geodir_home_page', __('GD Home page', 'geodirectory'), '');
|
| 138 | 138 | } |
| 139 | 139 | |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | * @since 1.5.2 |
| 144 | 144 | * @package GeoDirectory |
| 145 | 145 | */ |
| 146 | -function geodir_upgrade_152(){
|
|
| 146 | +function geodir_upgrade_152() {
|
|
| 147 | 147 | gd_fix_address_detail_table_limit(); |
| 148 | 148 | } |
| 149 | 149 | |
@@ -641,7 +641,7 @@ discard block |
||
| 641 | 641 | |
| 642 | 642 | update_option('gd_theme_compats', $theme_compat);
|
| 643 | 643 | |
| 644 | - gd_set_theme_compat();// set the compat pack if avail |
|
| 644 | + gd_set_theme_compat(); // set the compat pack if avail |
|
| 645 | 645 | } |
| 646 | 646 | |
| 647 | 647 | |
@@ -652,7 +652,7 @@ discard block |
||
| 652 | 652 | * @package GeoDirectory |
| 653 | 653 | * @global object $wpdb WordPress Database object. |
| 654 | 654 | */ |
| 655 | -function gd_convert_virtual_pages(){
|
|
| 655 | +function gd_convert_virtual_pages() {
|
|
| 656 | 656 | global $wpdb; |
| 657 | 657 | |
| 658 | 658 | // Update the add listing page settings |
@@ -663,9 +663,9 @@ discard block |
||
| 663 | 663 | ) |
| 664 | 664 | ); |
| 665 | 665 | |
| 666 | - if($add_listing_page){
|
|
| 667 | - wp_update_post( array('ID' => $add_listing_page, 'post_status' => 'publish') );
|
|
| 668 | - update_option( 'geodir_add_listing_page', $add_listing_page); |
|
| 666 | + if ($add_listing_page) {
|
|
| 667 | + wp_update_post(array('ID' => $add_listing_page, 'post_status' => 'publish'));
|
|
| 668 | + update_option('geodir_add_listing_page', $add_listing_page);
|
|
| 669 | 669 | } |
| 670 | 670 | |
| 671 | 671 | // Update the listing preview page settings |
@@ -676,9 +676,9 @@ discard block |
||
| 676 | 676 | ) |
| 677 | 677 | ); |
| 678 | 678 | |
| 679 | - if($listing_preview_page){
|
|
| 680 | - wp_update_post( array('ID' => $listing_preview_page, 'post_status' => 'publish') );
|
|
| 681 | - update_option( 'geodir_preview_page', $listing_preview_page); |
|
| 679 | + if ($listing_preview_page) {
|
|
| 680 | + wp_update_post(array('ID' => $listing_preview_page, 'post_status' => 'publish'));
|
|
| 681 | + update_option('geodir_preview_page', $listing_preview_page);
|
|
| 682 | 682 | } |
| 683 | 683 | |
| 684 | 684 | // Update the listing success page settings |
@@ -689,9 +689,9 @@ discard block |
||
| 689 | 689 | ) |
| 690 | 690 | ); |
| 691 | 691 | |
| 692 | - if($listing_success_page){
|
|
| 693 | - wp_update_post( array('ID' => $listing_success_page, 'post_status' => 'publish') );
|
|
| 694 | - update_option( 'geodir_success_page', $listing_success_page); |
|
| 692 | + if ($listing_success_page) {
|
|
| 693 | + wp_update_post(array('ID' => $listing_success_page, 'post_status' => 'publish'));
|
|
| 694 | + update_option('geodir_success_page', $listing_success_page);
|
|
| 695 | 695 | } |
| 696 | 696 | |
| 697 | 697 | // Update the listing success page settings |
@@ -702,11 +702,11 @@ discard block |
||
| 702 | 702 | ) |
| 703 | 703 | ); |
| 704 | 704 | |
| 705 | - if($location_page){
|
|
| 705 | + if ($location_page) {
|
|
| 706 | 706 | $location_slug = get_option('geodir_location_prefix');
|
| 707 | - if(!$location_slug ){$location_slug = 'location';}
|
|
| 708 | - wp_update_post( array('ID' => $location_page, 'post_status' => 'publish','post_name' => $location_slug) );
|
|
| 709 | - update_option( 'geodir_location_page', $location_page); |
|
| 707 | + if (!$location_slug) {$location_slug = 'location'; }
|
|
| 708 | + wp_update_post(array('ID' => $location_page, 'post_status' => 'publish', 'post_name' => $location_slug));
|
|
| 709 | + update_option('geodir_location_page', $location_page);
|
|
| 710 | 710 | } |
| 711 | 711 | |
| 712 | 712 | } |
@@ -725,13 +725,13 @@ discard block |
||
| 725 | 725 | $post_types = get_option('geodir_post_types');
|
| 726 | 726 | |
| 727 | 727 | |
| 728 | - if (is_array($post_types)){
|
|
| 728 | + if (is_array($post_types)) {
|
|
| 729 | 729 | |
| 730 | 730 | foreach ($post_types as $post_type => $args) {
|
| 731 | 731 | |
| 732 | 732 | |
| 733 | - if(isset($args['rewrite']['slug'])){
|
|
| 734 | - $args['rewrite']['slug'] = str_replace("/%gd_taxonomy%","",$args['rewrite']['slug']);
|
|
| 733 | + if (isset($args['rewrite']['slug'])) {
|
|
| 734 | + $args['rewrite']['slug'] = str_replace("/%gd_taxonomy%", "", $args['rewrite']['slug']);
|
|
| 735 | 735 | } |
| 736 | 736 | |
| 737 | 737 | $alt_post_types[$post_type] = $args; |
@@ -739,8 +739,8 @@ discard block |
||
| 739 | 739 | } |
| 740 | 740 | } |
| 741 | 741 | |
| 742 | - if(!empty($alt_post_types)) {
|
|
| 743 | - update_option('geodir_post_types',$alt_post_types);
|
|
| 742 | + if (!empty($alt_post_types)) {
|
|
| 743 | + update_option('geodir_post_types', $alt_post_types);
|
|
| 744 | 744 | } |
| 745 | 745 | |
| 746 | 746 | |